This commit is contained in:
Paul 2000-10-19 15:40:24 +00:00
parent fd06495937
commit 5803cd54f1
7 changed files with 14 additions and 11 deletions

View file

@ -93,9 +93,9 @@ char *Str="Sponge\nBob\nSquare\nPants";
} }
/*****************************************************************************/ /*****************************************************************************/
void CGameScene::think() void CGameScene::think(int _frames)
{ {
for(int i=0;i<GameState::getFramesSinceLast();i++) for(int i=0;i<_frames;i++)
{ {
X+=Dx; Y+=Dy; X+=Dx; Y+=Dy;
if (X<0+64) {X=0+64; Dx=-Dx;} if (X<0+64) {X=0+64; Dx=-Dx;}

View file

@ -21,7 +21,7 @@ public:
void init(); void init();
void shutdown(); void shutdown();
void render(); void render();
void think(); void think(int _frames);
char *getSceneName() {return "Game";} char *getSceneName() {return "Game";}

View file

@ -159,7 +159,7 @@ int svol=255;
VECTOR ppos; VECTOR ppos;
int psp=0; int psp=0;
void CPaulScene::think() void CPaulScene::think(int _frames)
{ {
int pad; int pad;
int sfxId=-1; int sfxId=-1;

View file

@ -39,7 +39,7 @@ public:
void init(); void init();
void shutdown(); void shutdown();
void render(); void render();
void think(); void think(int _frames);
char *getSceneName() {return"PaulsScene";} char *getSceneName() {return"PaulsScene";}
}; };

View file

@ -62,7 +62,7 @@ void GameState::think()
} }
} }
ASSERT(s_currentScene); ASSERT(s_currentScene);
s_currentScene->think(); s_currentScene->think(getFramesSinceLast());
} }

View file

@ -30,7 +30,7 @@ public:
virtual void init()=0; virtual void init()=0;
virtual void shutdown()=0; virtual void shutdown()=0;
virtual void render()=0; virtual void render()=0;
virtual void think()=0; virtual void think(int _frames)=0;
virtual char *getSceneName()=0; virtual char *getSceneName()=0;
protected: protected:

View file

@ -89,13 +89,17 @@ void MainLoop()
{ {
while (1) while (1)
{ {
int frames;
frames=GameState::getFramesSinceLast();
GameState::think(); GameState::think();
GameState::render(); GameState::render();
CSoundMediator::think(GameState::getTimeSinceLast()); CSoundMediator::think(frames);
#ifdef __USER_paul__ #ifdef __USER_paul__
s_paulScene.think(); s_paulScene.think(frames);
s_paulScene.render(); s_paulScene.render();
#endif #endif
@ -120,8 +124,7 @@ void MainLoop()
if (PadGetDown(0) & PAD_START) SaveScreen(VidGetScreen()->Draw.clip); if (PadGetDown(0) & PAD_START) SaveScreen(VidGetScreen()->Draw.clip);
#endif #endif
// PKG - Moved vram viewer to SELECT on pad 2 for art dev machines if (PadGetDown(0) & PAD_SELECT) VRamViewer();
if (PadGetDown(0) & PAD_SELECT) VRamViewer();
#endif #endif
} }
} }