SDL Windows updates:

- Fixed build on windows
- Clear the screen before each frame when in opengl mode to remove artifacts on Windows
- Don't use the asm version of the Sai2x filters anymore, since it somehow doesn't link on Windows
This commit is contained in:
mudlord 2008-01-30 22:37:22 +00:00
parent c545911374
commit 4bf1715142
2 changed files with 8 additions and 4 deletions

View File

@ -40,7 +40,7 @@ ifndef $(PREFIX)
endif endif
ifndef VERSION ifndef VERSION
SVNVERSION=$(shell test -d .svn && svnversion -n .) -SVNVERSION=$(shell test -d .svn && svnversion -n .)
BADCHARS=$(findstring :,$(SVNVERSION))$(findstring S,$(SVNVERSION)) BADCHARS=$(findstring :,$(SVNVERSION))$(findstring S,$(SVNVERSION))
ifeq ($(BADCHARS),) ifeq ($(BADCHARS),)
ifneq ($(SVNVERSION),) ifneq ($(SVNVERSION),)
@ -66,7 +66,7 @@ HQASMDIR=src/hq/asm
ASMOBJ=${HQASMDIR}/hq3x_16${OE} ${HQASMDIR}/hq3x_32${OE} ${HQASMDIR}/hq4x_16${OE} \ ASMOBJ=${HQASMDIR}/hq3x_16${OE} ${HQASMDIR}/hq3x_32${OE} ${HQASMDIR}/hq4x_16${OE} \
${HQASMDIR}/hq4x_32${OE} ${HQASMDIR}/hq3x32${OE} ${MAINDIR}/2xSaImmx${OE} ${HQASMDIR}/hq4x_32${OE} ${HQASMDIR}/hq3x32${OE}
GBAPUOBJ=${GBAPUDIR}/Blip_Buffer${OE} ${GBAPUDIR}/Effects_Buffer${OE} ${GBAPUDIR}/Gb_Apu${OE} \ GBAPUOBJ=${GBAPUDIR}/Blip_Buffer${OE} ${GBAPUDIR}/Effects_Buffer${OE} ${GBAPUDIR}/Gb_Apu${OE} \
${GBAPUDIR}/Gb_Apu_State${OE} ${GBAPUDIR}/Gb_Oscs${OE} ${GBAPUDIR}/Multi_Buffer${OE} ${GBAPUDIR}/Gb_Apu_State${OE} ${GBAPUDIR}/Gb_Oscs${OE} ${GBAPUDIR}/Multi_Buffer${OE}
@ -96,7 +96,6 @@ OBJECTS=${MAINOBJ} ${DMGOBJ} ${SDLOBJ} ${GBAPUOBJ}
ifeq ($(USEASM),yes) ifeq ($(USEASM),yes)
OBJECTS+=${ASMOBJ} OBJECTS+=${ASMOBJ}
CXXFLAGS+=-DMMX
else else
OBJECTS+=${CALTERNOBJ} OBJECTS+=${CALTERNOBJ}
endif endif

View File

@ -435,7 +435,7 @@ FILE *sdlFindFile(const char *name)
} }
#ifdef _WIN32 #ifdef _WIN32
home = getenv("USERPROFILE"); char *home = getenv("USERPROFILE");
if(home != NULL) { if(home != NULL) {
fprintf(stderr, "Searching user profile directory: %s\n", home); fprintf(stderr, "Searching user profile directory: %s\n", home);
sprintf(path, "%s%c%s", home, FILE_SEP, name); sprintf(path, "%s%c%s", home, FILE_SEP, name);
@ -1602,12 +1602,16 @@ int main(int argc, char **argv)
char buf[1024]; char buf[1024];
struct stat s; struct stat s;
#ifndef _WIN32
// Get home dir // Get home dir
homeDir = getenv("HOME"); homeDir = getenv("HOME");
snprintf(buf, 1024, "%s/%s", homeDir, DOT_DIR); snprintf(buf, 1024, "%s/%s", homeDir, DOT_DIR);
// Make dot dir if not existent // Make dot dir if not existent
if (stat(buf, &s) == -1 || !S_ISDIR(s.st_mode)) if (stat(buf, &s) == -1 || !S_ISDIR(s.st_mode))
mkdir(buf, 0755); mkdir(buf, 0755);
#else
homeDir = 0;
#endif
sdlReadPreferences(); sdlReadPreferences();
@ -2123,6 +2127,7 @@ void systemDrawScreen()
drawSpeed(screen, destPitch, 10, 20); drawSpeed(screen, destPitch, 10, 20);
if (openGL) { if (openGL) {
glClear( GL_COLOR_BUFFER_BIT );
glPixelStorei(GL_UNPACK_ROW_LENGTH, destWidth); glPixelStorei(GL_UNPACK_ROW_LENGTH, destWidth);
if (systemColorDepth == 16) if (systemColorDepth == 16)
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, destWidth, destHeight, glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, destWidth, destHeight,