static int ModeRender() { DirectScreen(); if (LoopMode==3) MenuRender(); if (LoopMode==4) LightCalRender(); return 0; }
void menu() { MenuInit(); //MusicInit("./textures/musicOn.jpg"); g_Input.gameOff(); MenuRender(); MusicRender(); while(!g_Input.getGame()) { int64 start = s3eTimerGetMs(); while ((s3eTimerGetMs() - start) < MS_PER_FRAME) { int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start)); if (yield<0) break; s3eDeviceYield(yield); } if (g_Input.getTouchCount() != 0) { int x = g_Input.getTouch(0)->x; int y = g_Input.getTouch(0)->y; if (x <= 750 && x >= 500 && y <= 400 && y >= 200) { if (g_Input.getSound()) { MusicShutDown(); MusicInit("./textures/musicOf.jpg"); MusicRender(); g_Input.soundOff(); } else { MusicShutDown(); MusicInit("./textures/musicOn.jpg"); MusicRender(); g_Input.soundOn(); } } if (x <= 1270 && x >= 500 && y <= 190 && y >= 10) g_Input.gameOn(); } } //MusicShutDown(); //MenuShutDown(); IwGxSetColClear(0xff, 0xff, 0xff, 0xff); IwGxPrintSetColour(128, 128, 128); g_Input.initTimer(); g_Input.setTotalTime(); g_Input.setPosInitY(g_Input.getAccelerometerY()); SplashInit(); SplashUpdate("loading"); SplashRender(); MenuShutDown(); if (initMenu) { //Creating objects corazon = new corazones("corazones", 64, 64, -100, 1,2,false); for (int i=0; i<10; i++) { garras[i] = new claws("claws", 128, 128, -150,1,2,false); } maxiCoin = new Coin("./textures/monedas200pts.png", 128, 128, -150,1,2,false); for (int j=0; j<20; j++) { miniCoins[j] = new MiniCoin("coins", 64, 64, -100,1,2,true); } for (int i=0; i<10; i++) { tnts[i] = new Tnt("tnts", 128, 128, -150,1,2,false); } tank = new Tank(); tank->Init("./textures/tank.png", 256, 256, -300,1,2,false); chuletas = new Chuletas(); chuletas->Init("./textures/chuletas.png", 512, 512, -600,1,2,false); } SplashShutDown(); //SplashInit(); //SplashUpdate("go"); ciclo(); }