SDL-OpenGL fixes:

- Filters > 2x now work with the OpenGL renderer
- Window resizing with the OpenGL renderer is fixed
- Fixed hq3x and hq4x when in 32bpp mode + C version of the filters
- Disabled ASM CPU emulation core since it doesn't build here

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@281 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
mudlord 2008-01-10 08:59:37 +00:00
parent 73f7325e93
commit d7dc5effea
4 changed files with 45 additions and 30 deletions

View File

@ -1,6 +1,6 @@
CC=gcc CC=gcc
CPPC=g++ CPPC=g++
CFLAGS=-W -Wall -Wno-unused -O3 -DHAVE_NETINET_IN_H -DHAVE_ARPA_INET_H -DFINAL_VERSION -DBKPT_SUPPORT -DSDL -DSYSCONFDIR="home" -DUSE_OPENGL CFLAGS=-W -Wall -Wno-unused -O3 -DHAVE_NETINET_IN_H -DHAVE_ARPA_INET_H -DFINAL_VERSION -DBKPT_SUPPORT -DSDL -DSYSCONFDIR="home" -DUSE_OPENGL -DC_CORE
CXXFLAGS=${CFLAGS} CXXFLAGS=${CFLAGS}
ASM=nasm ASM=nasm
ASMFLAGS=-w-orphan-labels -f elf -DELF -O1 -Isrc/hq/asm/ ASMFLAGS=-w-orphan-labels -f elf -DELF -O1 -Isrc/hq/asm/
@ -69,7 +69,6 @@ ifeq ($(USEASM),yes)
OBJECTS+=${ASMOBJ} OBJECTS+=${ASMOBJ}
else else
OBJECTS+=${CALTERNOBJ} OBJECTS+=${CALTERNOBJ}
CFLAGS+=-DC_CORE
endif endif
ifeq ($(USEFEX),yes) ifeq ($(USEFEX),yes)

View File

@ -420,6 +420,21 @@ int Xres, int Yres )
} }
} }
#ifdef _32BIT
#ifdef _HQ3X
void hq3x32_32(unsigned char *pIn, unsigned int srcPitch, unsigned char *, unsigned char *pOut, unsigned int dstPitch, int Xres, int Yres)
{
hq3x32(pIn, srcPitch, 0, pOut, dstPitch, Xres, Yres);
}
#endif
#ifdef _HQ4X
void hq4x32_32(unsigned char *pIn, unsigned int srcPitch, unsigned char *, unsigned char *pOut, unsigned int dstPitch, int Xres, int Yres)
{
hq4x32(pIn, srcPitch, 0, pOut, dstPitch, Xres, Yres);
}
#endif
#endif
#undef SIZE_PIXEL #undef SIZE_PIXEL
#undef COLORTYPE #undef COLORTYPE
#undef _MAGNIFICATION #undef _MAGNIFICATION

View File

@ -785,7 +785,7 @@ void sdlOpenGLInit(int w, int h)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
openGL == 2 ? GL_LINEAR : GL_NEAREST); openGL == 2 ? GL_LINEAR : GL_NEAREST);
textureSize = filterFunction ? 512 : 256; textureSize = 256 * filter_enlarge;
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, textureSize, textureSize, 0, glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, textureSize, textureSize, 0,
GL_BGRA, GL_UNSIGNED_BYTE, NULL); GL_BGRA, GL_UNSIGNED_BYTE, NULL);
} }
@ -1287,6 +1287,15 @@ void sdlPollEvents()
case SDL_QUIT: case SDL_QUIT:
emulating = 0; emulating = 0;
break; break;
case SDL_VIDEORESIZE:
if (openGL)
{
SDL_SetVideoMode(event.resize.w, event.resize.h, 16,
SDL_OPENGL | SDL_RESIZABLE |
(fullscreen ? SDL_FULLSCREEN : 0));
sdlOpenGLInit(event.resize.w, event.resize.h);
}
break;
case SDL_ACTIVEEVENT: case SDL_ACTIVEEVENT:
if(pauseWhenInactive && (event.active.state & SDL_APPINPUTFOCUS)) { if(pauseWhenInactive && (event.active.state & SDL_APPINPUTFOCUS)) {
active = event.active.gain; active = event.active.gain;
@ -1406,15 +1415,6 @@ void sdlPollEvents()
} }
debugger = true; debugger = true;
break; break;
case SDL_VIDEORESIZE:
if (openGL)
{
SDL_SetVideoMode(event.resize.w, event.resize.h, 16,
SDL_OPENGL | SDL_RESIZABLE |
(fullscreen ? SDL_FULLSCREEN : 0));
sdlOpenGLInit(event.resize.w, event.resize.h);
}
break;
case SDLK_F1: case SDLK_F1:
case SDLK_F2: case SDLK_F2:
case SDLK_F3: case SDLK_F3:

