X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fvideo.cpp;h=917738071ec29bf8c290fd6ee8ef7298cee849ea;hb=e0a3f430ecbda85e5f0903011bf8ffeb01f10fe0;hp=e7ed63ff344ce222afc475d8c40b3d01e6de4a89;hpb=2a28fa007da024402b00c2e341afaa9609ac1273;p=virtualjaguar diff --git a/src/video.cpp b/src/video.cpp index e7ed63f..9177380 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -2,11 +2,18 @@ // VIDEO.CPP: SDL/local hardware specific video routines // // by James L. Hammons +// (C) 2010 Underground Software +// +// JLH = James L. Hammons +// +// Who When What +// --- ---------- ------------------------------------------------------------- +// JLH 01/16/2010 Created this log ;-) // #include "video.h" -#include "gui.h" // For "finished" +//#include "gui.h" // For "finished" #include "log.h" #include "tom.h" #include "sdlemu_opengl.h" @@ -17,11 +24,24 @@ //shouldn't these exist here??? Prolly. //And now, they do! :-) SDL_Surface * surface, * mainSurface; -SDL_Joystick * joystick; +SDL_Joystick * joystick1; Uint32 mainSurfaceFlags; //int16 * backbuffer; uint32 * backbuffer; +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + #define RMASK 0xFF000000 + #define GMASK 0x00FF0000 + #define BMASK 0x0000FF00 + #define AMASK 0x000000FF +#else + #define RMASK 0x000000FF + #define GMASK 0x0000FF00 + #define BMASK 0x00FF0000 + #define AMASK 0xFF000000 +#endif + + // One of the reasons why OpenGL is slower then normal SDL rendering, is because // the data is being pumped into the buffer every frame with a overflow as result. // So, we going tot render every 1 frame instead of every 0 frame. @@ -111,12 +131,7 @@ bool VideoInit(void) // vsWidth = 1280; //24BPP // surface = SDL_CreateRGBSurface(SDL_SWSURFACE, VIRTUAL_SCREEN_WIDTH, - surface = SDL_CreateRGBSurface(SDL_SWSURFACE, vsWidth, vsHeight, 32, -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF); -#else - 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); -#endif//*/ + surface = SDL_CreateRGBSurface(SDL_SWSURFACE, vsWidth, vsHeight, 32, RMASK, GMASK, BMASK, AMASK); if (surface == NULL) { @@ -143,7 +158,7 @@ bool VideoInit(void) } else { - if ((joystick = SDL_JoystickOpen(vjs.joyport)) == 0) + if ((joystick1 = SDL_JoystickOpen(vjs.joyport)) == 0) { vjs.useJoystick = false; printf("VJ: Unable to open a Joystick on port: %d\n", (int)vjs.joyport); @@ -171,7 +186,7 @@ void VideoDone(void) if (vjs.useOpenGL) sdlemu_close_opengl(); - SDL_JoystickClose(joystick); + SDL_JoystickClose(joystick1); SDL_FreeSurface(surface); free(backbuffer); } @@ -225,13 +240,10 @@ void RenderBackbuffer(void) // void ResizeScreen(uint32 width, uint32 height) { +// For now, we don't do anything here... +#if 0 SDL_FreeSurface(surface); - surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF); -#else - 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); -#endif//*/ + surface = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, RMASK, GMASK, BMASK, AMASK); if (surface == NULL) { @@ -240,7 +252,8 @@ void ResizeScreen(uint32 width, uint32 height) //as well as screwing up SDL... !!! FIX !!! // exit(1); // OK, this is cleaner. We can't continue if there is no surface created! - finished = true; +#warning "!!! FIX !!! (finished = true)" +// finished = true; } if (vjs.useOpenGL) @@ -266,6 +279,7 @@ void ResizeScreen(uint32 width, uint32 height) sprintf(window_title, "Virtual Jaguar (%i x %i)", (int)width, (int)height); SDL_WM_SetCaption((vjs.useOpenGL ? "Virtual Jaguar (OpenGL)" : window_title), "Virtual Jaguar"); +#endif } //