Changeset 64 for cpp/gdk/conv_f1.cpp


Ignore:
Timestamp:
01/28/11 23:29:40 (14 years ago)
Author:
Maciej Komosinski
Message:

a lot of minor fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/gdk/conv_f1.cpp

    r5 r64  
    1 // This file is a part of Framsticks GDK library.
    2 // Copyright (C) 2002-2006  Szymon Ulatowski.  See LICENSE.txt for details.
    3 // Refer to http://www.frams.alife.pl/ for further information.
     1// This file is a part of the Framsticks GDK library.
     2// Copyright (C) 2002-2011  Szymon Ulatowski.  See LICENSE.txt for details.
     3// Refer to http://www.framsticks.com/ for further information.
    44
    55#include "conv_f1.h"
     
    4848void addOrRememberInput(int n1,int n2,float w)
    4949                {
    50                 if (!addInput(n1,n2,w,false))
    51                         connections+=Connection(n1,n2,w);
     50                //if (!addInput(n1,n2,w,false))
     51                connections+=Connection(n1,n2,w);
    5252                }
    5353bool addInput(int n1,int n2,float w,bool final)
     
    270270}
    271271
    272 // remove leading & trailing whitespaces
    273 static void trim(SString& s)
    274 {
    275 const char*b=(const char*)s;
    276 const char*e=b+s.len();
    277 while((b<e)&&(*b<=' ')) b++;
    278 while((b<e)&&(e[-1]<=' ')) e--;
    279 if ((e-b)==s.len()) return;
    280 char* t=s.directWrite();
    281 if (t!=b) memmove(t,b,e-b);
    282 s.endWrite(e-b);
    283 }
    284 
    285272const char* Builder::growNeuro(const char* t, F1Props& props,int &hasmuscles)
    286273{
     
    346333                                haveclass=1;
    347334                                SString clsname(begin,t-begin);
    348                                 trim(clsname);
     335                                clsname=trim(clsname);
    349336                                last_f1_neuro->setClassName(clsname);
    350337                                NeuroClass *cls=last_f1_neuro->getClass();
Note: See TracChangeset for help on using the changeset viewer.