View File

@ -52,8 +52,8 @@ extern void lq2x(u8*,u32,u8*,u8*,u32,int,int);
extern void lq2x32(u8*,u32,u8*,u8*,u32,int,int); extern void lq2x32(u8*,u32,u8*,u8*,u32,int,int);
extern void hq3x16(u8*,u32,u8*,u8*,u32,int,int); extern void hq3x16(u8*,u32,u8*,u8*,u32,int,int);
extern void hq4x16(u8*,u32,u8*,u8*,u32,int,int); extern void hq4x16(u8*,u32,u8*,u8*,u32,int,int);
extern void hq3x32(u8*,u32,u8*,u8*,u32,int,int); extern void hq3x32_32(u8*,u32,u8*,u8*,u32,int,int);
extern void hq4x32(u8*,u32,u8*,u8*,u32,int,int); extern void hq4x32_32(u8*,u32,u8*,u8*,u32,int,int);
struct FilterDesc { struct FilterDesc {
char name[30]; char name[30];
@ -79,9 +79,9 @@ const FilterDesc Filters[] = {
{ "lq2x", 2, lq2x, 0, lq2x32 }, { "lq2x", 2, lq2x, 0, lq2x32 },
{ "hq2x", 2, hq2x, 0, hq2x32 }, { "hq2x", 2, hq2x, 0, hq2x32 },
{ "Stretch 3x", 3, sdlStretch3x, sdlStretch3x, sdlStretch3x }, { "Stretch 3x", 3, sdlStretch3x, sdlStretch3x, sdlStretch3x },
{ "hq3x", 3, hq3x16, 0, hq3x32 }, { "hq3x", 3, hq3x16, 0, hq3x32_32 },
{ "Stretch 4x", 4, sdlStretch4x, sdlStretch4x, sdlStretch4x }, { "Stretch 4x", 4, sdlStretch4x, sdlStretch4x, sdlStretch4x },
{ "hq4x", 4, hq4x16, 0, hq4x32 } { "hq4x", 4, hq4x16, 0, hq4x32_32 }
}; };
int getFilterEnlargeFactor(const Filter f) int getFilterEnlargeFactor(const Filter f)
@ -117,29 +117,29 @@ FilterFunc initFilter(const Filter f, const int colorDepth, const int srcWidth)
if (func) if (func)
switch (f) { switch (f) {
case kStretch1x: case kStretch1x:
sdlStretchInit(colorDepth, 0, srcWidth); sdlStretchInit(colorDepth, 0, srcWidth);
break; break;
case kStretch2x: case kStretch2x:
sdlStretchInit(colorDepth, 1, srcWidth); sdlStretchInit(colorDepth, 1, srcWidth);
break; break;
case kStretch3x: case kStretch3x:
sdlStretchInit(colorDepth, 2, srcWidth); sdlStretchInit(colorDepth, 2, srcWidth);
break; break;
case kStretch4x: case kStretch4x:
sdlStretchInit(colorDepth, 3, srcWidth); sdlStretchInit(colorDepth, 3, srcWidth);
break; break;
case k2xSaI: case k2xSaI:
case kSuper2xSaI: case kSuper2xSaI:
case kSuperEagle: case kSuperEagle:
if (colorDepth == 15) Init_2xSaI(555); if (colorDepth == 15) Init_2xSaI(555);
else if (colorDepth == 16) Init_2xSaI(565); else if (colorDepth == 16) Init_2xSaI(565);
else Init_2xSaI(colorDepth); else Init_2xSaI(colorDepth);
break; break;
case khq2x: case khq2x:
case klq2x: case klq2x:
hq2x_init(colorDepth); hq2x_init(colorDepth);
break; break;
default: default:
break; break;
} }
@ -615,3 +615,4 @@ void sdlStretch4x(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, u8 *dstPtr, u32
} }
} }