LSystem::LSystem(const string &filename) : screen( IOManager::getInstance().getScreen() ), // The next line would call the copy constructor, for no good reason!! //parser( ParseXML(filename) ), parser( filename ), xmlData(), spriteSurface(NULL), width(0), height(0), state(State()), BLACK( SDL_MapRGB(screen->format, 0x00, 0x00, 0x00) ), MAGENTA( SDL_MapRGB(screen->format, 0xff, 0x00, 0xff) ), WHITE( SDL_MapRGB(screen->format, 0xff, 0xff, 0xff) ), levels(0), angle(0), startX(0), startY(0), strokeLength(1), strokeWidth(1), facing(0), strokeColor(BLACK), startSymbol('F'), grammar(), stateStack( ), sentence( ) { loadSpecification(); buildSentence(); fillSprite(); }
int main( int argc, char *argv[] ) { char filename[40]; int debug = 0; parseOptions( argv, argc, &debug, filename ); srand(time(NULL)); bzero(bigramArray, sizeof(bigramArray)); strcpy(wordVector[0], "<START>"); strcpy(wordVector[1], "<END>"); parseFile( filename ); if (debug) emitMatrix(); buildSentence(); return 0; }