Random cleanup: fix whitespace in config check, remove commented debug code. Cleanup a bit initGL.

This commit is contained in:
riccardom 2009-06-17 17:19:06 +00:00
parent 2a86619492
commit a2b08efbd7
1 changed files with 24 additions and 43 deletions

View File

@ -22,7 +22,6 @@
#include <SDL/SDL_thread.h> #include <SDL/SDL_thread.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <libgen.h>
#ifndef VERSION #ifndef VERSION
@ -33,7 +32,7 @@
* FIXME: Not sure how to detect OpenGL in a platform portable way. * FIXME: Not sure how to detect OpenGL in a platform portable way.
*/ */
#ifdef HAVE_GL_GL_H #ifdef HAVE_GL_GL_H
#define INCLUDE_OPENGL_2D 1 #define INCLUDE_OPENGL_2D
#endif #endif
#ifdef INCLUDE_OPENGL_2D #ifdef INCLUDE_OPENGL_2D
@ -62,7 +61,7 @@ volatile BOOL execute = FALSE;
static float nds_screen_size_ratio = 1.0f; static float nds_screen_size_ratio = 1.0f;
#define DISPLAY_FPS 1 #define DISPLAY_FPS
#ifdef DISPLAY_FPS #ifdef DISPLAY_FPS
#define NUM_FRAMES_TO_TIME 60 #define NUM_FRAMES_TO_TIME 60
@ -74,7 +73,7 @@ static float nds_screen_size_ratio = 1.0f;
static SDL_Surface * surface; static SDL_Surface * surface;
/* Flags to pass to SDL_SetVideoMode */ /* Flags to pass to SDL_SetVideoMode */
static int sdl_videoFlags = 0; static int sdl_videoFlags;
SoundInterface_struct *SNDCoreList[] = { SoundInterface_struct *SNDCoreList[] = {
&SNDDummy, &SNDDummy,
@ -429,14 +428,9 @@ fps_limiter_fn( Uint32 interval, void *param) {
static int static int
initGL( GLuint *screen_texture) { initGL( GLuint *screen_texture) {
GLenum errCode; GLenum errCode;
int init_good = 1;
int i;
u16 blank_texture[256 * 512]; u16 blank_texture[256 * 512];
for ( i = 0; i < 256 * 512; i++) { memset(blank_texture, 0x001f, sizeof(blank_texture));
blank_texture[i] = 0x001f;
}
/* Enable Texture Mapping */ /* Enable Texture Mapping */
glEnable( GL_TEXTURE_2D ); glEnable( GL_TEXTURE_2D );
@ -474,10 +468,10 @@ initGL( GLuint *screen_texture) {
errString = gluErrorString(errCode); errString = gluErrorString(errCode);
fprintf( stderr, "Failed to init GL: %s\n", errString); fprintf( stderr, "Failed to init GL: %s\n", errString);
init_good = 0; return 0;
} }
return init_good; return 1;
} }
static void static void
@ -542,12 +536,6 @@ resizeWindow( u16 width, u16 height) {
right = 256.0 * ((double)width / other_dimen); right = 256.0 * ((double)width / other_dimen);
} }
/*
printf("%d,%d\n", width, height);
printf("l %lf, r %lf, t %lf, b %lf, other dimen %lf\n",
left, right, top, bottom, other_dimen);
*/
/* get the area (0,0) to (256,384) into the middle of the viewport */ /* get the area (0,0) to (256,384) into the middle of the viewport */
gluOrtho2D( left, right, bottom, top); gluOrtho2D( left, right, bottom, top);
} }
@ -824,12 +812,6 @@ int main(int argc, char ** argv) {
} }
#endif #endif
/* // This has to get fixed yet
strncpy(szRomPath, dirname(argv[1]), ARRAY_SIZE(szRomPath));
cflash_close();
cflash_init();
*/
execute = TRUE; execute = TRUE;
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) == -1) if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) == -1)
@ -974,7 +956,6 @@ int main(int argc, char ** argv) {
fps /= NUM_FRAMES_TO_TIME * 1000.f; fps /= NUM_FRAMES_TO_TIME * 1000.f;
fps = 1.0f / fps; fps = 1.0f / fps;
//printf("fps %f\n", fps);
fps_frame_counter = 0; fps_frame_counter = 0;
fps_timing = 0; fps_timing = 0;