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
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}
ASM=nasm
ASMFLAGS=-w-orphan-labels -f elf -DELF -O1 -Isrc/hq/asm/
@ -69,7 +69,6 @@ ifeq ($(USEASM),yes)
OBJECTS+=${ASMOBJ}
else
OBJECTS+=${CALTERNOBJ}
CFLAGS+=-DC_CORE
endif
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 COLORTYPE
#undef _MAGNIFICATION

View File

@ -785,7 +785,7 @@ void sdlOpenGLInit(int w, int h)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
openGL == 2 ? GL_LINEAR : GL_NEAREST);
textureSize = filterFunction ? 512 : 256;
textureSize = 256 * filter_enlarge;
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, textureSize, textureSize, 0,
GL_BGRA, GL_UNSIGNED_BYTE, NULL);
}
@ -1287,6 +1287,15 @@ void sdlPollEvents()
case SDL_QUIT:
emulating = 0;
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:
if(pauseWhenInactive && (event.active.state & SDL_APPINPUTFOCUS)) {
active = event.active.gain;
@ -1406,15 +1415,6 @@ void sdlPollEvents()
}
debugger = true;
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_F2:
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 hq3x16(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 hq4x32(u8*,u32,u8*,u8*,u32,int,int);
extern void hq3x32_32(u8*,u32,u8*,u8*,u32,int,int);
extern void hq4x32_32(u8*,u32,u8*,u8*,u32,int,int);
struct FilterDesc {
char name[30];
@ -79,9 +79,9 @@ const FilterDesc Filters[] = {
{ "lq2x", 2, lq2x, 0, lq2x32 },
{ "hq2x", 2, hq2x, 0, hq2x32 },
{ "Stretch 3x", 3, sdlStretch3x, sdlStretch3x, sdlStretch3x },
{ "hq3x", 3, hq3x16, 0, hq3x32 },
{ "hq3x", 3, hq3x16, 0, hq3x32_32 },
{ "Stretch 4x", 4, sdlStretch4x, sdlStretch4x, sdlStretch4x },
{ "hq4x", 4, hq4x16, 0, hq4x32 }
{ "hq4x", 4, hq4x16, 0, hq4x32_32 }
};
int getFilterEnlargeFactor(const Filter f)
@ -615,3 +615,4 @@ void sdlStretch4x(u8 *srcPtr, u32 srcPitch, u8 * /* deltaPtr */, u8 *dstPtr, u32
}
}