Main game loop (will be a noob error i'm afraid...)

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Ghoti
Posts: 288
Joined: Sat Dec 31, 2005 11:06 pm

Main game loop (will be a noob error i'm afraid...)

Post by Ghoti »

Hi folks,

my main gameloop does not what i expect it to do:

Code: Select all

	void GameLoop() {


		
		while(1) {
			if (GameMainMenu() == 9) {break;}
			else { 
				//result = GameMain();

				if (GameMain() == 1) { 
					if (bClearThemes == FALSE) {
						UnloadGameGraphics();
						bClearThemes = TRUE;
					}	
					GameOver(); 
				}					// runs the game 
				else {
					sceGuTerm();
					sceKernelExitGame();
				}
			} 
		}
		return;
	}
the first time we enter the loop all is well. When i return from the mainmenu the game starts. When i'm gameover or exit the game i go to the gameover screen. when i leave the gameover screen i go to the mainmenu again. This mainmenu renders correctly and all menuitems work without error. except for the exit game button whichs should exit to the xmb but now goes to the gameoverscreen. The new game also goes directly to the gameover screen. At the very first line of code in the newgame i let the psp pause until i press the X button. This works the first time i run the new game however when return to the mainmenu after that it just goes directly to the gameover screen without going to the gamemain function :S

any idea what is causing this? any ideas and suggestions are appreciated even if someone is not sure.

greets ghoti
Ghoti
Posts: 288
Joined: Sat Dec 31, 2005 11:06 pm

Post by Ghoti »

i have solved it, it was an memory error :S
Post Reply