Thread: [Fftrader-cvs] fftrader/src engine.cpp,1.3,1.4 engine.h,1.3,1.4 fftfile.cpp,1.3,1.4 graphics.cpp,1.1
Status: Alpha
Brought to you by:
tomt64
|
From: TomT64 <to...@us...> - 2005-08-23 09:56:56
|
Update of /cvsroot/fftrader/fftrader/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15827/src Modified Files: engine.cpp engine.h fftfile.cpp graphics.cpp graphics.h guiapply.cpp guiapply.h log.cpp log.h main.cpp map.cpp map.h mapobject.cpp py_baselib.cpp py_baselib.h scenario.cpp shop.cpp units.cpp Log Message: More scripting code, and added verbose option to Log and commandline options Index: engine.h =================================================================== RCS file: /cvsroot/fftrader/fftrader/src/engine.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** engine.h 23 Aug 2005 03:40:09 -0000 1.3 --- engine.h 23 Aug 2005 09:56:44 -0000 1.4 *************** *** 26,29 **** --- 26,30 ---- StarField *stars; bool above; + int factor; }; struct FFTSound *************** *** 44,49 **** ~Engine(); void Quit(); ! void StartGame(); void CleanUpGame(); void SetMainModule(std::string modulename); Unit *GetMainShip(); --- 45,51 ---- ~Engine(); void Quit(); ! bool StartGame(); void CleanUpGame(); + void Render(); void SetMainModule(std::string modulename); Unit *GetMainShip(); *************** *** 63,67 **** SDL_Surface *GetSurface(std::string name); void AddSurface(std::string name, SDL_Surface *surface); ! void AddStarfield(StarField *stars, bool above); private: bool running; --- 65,69 ---- SDL_Surface *GetSurface(std::string name); void AddSurface(std::string name, SDL_Surface *surface); ! void AddStarfield(StarField *stars, bool above, int factor); private: bool running; Index: units.cpp =================================================================== RCS file: /cvsroot/fftrader/fftrader/src/units.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** units.cpp 19 Aug 2005 08:22:34 -0000 1.2 --- units.cpp 23 Aug 2005 09:56:44 -0000 1.3 *************** *** 685,689 **** this->RemoveWeaponFromSlot(slotid); this->NextWeapon(); ! Log::Write("Removed and changed weapon"); } } --- 685,689 ---- this->RemoveWeaponFromSlot(slotid); this->NextWeapon(); ! Log::WriteVerbose("Removed and changed weapon"); } } *************** *** 1089,1096 **** void Unit::FPK_NewImages(std::string fpk, std::string imagename) { ! Log::Write("FPK_NewImages: Loading new image (%s) from fpk %s",imagename.c_str(),fpk.c_str()); usingfpk=fpk; imgload=imagename; ! Log::Write("FPK_NewImages: Freeing existing images"); FreeImages(); if(hasShield) --- 1089,1096 ---- void Unit::FPK_NewImages(std::string fpk, std::string imagename) { ! Log::WriteVerbose("FPK_NewImages: Loading new image (%s) from fpk %s",imagename.c_str(),fpk.c_str()); usingfpk=fpk; imgload=imagename; ! Log::WriteVerbose("FPK_NewImages: Freeing existing images"); FreeImages(); if(hasShield) *************** *** 1104,1111 **** hasShield=false; } ! Log::Write("FPK_NewImages: Loading new images"); LoadImages(0, 71); int i; ! Log::Write("FPK_NewImages: Making new bitmasks"); for (i=0; i<UNITS_NUM_FRAMES; i++) { --- 1104,1111 ---- hasShield=false; } ! Log::WriteVerbose("FPK_NewImages: Loading new images"); LoadImages(0, 71); int i; ! Log::WriteVerbose("FPK_NewImages: Making new bitmasks"); for (i=0; i<UNITS_NUM_FRAMES; i++) { *************** *** 1127,1131 **** if (end<0) { end=0; } if (start<0) { start=0; } ! Log::Write("Unit::LoadImages: Loading base image (%s) from fpk %s",imgload.c_str(),usingfpk.c_str()); temp=FPK_LoadIMG(usingfpk, imgload); if (dispimg) --- 1127,1131 ---- if (end<0) { end=0; } if (start<0) { start=0; } ! Log::WriteVerbose("Unit::LoadImages: Loading base image (%s) from fpk %s",imgload.c_str(),usingfpk.c_str()); temp=FPK_LoadIMG(usingfpk, imgload); if (dispimg) *************** *** 1134,1149 **** dispimg=0; } ! Log::Write("Unit::LoadImages: Setting display image"); dispimg=rotozoomSurface(temp, 0, 0.5, SMOOTH); if (cr>0 || cg>0 || cb>0) { ! Log::Write("Unit::LoadImages: Colorizing images"); ColorizeSurface(temp, cr, cg, cb); ColorizeSurface(dispimg, cr, cg, cb); } ! Log::Writen("Unit::LoadImages: Freeing images and reloading: "); for (i=start; i<=end; i++) { ! Log::Writen("%d, ",i); if (image[i]) { --- 1134,1149 ---- dispimg=0; } ! Log::WriteVerbose("Unit::LoadImages: Setting display image"); dispimg=rotozoomSurface(temp, 0, 0.5, SMOOTH); if (cr>0 || cg>0 || cb>0) { ! Log::WriteVerbose("Unit::LoadImages: Colorizing images"); ColorizeSurface(temp, cr, cg, cb); ColorizeSurface(dispimg, cr, cg, cb); } ! Log::WriteVerbosen("Unit::LoadImages: Freeing images and reloading: "); for (i=start; i<=end; i++) { ! Log::WriteVerbosen("%d, ",i); if (image[i]) { *************** *** 1153,1160 **** image[i]=rotozoomSurface(temp, 360-i*angleinc, zoom, SMOOTH); } ! Log::Writen("\n"); if (hasShield) { ! Log::Write("Loading shield"); SDL_FreeSurface(temp); temp=0; --- 1153,1160 ---- image[i]=rotozoomSurface(temp, 360-i*angleinc, zoom, SMOOTH); } ! Log::WriteVerbosen("\n"); if (hasShield) { ! Log::WriteVerbose("Loading shield"); SDL_FreeSurface(temp); temp=0; Index: main.cpp =================================================================== RCS file: /cvsroot/fftrader/fftrader/src/main.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** main.cpp 23 Aug 2005 03:40:09 -0000 1.4 --- main.cpp 23 Aug 2005 09:56:44 -0000 1.5 *************** *** 103,106 **** --- 103,110 ---- Log::Init("fft.log"); } + if (!strcmp(argv[i],"-verbose")) + { + Log::EnableVerbose(); + } } } *************** *** 115,129 **** if (!init) { ! Log::Write("Failed to initialize PHYSFS. Reason: %s",PHYSFS_getLastError()); exit(1); } ! Log::Write("PHYSFS initialized successfully"); char **i; for (i = PHYSFS_getSearchPath(); *i != NULL; i++) ! Log::Write("[%s] is in the search path.at the beginning of execution", *i); PHYSFS_addToSearchPath(PHYSFS_getBaseDir(), 0); //fpk dir PHYSFS_setWriteDir(PHYSFS_getBaseDir()); ! Log::Write("Loading Preferences"); prefs=new Preferences("prefs"); delete fftinput; --- 119,133 ---- if (!init) { ! Log::WriteVerbose("Failed to initialize PHYSFS. Reason: %s",PHYSFS_getLastError()); exit(1); } ! Log::WriteVerbose("PHYSFS initialized successfully"); char **i; for (i = PHYSFS_getSearchPath(); *i != NULL; i++) ! Log::WriteVerbose("[%s] is in the search path.at the beginning of execution", *i); PHYSFS_addToSearchPath(PHYSFS_getBaseDir(), 0); //fpk dir PHYSFS_setWriteDir(PHYSFS_getBaseDir()); ! Log::WriteVerbose("Loading Preferences"); prefs=new Preferences("prefs"); delete fftinput; *************** *** 135,147 **** if(TTF_Init()==-1) { ! Log::Write("TTF_Init: %s", TTF_GetError()); exit(2); } ! Log::Write("SDL_ttf initialized successfully"); // load font font=LoadTTF("fonts/arial.ttf", 10); if(!font) { ! Log::Write("Unable to Open font 'fonts/arial.ttf' - TTF_OpenFont: %s", TTF_GetError()); // handle error } --- 139,151 ---- if(TTF_Init()==-1) { ! Log::WriteVerbose("TTF_Init: %s", TTF_GetError()); exit(2); } ! Log::WriteVerbose("SDL_ttf initialized successfully"); // load font font=LoadTTF("fonts/arial.ttf", 10); if(!font) { ! Log::WriteVerbose("Unable to Open font 'fonts/arial.ttf' - TTF_OpenFont: %s", TTF_GetError()); // handle error } *************** *** 149,172 **** font2=LoadTTF("fonts/arial.ttf", 14); if(!font2) { ! Log::Write("Unable to Open font 'fonts/arial.ttf' - TTF_OpenFont: %s", TTF_GetError()); // handle error } engine->AddFont("font14",font2); ! Log::Write("Main Fonts loaded"); /* initialize SDL */ #ifdef DEBUG if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_NOPARACHUTE) < 0 ) { ! Log::Write("Could not initialize SDL: %s",SDL_GetError()); return -1; } #else if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO) < 0 ) { ! Log::Write("Could not initialize SDL: %s",SDL_GetError()); return -1; } #endif ! Log::Write("SDL initialized successfully"); //atexit(SDL_Quit); --- 153,176 ---- font2=LoadTTF("fonts/arial.ttf", 14); if(!font2) { ! Log::WriteVerbose("Unable to Open font 'fonts/arial.ttf' - TTF_OpenFont: %s", TTF_GetError()); // handle error } engine->AddFont("font14",font2); ! Log::WriteVerbose("Main Fonts loaded"); /* initialize SDL */ #ifdef DEBUG if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_NOPARACHUTE) < 0 ) { ! Log::WriteVerbose("Could not initialize SDL: %s",SDL_GetError()); return -1; } #else if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO) < 0 ) { ! Log::WriteVerbose("Could not initialize SDL: %s",SDL_GetError()); return -1; } #endif ! Log::WriteVerbose("SDL initialized successfully"); //atexit(SDL_Quit); *************** *** 177,186 **** engine->AddSurface("main icon",icon); SDL_WM_SetIcon(icon, NULL); ! Log::Write("Icon and caption in place"); /* create window */ screen = SDL_SetVideoMode(400, 300, 0, SDL_HWSURFACE|SDL_DOUBLEBUF); //CenterWindow(); ! Log::Write("Video mode set and centered"); SDL_Surface *bg = LoadIMG("gfx/startupbg.png"); --- 181,190 ---- engine->AddSurface("main icon",icon); SDL_WM_SetIcon(icon, NULL); ! Log::WriteVerbose("Icon and caption in place"); /* create window */ screen = SDL_SetVideoMode(400, 300, 0, SDL_HWSURFACE|SDL_DOUBLEBUF); //CenterWindow(); ! Log::WriteVerbose("Video mode set and centered"); SDL_Surface *bg = LoadIMG("gfx/startupbg.png"); *************** *** 188,192 **** DrawIMG(bg,0,0); SDL_Flip(screen); ! Log::Write("Splash screen displayed"); stars = new StarField; --- 192,196 ---- DrawIMG(bg,0,0); SDL_Flip(screen); ! Log::WriteVerbose("Splash screen displayed"); stars = new StarField; *************** *** 194,200 **** stars->Init(SCREEN_WIDTH, SCREEN_HEIGHT); stars2->Init(SCREEN_WIDTH, SCREEN_HEIGHT); ! engine->AddStarfield(stars, false); ! engine->AddStarfield(stars2, true); ! Log::Write("Beginning warp stars initialized"); char **k; --- 198,204 ---- stars->Init(SCREEN_WIDTH, SCREEN_HEIGHT); stars2->Init(SCREEN_WIDTH, SCREEN_HEIGHT); ! engine->AddStarfield(stars, false, 10); ! engine->AddStarfield(stars2, true, 20); ! Log::WriteVerbose("Beginning warp stars initialized"); char **k; *************** *** 211,229 **** } PHYSFS_freeList(fpklist); ! Log::Write("All FPKs placed in search path"); ship = new Unit; ! ship->Init(0, 0, "gfx/ship/ship.png","base.fpk",(float)0.1); engine->SetMainShip(ship); ! Log::Write("Main ship initialized"); map = new Map; map->Init(1); engine->SetMap(map); ! Log::Write("Map initialized"); if(Mix_OpenAudio(22050, AUDIO_S16SYS, 2, 2048) < 0) { ! Log::Write("Warning: Couldn't set 22050 Hz 16-bit audio\n- Reason: %s", SDL_GetError()); } shot = LoadSound("sound/shoot.wav"); --- 215,233 ---- } PHYSFS_freeList(fpklist); ! Log::WriteVerbose("All FPKs placed in search path"); ship = new Unit; ! ship->Init(0, 0, "gfx/ship/ship.png","base.fpk",(float)0.01); engine->SetMainShip(ship); ! Log::WriteVerbose("Main ship initialized"); map = new Map; map->Init(1); engine->SetMap(map); ! Log::WriteVerbose("Map initialized"); if(Mix_OpenAudio(22050, AUDIO_S16SYS, 2, 2048) < 0) { ! Log::WriteVerbose("Warning: Couldn't set 22050 Hz 16-bit audio\n- Reason: %s", SDL_GetError()); } shot = LoadSound("sound/shoot.wav"); *************** *** 231,235 **** engine->AddSound("shot", shot); engine->AddSound("explode", explode); ! Log::Write("Audio initialized and sounds loaded"); gui2=new GUI; --- 235,239 ---- engine->AddSound("shot", shot); engine->AddSound("explode", explode); ! Log::WriteVerbose("Audio initialized and sounds loaded"); gui2=new GUI; *************** *** 259,294 **** else screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 0, SDL_HWSURFACE|SDL_DOUBLEBUF); CenterWindow(); ! Log::Writen("Main window set to 640x480 "); ! if (fullscreen) Log::Writen("at fullscreen "); ! else Log::Writen("at windowed "); ! if (software) Log::Writen("software mode"); ! else Log::Writen("hardware mode"); ! Log::Write(" and centered"); int done=0; int maintemp=0; int GUIresult; ! Log::Write("Proceeding to main loop"); while(!done) { GUIresult=RunStartingGUI(SCREEN_WIDTH, SCREEN_HEIGHT); ! Log::Write("Option from Starting GUI selected"); if (GUIresult==-1) { done=1; ! Log::Write("Exiting game"); } if (GUIresult==2) { bool goahead=false; ! Log::Write("Entering New Game"); goahead=LoadScenario(); if (goahead) { ! Log::Write("Proceeding to main game play"); ! engine->StartGame(); engine->CleanUpGame(); ! //maintemp=mainLoop(); ! Log::Write("Main gameplay exited"); if (maintemp==-1) done=1; } --- 263,298 ---- else screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 0, SDL_HWSURFACE|SDL_DOUBLEBUF); CenterWindow(); ! Log::WriteVerbosen("Main window set to 640x480 "); ! if (fullscreen) Log::WriteVerbosen("at fullscreen "); ! else Log::WriteVerbosen("at windowed "); ! if (software) Log::WriteVerbosen("software mode"); ! else Log::WriteVerbosen("hardware mode"); ! Log::WriteVerbose(" and centered"); int done=0; int maintemp=0; int GUIresult; ! Log::WriteVerbose("Proceeding to main loop"); while(!done) { GUIresult=RunStartingGUI(SCREEN_WIDTH, SCREEN_HEIGHT); ! Log::WriteVerbose("Option from Starting GUI selected"); if (GUIresult==-1) { done=1; ! Log::WriteVerbose("Exiting game"); } if (GUIresult==2) { bool goahead=false; ! Log::WriteVerbose("Entering New Game"); goahead=LoadScenario(); if (goahead) { ! Log::WriteVerbose("Proceeding to main game play"); ! bool init=engine->StartGame(); ! if (init) maintemp=mainLoop(); engine->CleanUpGame(); ! Log::WriteVerbose("Main gameplay exited"); if (maintemp==-1) done=1; } *************** *** 304,308 **** static int AskToQuitGame() { ! Log::Write("AskToQuitGame()"); SDL_Event event; SDL_Surface *screen=SDL_GetVideoSurface(); --- 308,312 ---- static int AskToQuitGame() { ! Log::WriteVerbose("AskToQuitGame()"); SDL_Event event; SDL_Surface *screen=SDL_GetVideoSurface(); *************** *** 399,403 **** static int InGameMenu() { ! Log::Write("InGameMenu()"); SDL_Event event; SDL_Surface *screen=SDL_GetVideoSurface(); --- 403,407 ---- static int InGameMenu() { ! Log::WriteVerbose("InGameMenu()"); SDL_Event event; SDL_Surface *screen=SDL_GetVideoSurface(); *************** *** 499,510 **** { //bool goahead=false; ! Log::Write("LoadScenario()"); ! Log::Write("Entering Scenario selection"); std::string scenselect=ChooseScenario(); if (!strcmp(scenselect.c_str(),"")) return false; ! Log::Write("Scenario Selection is %s",scenselect.c_str()); delete mainScen; mainScen = new Scenario(); ! Log::Write("Reading Scenario information"); engine->SetMainModule(scenselect); done=1; --- 503,514 ---- { //bool goahead=false; ! Log::WriteVerbose("LoadScenario()"); ! Log::WriteVerbose("Entering Scenario selection"); std::string scenselect=ChooseScenario(); if (!strcmp(scenselect.c_str(),"")) return false; ! Log::WriteVerbose("Scenario Selection is %s",scenselect.c_str()); delete mainScen; mainScen = new Scenario(); ! Log::WriteVerbose("Reading Scenario information"); engine->SetMainModule(scenselect); done=1; *************** *** 518,522 **** static bool ShipSelect(float zoom, std::string scenselect) { ! Log::Write("Entering ship selection"); SDL_Surface *screen=SDL_GetVideoSurface(); ship->SetZoom(zoom); --- 522,526 ---- static bool ShipSelect(float zoom, std::string scenselect) { ! Log::WriteVerbose("Entering ship selection"); SDL_Surface *screen=SDL_GetVideoSurface(); ship->SetZoom(zoom); *************** *** 529,533 **** if (quit==1) return false; Uint32 ticks=SDL_GetTicks(); ! Log::Write("Loading Game..."); SDL_FillRect(screen,0,0); centerString(font2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, "Loading Game....", white); --- 533,537 ---- if (quit==1) return false; Uint32 ticks=SDL_GetTicks(); ! Log::WriteVerbose("Loading Game..."); SDL_FillRect(screen,0,0); centerString(font2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2, "Loading Game....", white); *************** *** 537,567 **** map->Init(zoom); engine->SetMap(map); ! Log::Write("Setting map to scenario"); mainScen->SetMap(map); ! Log::Write("Loading map file"); LoadMap(map, mainScen->GetMapFn(), zoom); delete gui2; ! Log::Write("Creating opening message"); std::string message=mainScen->GetOpenMessage(); gui2=MakeCenterOKWindow(message); ! Log::Write("Placing ship"); ship->SetAngle(mainScen->GetStartAngle()); ! Log::Writen("Ship: Angle: %d",mainScen->GetStartAngle()); ship->SetSpeed(mainScen->GetStartSpeed()); ! Log::Writen(" Speed: %d",mainScen->GetStartSpeed()); ship->SetWarp(false); ship->SetX(mainScen->GetStartX()); ! Log::Writen(" X: %d",mainScen->GetStartX()); ship->SetY(mainScen->GetStartY()); ! Log::Writen(" Y: %d",mainScen->GetStartY()); ! Log::Write(" Remaining credits: %d",ship->GetCredits()); //ship->SetZoom(zoom); ! //Log::Write("Loading images"); //ship->ReloadImages(); ! Log::Write("Adjusting shoot point"); ship->AdjustShootPoint(); ! Log::Write("Adding main ship to map"); map->AddMainShip(ship); ! Log::Write("Starting up Scenario"); mainScen->Startup(); Uint32 timepassed=SDL_GetTicks()-ticks; --- 541,571 ---- map->Init(zoom); engine->SetMap(map); ! Log::WriteVerbose("Setting map to scenario"); mainScen->SetMap(map); ! Log::WriteVerbose("Loading map file"); LoadMap(map, mainScen->GetMapFn(), zoom); delete gui2; ! Log::WriteVerbose("Creating opening message"); std::string message=mainScen->GetOpenMessage(); gui2=MakeCenterOKWindow(message); ! Log::WriteVerbose("Placing ship"); ship->SetAngle(mainScen->GetStartAngle()); ! Log::WriteVerbosen("Ship: Angle: %d",mainScen->GetStartAngle()); ship->SetSpeed(mainScen->GetStartSpeed()); ! Log::WriteVerbosen(" Speed: %d",mainScen->GetStartSpeed()); ship->SetWarp(false); ship->SetX(mainScen->GetStartX()); ! Log::WriteVerbosen(" X: %d",mainScen->GetStartX()); ship->SetY(mainScen->GetStartY()); ! Log::WriteVerbosen(" Y: %d",mainScen->GetStartY()); ! Log::WriteVerbose(" Remaining credits: %d",ship->GetCredits()); //ship->SetZoom(zoom); ! //Log::WriteVerbose("Loading images"); //ship->ReloadImages(); ! Log::WriteVerbose("Adjusting shoot point"); ship->AdjustShootPoint(); ! Log::WriteVerbose("Adding main ship to map"); map->AddMainShip(ship); ! Log::WriteVerbose("Starting up Scenario"); mainScen->Startup(); Uint32 timepassed=SDL_GetTicks()-ticks; *************** *** 569,573 **** Uint32 secs=(unsigned int)((double)timepassed/1000.0); Uint32 mins=(unsigned int)((double)secs/60.0); ! Log::Write("Scenario loaded in %d minutes, %d seconds, and %d milliseconds",mins,secs,ms); return true; } --- 573,577 ---- Uint32 secs=(unsigned int)((double)timepassed/1000.0); Uint32 mins=(unsigned int)((double)secs/60.0); ! Log::WriteVerbose("Scenario loaded in %d minutes, %d seconds, and %d milliseconds",mins,secs,ms); return true; } *************** *** 575,579 **** static int mainLoop() { ! Log::Write("Main Loop begin"); SDL_Event event; SDL_Surface *screen=SDL_GetVideoSurface(); --- 579,583 ---- static int mainLoop() { ! Log::WriteVerbose("Main Loop begin"); SDL_Event event; SDL_Surface *screen=SDL_GetVideoSurface(); *************** *** 602,606 **** fpscount=0; int aiunit=-1; ! int aiunits=map->GetAICount(); fps=0; range=3; --- 606,610 ---- fpscount=0; int aiunit=-1; ! int aiunits=map->GetUnitCount(); fps=0; range=3; *************** *** 622,626 **** map->CheckSectors(sx, sy); float zoom=0.5; ! Log::Write("Variables set, displaying opening message"); TTF_Font *font9=TTF_OpenFont("fonts/arial.ttf", 9); engine->AddFont("font9",font9); --- 626,630 ---- map->CheckSectors(sx, sy); float zoom=0.5; ! Log::WriteVerbose("Variables set, displaying opening message"); TTF_Font *font9=TTF_OpenFont("fonts/arial.ttf", 9); engine->AddFont("font9",font9); *************** *** 702,706 **** char disppause[100]; sprintf(disppause, "Press '%s' to unpause", fftinput->GetPauseStr().c_str()); ! Log::Write("Entering gameplay loop"); while(!done) { --- 706,710 ---- char disppause[100]; sprintf(disppause, "Press '%s' to unpause", fftinput->GetPauseStr().c_str()); ! Log::WriteVerbose("Entering gameplay loop"); while(!done) { *************** *** 715,719 **** { paused=true; ! Log::Write("Game was paused because the window lost focus"); if (paused) { --- 719,723 ---- { paused=true; ! Log::WriteVerbose("Game was paused because the window lost focus"); if (paused) { *************** *** 765,773 **** { zoom+=0.25; ! Log::Write("Zooming ship"); ship->SetZoom(zoom); ! Log::Write("Loading Ship images"); ship->ReloadImages(); ! Log::Write("Zooming map"); map->SetZoom(zoom); } --- 769,777 ---- { zoom+=0.25; ! Log::WriteVerbose("Zooming ship"); ship->SetZoom(zoom); ! Log::WriteVerbose("Loading Ship images"); ship->ReloadImages(); ! Log::WriteVerbose("Zooming map"); map->SetZoom(zoom); } *************** *** 778,786 **** { zoom-=0.25; ! Log::Write("Zooming ship"); ship->SetZoom(zoom); ! Log::Write("Loading Ship images"); ship->ReloadImages(); ! Log::Write("Zooming map"); map->SetZoom(zoom); } --- 782,790 ---- { zoom-=0.25; ! Log::WriteVerbose("Zooming ship"); ship->SetZoom(zoom); ! Log::WriteVerbose("Loading Ship images"); ship->ReloadImages(); ! Log::WriteVerbose("Zooming map"); map->SetZoom(zoom); } *************** *** 858,862 **** sy=ship->GetSectorY(); curslot=ship->GetCurWeaponSlot(); ! aiunits=map->GetAICount(); if (curslot.image) { --- 862,866 ---- sy=ship->GetSectorY(); curslot=ship->GetCurWeaponSlot(); ! aiunits=map->GetUnitCount(); if (curslot.image) { *************** *** 865,870 **** if (aiunit<aiunits && aiunit!=-1) { ! targetx=map->GetAIUnitX(aiunit); ! targety=map->GetAIUnitY(aiunit); } else --- 869,874 ---- if (aiunit<aiunits && aiunit!=-1) { ! targetx=map->GetUnitX(aiunit); ! targety=map->GetUnitY(aiunit); } else Index: guiapply.h =================================================================== RCS file: /cvsroot/fftrader/fftrader/src/guiapply.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** guiapply.h 19 Aug 2005 22:39:52 -0000 1.2 --- guiapply.h 23 Aug 2005 09:56:44 -0000 1.3 *************** *** 17,20 **** --- 17,21 ---- int ChangeControl(int w, int h, SDL_Surface *bg=0, bool fill=true); int AskToQuit(int SCREEN_WIDTH, int SCREEN_HEIGHT); + int MsgBox(int SCREEN_WIDTH, int SCREEN_HEIGHT, std::string message); int YesNoBox(int SCREEN_WIDTH, int SCREEN_HEIGHT, std::string message); int ExitToMenuBox(int SCREEN_WIDTH, int SCREEN_HEIGHT, std::string message); Index: shop.cpp =================================================================== RCS file: /cvsroot/fftrader/fftrader/src/shop.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** shop.cpp 23 Aug 2005 03:40:09 -0000 1.3 --- shop.cpp 23 Aug 2005 09:56:44 -0000 1.4 *************** *** 20,24 **** ShipyardShop::ShipyardShop(int sx, int sy, int sw, int sh, FPKShip **fpkships, bool sstarting) { ! Log::Write("New ShipyardShop"); int i; x=sx; --- 20,24 ---- ShipyardShop::ShipyardShop(int sx, int sy, int sw, int sh, FPKShip **fpkships, bool sstarting) { ! Log::WriteVerbose("New ShipyardShop"); int i; x=sx; *************** *** 66,70 **** } } ! Log::Write("Max FPKShips=%d",shipmax); cur=0; curcolor=0; --- 66,70 ---- } } ! Log::WriteVerbose("Max FPKShips=%d",shipmax); cur=0; curcolor=0; *************** *** 154,188 **** if ((int)ship->GetCredits()>=(ships[cur]->GetPrice()-(ship->GetPriceBought()*0.75))) { ! Log::Write("Giving New Ship"); ! Log::Write("Colorizing ship"); ship->Colorize(cr[curcolor], cg[curcolor], cb[curcolor]); ! Log::Write("Getting New ship images"); ship->FPK_NewImages(ships[cur]->GetFPK(), ships[cur]->GetImageFN()); ! Log::Write("Setting max speed"); ship->SetMaxSpeed(engine->GetMaxSpeed()); ! Log::Write("Setting max warp speed"); ship->SetMaxWarp(engine->GetMaxWarpSpeed()); ! Log::Write("Setting max safe warp speed"); ship->SetMaxSafeWarp(engine->GetMaxSafeWarpSpeed()); ! Log::Write("Setting turn delay"); ship->SetTurnDelay(engine->GetTurnDelay()); ! Log::Write("Setting warp turn delay"); ship->SetWarpTurnDelay(engine->GetWarpTurnDelay()); ! Log::Write("Filling slots"); ship->FillSlots(ships[cur]->GetSlots(),ships[cur]->GetSlotCount()); ! Log::Write("Setting shoot point"); ship->SetShootPoint(ships[cur]->GetShootX(),ships[cur]->GetShootY()); ! Log::Write("Setting overheat"); ship->SetOverHeatMax(engine->GetOverHeatMax()); ! Log::Write("Adding weapons"); ship->AddWeaponToSlot(101,"base.fpk","gfx/object/bullet.png"); //ship->AddWeaponToSlot(102,"base.fpk","gfx/object/bullet2.png"); ! if (ships[cur]->HasShield()) Log::Write("Adding shield"); if (ships[cur]->HasShield()) ship->AddShield(ships[cur]->GetShieldFN()); ! Log::Write("Setting battle hits"); ship->SetHullHitMax(ships[cur]->GetHullHitMax()); ship->SetShieldHitMax(10); ship->ResetHits(); ! Log::Write("Ship loaded"); ship->SetCredits((int)(ship->GetCredits()-(ships[cur]->GetPrice()-(ship->GetPriceBought()*0.75)))); ship->SetPriceBought(ships[cur]->GetPrice()); --- 154,188 ---- if ((int)ship->GetCredits()>=(ships[cur]->GetPrice()-(ship->GetPriceBought()*0.75))) { ! Log::WriteVerbose("Giving New Ship"); ! Log::WriteVerbose("Colorizing ship"); ship->Colorize(cr[curcolor], cg[curcolor], cb[curcolor]); ! Log::WriteVerbose("Getting New ship images"); ship->FPK_NewImages(ships[cur]->GetFPK(), ships[cur]->GetImageFN()); ! Log::WriteVerbose("Setting max speed"); ship->SetMaxSpeed(engine->GetMaxSpeed()); ! Log::WriteVerbose("Setting max warp speed"); ship->SetMaxWarp(engine->GetMaxWarpSpeed()); ! Log::WriteVerbose("Setting max safe warp speed"); ship->SetMaxSafeWarp(engine->GetMaxSafeWarpSpeed()); ! Log::WriteVerbose("Setting turn delay"); ship->SetTurnDelay(engine->GetTurnDelay()); ! Log::WriteVerbose("Setting warp turn delay"); ship->SetWarpTurnDelay(engine->GetWarpTurnDelay()); ! Log::WriteVerbose("Filling slots"); ship->FillSlots(ships[cur]->GetSlots(),ships[cur]->GetSlotCount()); ! Log::WriteVerbose("Setting shoot point"); ship->SetShootPoint(ships[cur]->GetShootX(),ships[cur]->GetShootY()); ! Log::WriteVerbose("Setting overheat"); ship->SetOverHeatMax(engine->GetOverHeatMax()); ! Log::WriteVerbose("Adding weapons"); ship->AddWeaponToSlot(101,"base.fpk","gfx/object/bullet.png"); //ship->AddWeaponToSlot(102,"base.fpk","gfx/object/bullet2.png"); ! if (ships[cur]->HasShield()) Log::WriteVerbose("Adding shield"); if (ships[cur]->HasShield()) ship->AddShield(ships[cur]->GetShieldFN()); ! Log::WriteVerbose("Setting battle hits"); ship->SetHullHitMax(ships[cur]->GetHullHitMax()); ship->SetShieldHitMax(10); ship->ResetHits(); ! Log::WriteVerbose("Ship loaded"); ship->SetCredits((int)(ship->GetCredits()-(ships[cur]->GetPrice()-(ship->GetPriceBought()*0.75)))); ship->SetPriceBought(ships[cur]->GetPrice()); *************** *** 325,332 **** cury+=80; } ! Log::Write("column=%d, cury=%d",column,cury); curx=x+(column*100)+80; slotshow->MakeWindow(curx, cury, 80, 66); ! Log::Write("Window %d, %d, %d, %d",curx, cury, 80, 66); sprintf(c, "ID: %d", slots[i].id); std::string slotid=c; --- 325,332 ---- cury+=80; } ! Log::WriteVerbose("column=%d, cury=%d",column,cury); curx=x+(column*100)+80; slotshow->MakeWindow(curx, cury, 80, 66); ! Log::WriteVerbose("Window %d, %d, %d, %d",curx, cury, 80, 66); sprintf(c, "ID: %d", slots[i].id); std::string slotid=c; *************** *** 354,358 **** int NewShipOptions(int w, int h, FPKShip **fpkships) { ! Log::Write("Inside Ship options"); SDL_Event event; ShipyardShop *shipyard=new ShipyardShop(0,0,w,h,fpkships,true); --- 354,358 ---- int NewShipOptions(int w, int h, FPKShip **fpkships) { ! Log::WriteVerbose("Inside Ship options"); SDL_Event event; ShipyardShop *shipyard=new ShipyardShop(0,0,w,h,fpkships,true); *************** *** 373,377 **** } delete shipyard; ! Log::Write("End Ship options"); return done; } --- 373,377 ---- } delete shipyard; ! Log::WriteVerbose("End Ship options"); return done; } Index: graphics.cpp =================================================================== RCS file: /cvsroot/fftrader/fftrader/src/graphics.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** graphics.cpp 19 Aug 2005 07:32:29 -0000 1.1 --- graphics.cpp 23 Aug 2005 09:56:44 -0000 1.2 *************** *** 383,386 **** --- 383,401 ---- } } + StaticAnim::StaticAnim(const StaticAnim &oldanim) + { + animbase=oldanim.animbase; + int i; ... [truncated message content] |