1 #include "PuyoStory.h" 2 #include "PuyoCommander.h" 3 4 #ifndef DATADIR 5 extern char *DATADIR; 6 #endif 7 8 PuyoStory *theStory; 9 10 int NB_STORIES = 6; 11 12 extern void launch_scenar(const char *f); 13 extern void draw_scenar(); 14 PuyoStory(PuyoCommander * com,int num)15PuyoStory::PuyoStory(PuyoCommander *com, int num) : num(num), commander(com) 16 {} 17 ~PuyoStory()18PuyoStory::~PuyoStory() 19 {} 20 loop()21void PuyoStory::loop() 22 { 23 theStory = this; 24 if (num==0) { 25 char temp[1024]; 26 sprintf(temp, "%s/story/intro.txt", DATADIR); 27 launch_scenar(temp); 28 } 29 else { 30 char stories[1024]; 31 sprintf(stories, "%s/story%d.txt", DATADIR, num); 32 launch_scenar(stories); 33 } 34 } 35 draw()36void PuyoStory::draw() 37 { 38 draw_scenar(); 39 } 40