From 07f75e28d81b8acc64cfb6dee9302fb0eba8774a Mon Sep 17 00:00:00 2001 From: notaz Date: Mon, 16 Jan 2012 20:05:37 +0200 Subject: [PATCH] gpu-gles: clean up headers and stuff --- plugins/gpu-gles/Makefile | 2 +- plugins/gpu-gles/gpuDraw.c | 46 +++++++-------------------------- plugins/gpu-gles/gpuExternals.h | 11 ++------ plugins/gpu-gles/gpuPlugin.c | 4 +-- plugins/gpu-gles/gpuPlugin.h | 29 ++------------------- plugins/gpu-gles/gpuStdafx.h | 18 +++---------- 6 files changed, 18 insertions(+), 92 deletions(-) diff --git a/plugins/gpu-gles/Makefile b/plugins/gpu-gles/Makefile index 4b61b6f4..8a3f244e 100644 --- a/plugins/gpu-gles/Makefile +++ b/plugins/gpu-gles/Makefile @@ -15,7 +15,7 @@ endif CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 # note: the below causes strange bugs/crashes #CFLAGS += -mfloat-abi=softfp -CFLAGS += -DMAEMO_CHANGES # -DUSE_X11 +#CFLAGS += -DUSE_X11 CFLAGS += -I$(PREFIX)include TARGET = gpuGLES.so diff --git a/plugins/gpu-gles/gpuDraw.c b/plugins/gpu-gles/gpuDraw.c index 4f639c10..2eaa8254 100644 --- a/plugins/gpu-gles/gpuDraw.c +++ b/plugins/gpu-gles/gpuDraw.c @@ -308,11 +308,9 @@ void CreateScanLines(void) HGLRC GLCONTEXT=NULL; #endif -#ifdef MAEMO_CHANGES #define MODE_RAW 0 #define MODE_X11 1 #define MODE_SDL 2 -int pandora_driver_mode = MODE_RAW; int use_fsaa = 0; EGLDisplay display; @@ -345,9 +343,7 @@ EGLint attrib_list_fsaa[] = EGLint attrib_list[] = { - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_BUFFER_SIZE, 0, - EGL_DEPTH_SIZE, 16, +// EGL_DEPTH_SIZE, 16, EGL_NONE }; @@ -368,7 +364,8 @@ bool TestEGLError(const char* pszLocation) return TRUE; } -void maemoGLinit(){ +static void initEGL(void) +{ printf ("GL init\n"); EGLint numConfigs; @@ -400,15 +397,6 @@ void maemoGLinit(){ } #if defined(USE_X11) - pandora_driver_mode = MODE_X11; // TODO make configurable -#else - pandora_driver_mode = MODE_RAW; // TODO make configurable -#endif - - switch(pandora_driver_mode) - { -#if defined(USE_X11) - case MODE_X11: // Initializes the display and screen x11Display = XOpenDisplay( ":0" ); if (!x11Display) @@ -463,13 +451,9 @@ void maemoGLinit(){ XSendEvent(x11Display, DefaultRootWindow(x11Display), False, SubstructureRedirectMask | SubstructureNotifyMask, &xev); display = eglGetDisplay( (EGLNativeDisplayType)x11Display ); - break; -#endif - case MODE_RAW: - default: +#else display = eglGetDisplay( (EGLNativeDisplayType)0 ); - break; - } +#endif if( display == EGL_NO_DISPLAY ) { @@ -492,18 +476,11 @@ void maemoGLinit(){ printf( "GLES EGL Error: eglCreateContext failed\n" ); } - switch(pandora_driver_mode) - { #if defined(USE_X11) - case MODE_X11: surface = eglCreateWindowSurface( display, config, (EGLNativeDisplayType)x11Window, NULL ); - break; -#endif - case MODE_RAW: - default: +#else surface = eglCreateWindowSurface( display, config, (EGLNativeDisplayType)0, NULL ); - break; - } +#endif eglMakeCurrent( display, surface, surface, context ); if (!TestEGLError("eglMakeCurrent")) @@ -511,7 +488,6 @@ void maemoGLinit(){ else printf("GLES Window Opened\n"); } -#endif int GLinitialize() { @@ -526,9 +502,8 @@ int GLinitialize() // CheckWGLExtensions(dcGlobal); if(bWindowMode) ReleaseDC(hWWindow,dcGlobal); // win mode: release dc again #endif -#ifdef MAEMO_CHANGES - maemoGLinit(); -#endif + initEGL(); + //----------------------------------------------------// glViewport(rRatioRect.left, // init viewport by ratio rect @@ -629,12 +604,9 @@ void GLcleanup() eglTerminate( display ); #if defined(USE_X11) - if (pandora_driver_mode == MODE_X11) - { if (x11Window) XDestroyWindow(x11Display, x11Window); if (x11Colormap) XFreeColormap( x11Display, x11Colormap ); if (x11Display) XCloseDisplay(x11Display); - } #endif } diff --git a/plugins/gpu-gles/gpuExternals.h b/plugins/gpu-gles/gpuExternals.h index 8d30814a..f88b37b6 100644 --- a/plugins/gpu-gles/gpuExternals.h +++ b/plugins/gpu-gles/gpuExternals.h @@ -33,19 +33,12 @@ extern "C" { #endif -#ifndef _WINDOWS #ifdef __NANOGL__ #include #include #else -#ifdef SOFT_LINKAGE -#pragma softfp_linkage -#endif -#include // for opengl es types -#ifdef SOFT_LINKAGE -#pragma no_softfp_linkage -#endif -#endif +#include +#include #endif #ifdef __NANOGL__ diff --git a/plugins/gpu-gles/gpuPlugin.c b/plugins/gpu-gles/gpuPlugin.c index 81b7f05e..368c5ce3 100644 --- a/plugins/gpu-gles/gpuPlugin.c +++ b/plugins/gpu-gles/gpuPlugin.c @@ -560,9 +560,7 @@ long CALLBACK GPUopen(int hwndGPU) #ifdef _WINDOWS iResX=240;iResY=320; #endif -#ifdef MAEMO_CHANGES - iResX=800;iResY=480; -#endif + iResX=800;iResY=480; iColDepth=8; bChangeRes=FALSE; #ifdef _WINDOWS diff --git a/plugins/gpu-gles/gpuPlugin.h b/plugins/gpu-gles/gpuPlugin.h index e9a66af5..768ebe1f 100644 --- a/plugins/gpu-gles/gpuPlugin.h +++ b/plugins/gpu-gles/gpuPlugin.h @@ -46,34 +46,9 @@ extern "C" { #define GREEN(x) ((x>>8) & 0xff) #define COLOR(x) (x & 0xffffff) -#ifdef _WINDOWS -#include "Externals.h" -#include "plugin.h" -#include -#else -//#ifndef MAEMO_CHANGES -// #include "psxCommon.h" -//#else -// #include "../psxCommon.h" -//#endif + #include "gpuExternals.h" -#ifdef __NANOGL__ -#include -#else -#ifdef SOFT_LINKAGE -#pragma softfp_linkage -#endif -#ifndef MAEMO_CHANGES - #include // for opengl es types - #include -#else -#include "gpuStdafx.h" -#endif -#ifdef SOFT_LINKAGE -#pragma no_softfp_linkage -#endif -#endif -#endif + ///////////////////////////////////////////////////////////////////////////// #define CALLBACK diff --git a/plugins/gpu-gles/gpuStdafx.h b/plugins/gpu-gles/gpuStdafx.h index bc348989..3a6a1c52 100644 --- a/plugins/gpu-gles/gpuStdafx.h +++ b/plugins/gpu-gles/gpuStdafx.h @@ -66,21 +66,9 @@ extern "C" { #ifdef SOFT_LINKAGE #pragma softfp_linkage #endif -#ifdef MAEMO_CHANGES - - //#include - #include - //#include - #include - //#include "../maemo/minimal.h" - //#include - //#include - - -#else - #include // for opengl es types - #include -#endif +#include // for opengl es types +//#include +#include #ifdef SOFT_LINKAGE #pragma no_softfp_linkage #endif -- 2.39.2