1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-07 03:13:49 +00:00

remove unused GLES related code

This commit is contained in:
Sergey Lipskiy 2014-09-11 13:04:58 +07:00
parent f6ebb311a1
commit c2e3ea6d63
2 changed files with 4 additions and 99 deletions

View File

@ -7,13 +7,6 @@
//// paulscode, added for SDL linkage:
#if defined(GLES2)
#include "ae_bridge.h"
#if defined (USE_SDL)
#include <SDL.h>
// TODO: Remove this bandaid for SDL 2.0 compatibility (needed for SDL_SetVideoMode)
#if SDL_VERSION_ATLEAST(2,0,0)
#include "sdl2_compat.h" // Slightly hacked version of core/vidext_sdl2_compat.h
#endif
#endif // USE_SDL
#endif // GLES2
////

View File

@ -14,77 +14,6 @@ void OGL_ResizeWindow()
{
}
////// paulscode, added for SDL linkage
#if defined(GLES2) && defined (USE_SDL)
//#if defined (USE_SDL)
bool OGL_SDL_Start()
{
/* Initialize SDL */
LOG(LOG_MINIMAL, "Initializing SDL video subsystem...\n" );
if (SDL_InitSubSystem( SDL_INIT_VIDEO ) == -1)
{
LOG(LOG_ERROR, "Error initializing SDL video subsystem: %s\n", SDL_GetError() );
return FALSE;
}
int current_w = config.video.windowedWidth;
int current_h = config.video.windowedHeight;
/* Set the video mode */
LOG(LOG_MINIMAL, "Setting video mode %dx%d...\n", current_w, current_h );
// TODO: I should actually check what the pixelformat is, rather than assuming 16 bpp (RGB_565) or 32 bpp (RGBA_8888):
//// paulscode, added for switching between modes RGBA8888 and RGB565
// (part of the color banding fix)
int bitsPP;
if( Android_JNI_UseRGBA8888() )
bitsPP = 32;
else
bitsPP = 16;
////
// TODO: Replace SDL_SetVideoMode with something that is SDL 2.0 compatible
// Better yet, eliminate all SDL calls by using the Mupen64Plus core api
if (!(OGL.hScreen = SDL_SetVideoMode( current_w, current_h, bitsPP, SDL_HWSURFACE )))
{
LOG(LOG_ERROR, "Problem setting videomode %dx%d: %s\n", current_w, current_h, SDL_GetError() );
SDL_QuitSubSystem( SDL_INIT_VIDEO );
return FALSE;
}
/*
//// paulscode, fixes the screen-size problem
int videoWidth = current_w;
int videoHeight = current_h;
int x = 0;
int y = 0;
//re-scale width and height on per-rom basis
float width = (float)videoWidth * (float)config.window.refwidth / 800.f;
float height = (float)videoHeight * (float)config.window.refheight / 480.f;
//re-center video if it was re-scaled per-rom
x -= (width - (float)videoWidth) / 2.f;
y -= (height - (float)videoHeight) / 2.f;
//set xpos and ypos
config.window.xpos = x;
config.window.ypos = y;
config.framebuffer.xpos = x;
config.framebuffer.ypos = y;
//set width and height
config.window.width = (int)width;
config.window.height = (int)height;
config.framebuffer.width = (int)width;
config.framebuffer.height = (int)height;
////
*/
return true;
}
#endif
//////
bool OGL_Start()
{
if (OGL.fullscreen){
@ -95,7 +24,6 @@ bool OGL_Start()
OGL.height = config.video.windowedHeight;
}
#ifndef GLES2
CoreVideo_Init();
CoreVideo_GL_SetAttribute(M64P_GL_DOUBLEBUFFER, 1);
CoreVideo_GL_SetAttribute(M64P_GL_SWAP_CONTROL, 1);
@ -110,18 +38,13 @@ bool OGL_Start()
}
char caption[500];
# ifdef _DEBUG
# ifdef _DEBUG
sprintf(caption, "GLideN64 debug");
# else // _DEBUG
# else // _DEBUG
sprintf(caption, "GLideN64");
# endif // _DEBUG
# endif // _DEBUG
CoreVideo_SetCaption(caption);
#else // GLES2
if (!OGL_SDL_Start())
return false;
#endif // GLES2
OGL_InitData();
return true;
@ -131,23 +54,12 @@ void OGL_Stop()
{
OGL_DestroyData();
#ifndef GLES2
CoreVideo_Quit();
#else
#if defined(USE_SDL)
SDL_QuitSubSystem( SDL_INIT_VIDEO );
OGL.hScreen = NULL;
#endif
#endif // GLES2
}
void OGL_SwapBuffers()
{
#ifndef GLES2
CoreVideo_GL_SwapBuffers();
#else
Android_JNI_SwapWindow(); // paulscode, fix for black-screen bug
#endif // GLES2
CoreVideo_GL_SwapBuffers();
}
void OGL_SaveScreenshot()