[CHG] Updated examples to put all GRRLIB_FreeTexture/GRRLIB_FreeBMF/GRRLIB_FreeTTF call before GRRLIB_Exit

This commit is contained in:
Crayon2000 2011-03-16 01:24:01 +00:00
parent 53e99b0236
commit 1b49480c0f
18 changed files with 22 additions and 21 deletions

View file

@ -339,12 +339,12 @@ int main() {
GRRLIB_Render();
}
GRRLIB_Exit();
GRRLIB_FreeTexture(tex_tile1);
GRRLIB_FreeTexture(tex_perso);
GRRLIB_FreeTexture(tex_bg);
GRRLIB_FreeTexture(tex_nonameno);
GRRLIB_FreeTexture(tex_screen);
GRRLIB_Exit();
exit(0);
}

View file

@ -79,8 +79,8 @@ int main() {
GRRLIB_Render();
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
GRRLIB_FreeTexture(tex_font);
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
exit(0);
}

View file

@ -74,8 +74,8 @@ int main() {
GRRLIB_Render();
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
GRRLIB_FreeTexture(tex_font);
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
exit(0);
}

View file

@ -96,8 +96,8 @@ int main() {
GRRLIB_Printf(50, 60, tex_font, 0xFFFFFFFF, 1, "Use ( A / B ) to change the shyniness value : %d ",(int)shy);
GRRLIB_Render();
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
GRRLIB_FreeTexture(tex_font);
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
exit(0);
}

View file

@ -47,6 +47,7 @@ int main(int argc, char **argv) {
GRRLIB_Render();
}
GRRLIB_FreeTexture(tex_font);
GRRLIB_Exit();
exit(0);

View file

@ -99,8 +99,8 @@ int main() {
GRRLIB_Render();
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
GRRLIB_FreeTexture(tex_font);
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
exit(0);
}

View file

@ -128,9 +128,9 @@ int main() {
GRRLIB_Render();
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
GRRLIB_FreeTexture(tex_girl);
GRRLIB_FreeTexture(tex_font);
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
exit(0);
}

View file

@ -144,10 +144,10 @@ int main() {
GRRLIB_Render();
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
GRRLIB_FreeTexture(tex_girl);
GRRLIB_FreeTexture(tex_font);
GRRLIB_FreeTexture(tex_screen);
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
exit(0);
}

View file

@ -97,8 +97,8 @@ int main(void){
GRRLIB_Printf((640-(16*29))/2, 20, tex_font, 0xFFFFFFFF, 1, "JUST ANOTHER 3D SAMPLE");
GRRLIB_Render();
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
GRRLIB_FreeTexture(tex_font);
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
exit(0);
}

View file

@ -251,8 +251,8 @@ GXTexObj texObj;
GRRLIB_Render();
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
GRRLIB_FreeTexture(tex_font);
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
exit(0);
}

View file

@ -263,12 +263,12 @@ int main() {
}
GRRLIB_Exit();
// Free some textures
GRRLIB_FreeTexture(tex_tile1);
GRRLIB_FreeTexture(tex_perso);
GRRLIB_FreeTexture(tex_bg);
GRRLIB_FreeTexture(tex_nonameno);
GRRLIB_Exit();
exit(0);
}

View file

@ -219,7 +219,6 @@ int main() {
GRRLIB_Render();
FPS = CalculateFrameRate();
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
// Free some textures
GRRLIB_FreeTexture(tex_test_jpg);
GRRLIB_FreeTexture(tex_test_bmp);
@ -231,6 +230,7 @@ int main() {
GRRLIB_FreeTexture(tex_BMfont5);
GRRLIB_FreeBMF(bmf_Font1);
GRRLIB_FreeBMF(bmf_Font2);
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
return 0;
}

View file

@ -202,7 +202,6 @@ int main() {
if(page > 7) page = 0;
}
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
GRRLIB_FreeTexture(tex_pirate);
GRRLIB_FreeTexture(tex_gray);
GRRLIB_FreeTexture(tex_sepia);
@ -228,5 +227,6 @@ int main() {
GRRLIB_FreeTexture(tex_scatter4);
GRRLIB_FreeTexture(tex_scatter5);
GRRLIB_FreeTexture(tex_scatter6);
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
return 0;
}

View file

@ -125,9 +125,6 @@ int main() {
}
static void ExitGame() {
// Deinitialize GRRLIB & Video
GRRLIB_Exit();
// Free all memory used by textures.
GRRLIB_FreeTexture(GFX_Background);
GRRLIB_FreeTexture(GFX_Blob[0]);
@ -135,6 +132,9 @@ static void ExitGame() {
GRRLIB_FreeTexture(GFX_Blob[2]);
GRRLIB_FreeTexture(GFX_Font);
// Deinitialize GRRLIB & Video
GRRLIB_Exit();
// Exit application
exit(0);
}

View file

@ -57,9 +57,9 @@ int main() {
GRRLIB_Render();
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
GRRLIB_FreeTexture(tex_screen);
GRRLIB_FreeTexture(tex_font);
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
exit(0);
}

View file

@ -258,9 +258,6 @@ static bool updateParticle( Particle *part ) {
static void ExitGame() {
// Deinitialize GRRLIB & Video
GRRLIB_Exit();
// Free all memory used by textures.
for (vector<GRRLIB_texImg *>::iterator TexIter = TextureList.begin(); TexIter != TextureList.end(); TexIter++) {
free((*TexIter)->data);
@ -268,6 +265,9 @@ static void ExitGame() {
}
TextureList.clear();
// Deinitialize GRRLIB & Video
GRRLIB_Exit();
// Exit application
exit(0);
}

View file

@ -89,12 +89,12 @@ int main() {
if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0);
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
GRRLIB_FreeTexture(tex_logo);
GRRLIB_FreeTexture(tex_ball);
GRRLIB_FreeTexture(tex_font);
for(i=0; i<10; i++) {
GRRLIB_FreeTexture(tex_screen[i]);
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
return 0;
}

View file

@ -186,13 +186,13 @@ int main() {
if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0);
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
GRRLIB_FreeTexture(tex_logo);
GRRLIB_FreeTexture(tex_girl);
GRRLIB_FreeTexture(tex_font);
for(i=0; i<9; i++) {
GRRLIB_FreeTexture(tex_screen[i]);
}
GRRLIB_Exit(); // Be a good boy, clear the memory allocated by GRRLIB
return 0;
}