Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***************************************************************************
- * Copyright (C) 2008 by Geecko *
- * *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
- #include <pspctrl.h>
- #include <pspkernel.h>
- #include <pspdebug.h>
- #include <pspdisplay.h>
- #include <pspgu.h>
- #include <stdio.h>
- #include <string.h>
- #include "./librairies/graphics.h"
- #include "./librairies/intraFont.h"
- #include "./librairies/util.h"
- PSP_MODULE_INFO("BreakOut4PSP-stable", 0, 1, 1);
- #define printf pspDebugScreenPrintf
- enum colors { /** Définition des couleurs **/
- RED = 0xFF0000FF,
- GREEN = 0xFF00FF00,
- BLUE = 0xFFFF0000,
- LITEBLUE = 0xFFFF9628,
- WHITE = 0xFFFFFFFF,
- LITEGRAY = 0xFFBFBFBF,
- GRAY = 0xFF7F7F7F,
- DARKGRAY = 0xFF3F3F3F,
- BLACK = 0xFF000000
- };
- enum directions { /** Définition des directions **/
- N = 1,
- NEL = 2,
- NER = 3,
- NESR = 4,
- SESR = 5,
- SER = 6,
- SEL = 7,
- S = 8,
- SOL = 9,
- SOR = 10,
- SOSR = 11,
- NOSR = 12,
- NOR = 13,
- NOL = 14
- };
- enum edges { /** Définition des bords touchés **/
- LEFT_EDGE = 1,
- TOP_EDGE = 2,
- RIGHT_EDGE = 3,
- BOTTOM_EDGE = 4,
- LEFT_BRICK = 5,
- TOP_BRICK = 6,
- RIGHT_BRICK = 7,
- BOTTOM_BRICK = 8,
- RACKET_EDGE_TOP_E_LEFT = 9,
- RACKET_EDGE_TOP_LEFT = 10,
- RACKET_EDGE_TOP = 11,
- RACKET_EDGE_TOP_RIGHT = 12,
- RACKET_EDGE_TOP_E_RIGHT = 13
- };
- enum movestates { /** Définition du statut de mouvement de niveau **/
- NO_MOVE = 1,
- MOVING_LEFT = 2,
- MOVING_RIGHT = 3,
- RIGHT_MOVE_DONE = 4,
- LEFT_MOVE_DONE = 5
- };
- /** Callbacks **/
- int exit_callback(int arg1, int arg2, void *common) {
- sceKernelExitGame();
- return 0;}
- int CallbackThread(SceSize args, void *argp) {
- int cbid;
- cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
- sceKernelRegisterExitCallback(cbid);
- sceKernelSleepThreadCB();
- return 0;}
- int SetupCallbacks(void) {
- int thid = 0;
- thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
- if(thid >= 0) sceKernelStartThread(thid, 0, 0);
- return thid; }
- /**-------------------------------------------------------------*
- | Main |
- *-------------------------------------------------------------**/
- int main(int argc, char *argv[])
- {
- /** Divers **/
- SetupCallbacks();
- pspDebugScreenInit();
- /** Contrôles **/
- SceCtrlData pad;
- sceCtrlSetSamplingCycle(0);
- sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
- /** Sprites **/
- loadWindowImages();
- Image* sprite_r = loadImage("graphics/sprite_racket.png");
- Image* sprite_ba = loadImage("graphics/sprite_ball.png");
- Image* sprite_f = loadImage("graphics/sprite_fire.png");
- Image* sprite_br1 = loadImage("graphics/sprite_brick1.png");
- Image* sprite_br2 = loadImage("graphics/sprite_brick2.png");
- Image* sprite_br3 = loadImage("graphics/sprite_brick3.png");
- Image* background = loadImage("graphics/background.png");
- if ((!sprite_r || !sprite_ba) || (!sprite_f || !sprite_br1) || (!sprite_br2 || !sprite_br3)) printf ("Erreur lors du chargement des sprites !\n\nV\202rifiez si ils sont bien plac\202s dans le dossier graphics a cot\202 de l'EBOOT.");
- if (!background) printf ("Erreur lors du chargement de l'image de fond !\n\nV\202rifiez si elle est bien plac\202e dans le dossier graphics a cot\202 de l'EBOOT.");
- /** Police de caractères **/
- char ifi = intraFontInit();
- intraFont* ifl[2];
- ifl[0] = intraFontLoad("flash0:/font/ltn8.pgf",INTRAFONT_CACHE_MED);
- ifl[1] = intraFontLoad("flash0:/font/ltn0.pgf",INTRAFONT_CACHE_MED);
- if (!ifi) printf("Erreur lors de l'initialisation d'intraFont !\n");
- else if (!ifl[0] || !ifl[1]) printf("Erreur lors du chargement d'intraFont !\n");
- /** Niveau(x) de jeu **/
- int levelbufferleft[128]= {0}, levelbuffer[128] = {0}, levelbufferright[128] = {0};
- int levelnumberleft=3,levelnumber=1, levelnumberright=2;
- char levelsize_left = loadLevel(levelbufferleft,levelnumberleft);
- char levelsize = loadLevel(levelbuffer,levelnumber);
- char levelsize_right = loadLevel(levelbufferright,levelnumberright);
- if (levelsize_left<0 || levelsize<0 || levelsize_right<0) printf("Erreur lors du chargement du niveau !\n");
- /** Video **/
- initGraphics();
- /** Variables **/
- char
- score[20] = {0}, debug[64] = {0}, death[64] = {0}, combobuf[3] = {0},
- levelmovestate=0, state=0, exit_window=0, combo=0, comboval=0, combobar=0;
- unsigned char
- run=1, initialized=0, move=1, move_dir=N, edge=0, lose=0, pause=0, win=0, error_level=0, oldmove=0, oldButtons=0, touched=0, win_i=0;
- int
- levelposition=0, x_ball=0, y_ball=0, x_racket=0, x_brick=0, y_brick=0, t_brick=0, feu=0, score_var=0, active=0, death_i=0;
- const int
- y_racket=235;
- while (run)
- {
- /** Touches **/
- sceCtrlPeekBufferPositive(&pad, 1);
- if ((!lose && !pause) && (!win && !error_level))
- {
- if(pad.Buttons & PSP_CTRL_LEFT && x_racket > 4) x_racket-=5;
- else if(pad.Buttons & PSP_CTRL_RIGHT && x_racket < 476-95) x_racket+=5;
- if(pad.Buttons & PSP_CTRL_LTRIGGER) levelmovestate=MOVING_RIGHT;
- else if(pad.Buttons & PSP_CTRL_RTRIGGER) levelmovestate=MOVING_LEFT;
- if(pad.Buttons & PSP_CTRL_START && oldButtons != PSP_CTRL_START)
- {
- oldmove = move;
- pause =1;
- move =0;
- }
- if(pad.Buttons & PSP_CTRL_CROSS) initialized = 0;
- if(pad.Buttons & PSP_CTRL_SQUARE) move = 1;
- if(pad.Buttons & PSP_CTRL_TRIANGLE) win = 1;
- }
- else if ((pause && !win) && (!lose && !error_level))
- {
- if(pad.Buttons & PSP_CTRL_START && oldButtons != PSP_CTRL_START)
- {
- pause =0;
- move = oldmove;
- reInitWindow();
- }
- if(pad.Buttons & PSP_CTRL_SQUARE && oldButtons != PSP_CTRL_SQUARE) exit_window=!exit_window;
- }
- else if ((!pause && win) && (!lose && !error_level))
- {
- if(pad.Buttons & PSP_CTRL_CIRCLE) run = 0;
- if(pad.Buttons & PSP_CTRL_CROSS)
- {
- levelnumber++;
- memset(levelbuffer, 0, sizeof(levelbuffer));
- levelsize = loadLevel(levelbuffer,levelnumber);
- if (levelsize<0) error_level=1;
- else
- {
- initialized =0;
- win=0;
- }
- }
- }
- else if ((!pause && !win) && (lose && !error_level))
- {
- if(pad.Buttons & PSP_CTRL_CIRCLE) run = 0;
- if(pad.Buttons & PSP_CTRL_CROSS && oldButtons != PSP_CTRL_CROSS) initialized =0;
- }
- else if ((!pause && win) && (!lose && error_level))
- {
- if(pad.Buttons & PSP_CTRL_CIRCLE) run = 0;
- if(pad.Buttons & PSP_CTRL_SQUARE && oldButtons != PSP_CTRL_SQUARE)
- {
- win=0;
- levelnumber=1;
- levelsize = loadLevel(levelbuffer,levelnumber);
- initialized =0;
- error_level=0;
- }
- }
- oldButtons = pad.Buttons;
- if(!initialized)
- {
- x_racket=480/2-96/2;
- y_ball=y_racket-8;
- move_dir=N;
- move = 0;
- initialized = 1;
- lose = 0;
- win = 0;
- combo=0;
- comboval=1;
- /*while (active != levelsize) Remise à zéro des briques
- {
- active+=3;
- death[death_i] = levelbuffer[active]+1;
- death_i++;
- }
- death_i=0;
- active=0;*/
- memset(death, 0, sizeof(death));
- }
- if (move)
- {
- /** Detection des bords **/
- if (x_ball <= 0)
- {
- edge = LEFT_EDGE;
- }
- else if (x_ball+8 >= 480)
- {
- edge = RIGHT_EDGE;
- }
- if (y_ball <= 0)
- {
- edge = TOP_EDGE;
- }
- else if (y_ball >= 272)
- {
- edge = BOTTOM_EDGE;
- }
- if (y_ball+8 >= y_racket && y_ball+8 <= y_racket+4)
- {
- if (x_ball+8 >= x_racket && x_ball+2 <= x_racket+10)
- {
- edge = RACKET_EDGE_TOP_E_LEFT;
- if (combo!=0) combo++;
- }
- else if (x_ball+8 >= x_racket+11 && x_ball+2 <= x_racket+30)
- {
- edge = RACKET_EDGE_TOP_LEFT;
- if (combo!=0) combo++;
- }
- else if (x_ball+8 >= x_racket+31 && x_ball+2 <= x_racket+68)
- {
- edge = RACKET_EDGE_TOP;
- if (combo!=0) combo++;
- }
- else if (x_ball+8 >= x_racket+69 && x_ball+2 <= x_racket+85)
- {
- edge = RACKET_EDGE_TOP_RIGHT;
- if (combo!=0) combo++;
- }
- else if (x_ball+8 >= x_racket+86 && x_ball <= x_racket+95)
- {
- edge = RACKET_EDGE_TOP_E_RIGHT;
- if (combo!=0) combo++;
- }
- }
- /** Detection des bords des briques **/
- while (active != levelsize)
- {
- x_brick = levelbuffer[active*3];
- y_brick = levelbuffer[active*3+1];
- t_brick = levelbuffer[active*3+2];
- active++;
- if (death[death_i] == 0)
- {
- if ((y_ball+8 >= y_brick && y_ball <= y_brick+20) && (x_ball+8 >= x_brick && x_ball+8 <= x_brick+4))
- {
- edge = LEFT_BRICK;
- death[death_i]++;
- touched=1;
- }
- else if ((y_ball+8 >= y_brick && y_ball <= y_brick+20) && (x_ball <= x_brick+60 && x_ball+4 >= x_brick+60))
- {
- edge = RIGHT_BRICK;
- death[death_i]++;
- touched=1;
- }
- else if ((x_ball+8 >= x_brick && x_ball <= x_brick+60) && (y_ball+8 >= y_brick && y_ball+8 <= y_brick+4))
- {
- edge = TOP_BRICK;
- death[death_i]++;
- touched=1;
- }
- else if ((x_ball+8 >= x_brick && x_ball <= x_brick+60) && (y_ball <= y_brick+20 && y_ball+4 >= y_brick+20))
- {
- edge = BOTTOM_BRICK;
- death[death_i]++;
- touched=1;
- }
- }
- if (!combo) comboval=1;
- if (combo>comboval) { comboval++; combo=1; }
- if (touched)
- {
- if (t_brick==0) score_var += 20*comboval;
- else if (t_brick==1 && death[death_i]==1) score_var += 50*comboval;
- else if (t_brick==2 && death[death_i]==1) score_var += 100*comboval;
- }
- touched=0;
- death_i++;
- }
- active =0;
- death_i =0;
- /** Direction en fonction du bord touché **/
- if (edge == TOP_EDGE || edge == BOTTOM_BRICK)
- {
- if (move_dir == N) move_dir = S;
- else if (move_dir == NEL) move_dir = SEL;
- else if (move_dir == NER) move_dir = SER;
- else if (move_dir == NESR) move_dir = SESR;
- else if (move_dir == NOL) move_dir = SOL;
- else if (move_dir == NOR) move_dir = SOR;
- else if (move_dir == NOSR) move_dir = SOSR;
- }
- else if (edge == BOTTOM_EDGE && !win)
- {
- lose = 1;
- combo = 0;
- }
- else if (edge == LEFT_EDGE || edge == RIGHT_BRICK)
- {
- if (move_dir == N) move_dir = S;
- else if (move_dir == NOL) move_dir = NEL;
- else if (move_dir == NOR) move_dir = NER;
- else if (move_dir == NOSR) move_dir = NESR;
- else if (move_dir == SOL) move_dir = SEL;
- else if (move_dir == SOR) move_dir = SER;
- else if (move_dir == SOSR) move_dir = SESR;
- }
- else if (edge == RIGHT_EDGE || edge == LEFT_BRICK)
- {
- if (move_dir == N) move_dir = S;
- else if (move_dir == NEL) move_dir = NOL;
- else if (move_dir == NER) move_dir = NOR;
- else if (move_dir == NESR) move_dir = NOSR;
- else if (move_dir == SEL) move_dir = SOL;
- else if (move_dir == SER) move_dir = SOR;
- else if (move_dir == SESR) move_dir = SOSR;
- }
- else if (edge == RACKET_EDGE_TOP_E_LEFT)
- {
- if ((move_dir == S || move_dir == SOL) || (move_dir == SOR || move_dir == SOSR)) move_dir = NOSR;
- else if ( move_dir == SEL) move_dir = NOR;
- else if (move_dir == SER) move_dir = NOL;
- else if (move_dir == SESR) move_dir = N;
- }
- else if (edge == RACKET_EDGE_TOP_LEFT)
- {
- if (move_dir == S) move_dir = NOL;
- else if (move_dir == SOL || move_dir == SOR) move_dir = NOR;
- else if (move_dir == SOSR) move_dir = NOSR;
- else if ( move_dir == SEL) move_dir = N;
- else if (move_dir == SER) move_dir = NEL;
- else if (move_dir == SESR) move_dir = NER;
- }
- else if (edge == RACKET_EDGE_TOP || edge == TOP_BRICK)
- {
- if (move_dir == S) move_dir = N;
- else if (move_dir == SOL) move_dir = NOL;
- else if (move_dir == SOR) move_dir = NOR;
- else if (move_dir == SOSR) move_dir = NOSR;
- else if ( move_dir == SEL) move_dir = NEL;
- else if (move_dir == SER) move_dir = NER;
- else if (move_dir == SESR) move_dir = NESR;
- }
- else if (edge == RACKET_EDGE_TOP_RIGHT)
- {
- if (move_dir == S) move_dir = NEL;
- else if (move_dir == SOL) move_dir = N;
- else if (move_dir == SOR) move_dir = NOL;
- else if (move_dir == SOSR) move_dir = NOR;
- else if (move_dir == SEL || move_dir == SER) move_dir = NER;
- else if (move_dir == SESR) move_dir = NESR;
- }
- else if (edge == RACKET_EDGE_TOP_E_RIGHT)
- {
- if ((move_dir == S || move_dir == SEL) || (move_dir == SER || move_dir == SESR)) move_dir = NESR;
- else if (move_dir == SOL) move_dir = NER;
- else if (move_dir == SOR) move_dir = NEL;
- else if (move_dir == SOSR) move_dir = N;
- }
- /** Deplacer la balle **/
- if (move_dir == N) { y_ball-=3; x_ball+=0; }
- else if (move_dir == NEL) { y_ball-=3; x_ball+=3; }
- else if (move_dir == NER) { y_ball-=3; x_ball+=4; }
- else if (move_dir == NESR) { y_ball-=4; x_ball+=6; }
- else if (move_dir == SESR) { y_ball+=4; x_ball+=6; }
- else if (move_dir == SER) { y_ball+=3; x_ball+=4; }
- else if (move_dir == SEL) { y_ball+=3; x_ball+=3; }
- else if (move_dir == S) { y_ball+=3; x_ball+=0; }
- else if (move_dir == SOL) { y_ball+=3; x_ball-=3; }
- else if (move_dir == SOR) { y_ball+=3; x_ball-=4; }
- else if (move_dir == SOSR) { y_ball+=4; x_ball-=6; }
- else if (move_dir == NOSR) { y_ball-=4; x_ball-=6; }
- else if (move_dir == NOR) { y_ball-=3; x_ball-=4; }
- else if (move_dir == NOL) { y_ball-=3; x_ball-=3; }
- if ((move_dir == NESR || move_dir == NOSR) || (move_dir == SESR || move_dir == SOSR)) combo=1;
- else combo = 0;
- }
- else if (!move && !pause)
- { x_ball=x_racket+96/2-6/2; } // La balle suit la raquette
- while (active != levelsize) /** Gagné ? **/
- {
- if (death[death_i] == 1) win_i++;
- death_i++;
- active++;
- }
- if (win_i == levelsize) win=1;
- death_i=0;
- active=0;
- win_i=0;
- if(levelmovestate == MOVING_RIGHT)
- {
- levelposition+=10;
- if (levelposition==480)
- {
- levelmovestate=RIGHT_MOVE_DONE;
- }
- }
- else if(levelmovestate == MOVING_LEFT)
- {
- levelposition-=10;
- if (levelposition==-480)
- {
- levelmovestate=LEFT_MOVE_DONE;
- }
- }
- else if(levelmovestate == LEFT_MOVE_DONE)
- {
- }
- else if(levelmovestate == RIGHT_MOVE_DONE)
- {
- memset(levelbufferright, 0, sizeof(levelbufferright));
- memcpy(levelbufferright,levelbuffer,sizeof(levelbuffer));
- memset(levelbuffer, 0, sizeof(levelbuffer));
- memcpy(levelbuffer,levelbufferleft,sizeof(levelbufferleft));
- memset(levelbufferleft, 0, sizeof(levelbufferleft));
- //
- levelposition=0;
- levelmovestate = NO_MOVE;
- }
- /** Affichage **/
- guStart();
- clearScreen(BLACK);
- blitImageToScreen(0 ,0 ,480, 272, background, 0, 0); // Image de fond
- blitAlphaImageToScreen(0 ,0 ,96, 10, sprite_r, x_racket, y_racket); // Sprite de la raquette
- if (y_ball <= 272) blitAlphaImageToScreen(0 ,0 ,8, 8, sprite_ba, x_ball, y_ball); // Sprite de la balle
- while (active != levelsize) /** Affichage des briques **/ // Penser au clipping !!
- {
- x_brick = levelbuffer[active*3]+levelposition;
- y_brick = levelbuffer[active*3+1];
- t_brick = levelbuffer[active*3+2];
- active++;
- if (death[death_i] == 0)
- {
- if (t_brick == 0) blitAlphaImageToScreen(0 ,0 ,60, 20, sprite_br1, x_brick, y_brick); // Sprite de la brique
- else if (t_brick == 1) blitAlphaImageToScreen(0 ,0 ,60, 20, sprite_br2, x_brick, y_brick); // Sprite de la brique
- else if (t_brick == 2) blitAlphaImageToScreen(0 ,0 ,60, 20, sprite_br3, x_brick, y_brick); // Sprite de la brique
- }
- death_i++;
- }
- death_i =0;
- active =0;
- if (levelmovestate == MOVING_RIGHT)
- {
- while (active != levelsize_left)
- {
- x_brick = levelbufferleft[active*3]+levelposition-480;
- y_brick = levelbufferleft[active*3+1];
- t_brick = levelbufferleft[active*3+2];
- active++;
- if (t_brick == 0) blitAlphaImageToScreen(0 ,0 ,60, 20, sprite_br1, x_brick, y_brick); // Sprite de la brique
- else if (t_brick == 1) blitAlphaImageToScreen(0 ,0 ,60, 20, sprite_br2, x_brick, y_brick); // Sprite de la brique
- else if (t_brick == 2) blitAlphaImageToScreen(0 ,0 ,60, 20, sprite_br3, x_brick, y_brick); // Sprite de la brique
- }
- active =0;
- }
- else if (levelmovestate == MOVING_LEFT)
- {
- while (active != levelsize_right)
- {
- x_brick = levelbufferright[active*3]+levelposition+480;
- y_brick = levelbufferright[active*3+1];
- t_brick = levelbufferright[active*3+2];
- active++;
- if (t_brick == 0) blitAlphaImageToScreen(0 ,0 ,60, 20, sprite_br1, x_brick, y_brick); // Sprite de la brique
- else if (t_brick == 1) blitAlphaImageToScreen(0 ,0 ,60, 20, sprite_br2, x_brick, y_brick); // Sprite de la brique
- else if (t_brick == 2) blitAlphaImageToScreen(0 ,0 ,60, 20, sprite_br3, x_brick, y_brick); // Sprite de la brique
- }
- active =0;
- }
- if (feu == 40) feu=0;
- if (feu > 30) blitAlphaImageToScreen(68 ,0 ,18, 18, sprite_f, 5, 250);
- else if (feu > 20) blitAlphaImageToScreen(48 ,0 ,18, 18, sprite_f, 5, 250); // Sprites
- else if (feu > 10) blitAlphaImageToScreen(27 ,0 ,18, 18, sprite_f, 5, 250); // du feu
- else if (feu >= 0) blitAlphaImageToScreen(0 ,0 ,18, 18, sprite_f, 5, 250);
- feu++;
- sprintf(combobuf,"%dX", comboval);
- if (combo) intraFontSetStyle(ifl[1],1.00f,RED,0,INTRAFONT_ALIGN_LEFT);
- else if (!combo) intraFontSetStyle(ifl[1],1.00f,DARKGRAY,0,INTRAFONT_ALIGN_LEFT);
- intraFontPrint(ifl[1],2,17,combobuf);
- sceGuTexMode(GU_PSM_8888, 0, 0, 0);
- sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
- sceGuTexFilter(GU_NEAREST, GU_NEAREST);
- sceGuFinish();
- sceGuSync(0,0);
- combobar = combo*30/comboval;
- if (combobar<=2) combobar=3;
- else if (combobar>=31) combobar=30;
- drawLineScreen(2,21,31,21,BLACK);
- putPixelScreen(BLACK, 2, 22);
- drawLineScreen(3,22,combobar,22,RED);
- putPixelScreen(BLACK, 31, 22);
- drawLineScreen(2,23,31,23,BLACK);
- guStart();
- sprintf(score,"score = %d", score_var);
- intraFontSetStyle(ifl[0],1.00f,BLACK,0,INTRAFONT_ALIGN_RIGHT);
- intraFontPrint(ifl[0],475,12,score);
- sceGuTexMode(GU_PSM_8888, 0, 0, 0);
- sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
- sceGuTexFilter(GU_NEAREST, GU_NEAREST);
- if (lose)
- {
- intraFontSetStyle(ifl[0], 1.25f, BLACK, WHITE,INTRAFONT_ALIGN_CENTER);
- intraFontPrint(ifl[0],480/2,272/2,"Vous avez perdu !");
- intraFontSetStyle(ifl[0], 1.00f, BLACK, WHITE,INTRAFONT_ALIGN_CENTER);
- intraFontPrint(ifl[0],240,260,"X pour recommencer, O pour retourner au XMB :(");
- sceGuTexMode(GU_PSM_8888, 0, 0, 0);
- sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
- sceGuTexFilter(GU_NEAREST, GU_NEAREST);
- }
- if (win && !error_level)
- {
- intraFontSetStyle(ifl[0], 1.25f, BLACK, WHITE,INTRAFONT_ALIGN_CENTER);
- intraFontPrint(ifl[0],480/2,272/2,"Vous avez gagne !");
- intraFontSetStyle(ifl[0], 1.00f, BLACK, WHITE,INTRAFONT_ALIGN_CENTER);
- intraFontPrint(ifl[0],240,260,"X pour aller au niveau suivant, O pour retourner au XMB :)");
- sceGuTexMode(GU_PSM_8888, 0, 0, 0);
- sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
- sceGuTexFilter(GU_NEAREST, GU_NEAREST);
- }
- if (pause)
- {
- sprintf(debug,"%d, %d, %d, %d, %d, %d... %d", levelbuffer[0], levelbuffer[1], levelbuffer[2], levelbuffer[3], levelbuffer[4], levelbuffer[5], levelsize);
- state = drawWindow(240,136,exit_window);
- intraFontSetStyle(ifl[0], 1.25f, BLACK, WHITE,INTRAFONT_ALIGN_CENTER);
- intraFontPrint(ifl[0],480/2,272/2,"En pause...");
- intraFontSetStyle(ifl[0], 0.75f, BLACK,0,INTRAFONT_ALIGN_CENTER);
- intraFontPrint(ifl[0],480/2,252,debug);
- sceGuTexMode(GU_PSM_8888, 0, 0, 0);
- sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
- sceGuTexFilter(GU_NEAREST, GU_NEAREST);
- }
- if (error_level)
- {
- intraFontSetStyle(ifl[0], 1.25f, BLACK, WHITE,INTRAFONT_ALIGN_CENTER);
- intraFontPrint(ifl[0],480/2,272/2,"Il n'y a pas de niveau suivant !");
- intraFontSetStyle(ifl[0], 1.00f, BLACK, WHITE,INTRAFONT_ALIGN_CENTER);
- intraFontPrint(ifl[0],240,260,"Carre pour retourner au 1er niveau, O pour retourner au XMB :)");
- sceGuTexMode(GU_PSM_8888, 0, 0, 0);
- sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGBA);
- sceGuTexFilter(GU_NEAREST, GU_NEAREST);
- }
- sceGuFinish();
- sceGuSync(0,0);
- sceDisplayWaitVblankStart();
- flipScreen();
- }
- sceKernelExitGame();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement