fixed splash DLL code (but partially left disabled)

This commit is contained in:
dborca
2004-12-13 08:40:18 +00:00
parent e36b40e673
commit 1af5c552fe

View File

@@ -19,6 +19,9 @@
** **
** $Header$ ** $Header$
** $Log$ ** $Log$
** Revision 1.1.1.1.8.4 2004/11/25 19:07:31 koolsmoky
** Prepare for newer splash screens
**
** Revision 1.1.1.1.8.3 2004/10/08 06:28:35 dborca ** Revision 1.1.1.1.8.3 2004/10/08 06:28:35 dborca
** small matters concerning "ActiveWindow" on non-Windows ** small matters concerning "ActiveWindow" on non-Windows
** **
@@ -301,6 +304,7 @@
#include <glide.h> #include <glide.h>
#include "fxglide.h" #include "fxglide.h"
#include "fxsplash.h"
#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) #if (GLIDE_PLATFORM & GLIDE_OS_WIN32)
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
@@ -1508,49 +1512,49 @@ __errSliExit:
HMODULE newSplash; HMODULE newSplash;
if (newSplash = LoadLibrary("3dfxspl3.dll")) { if (newSplash = LoadLibrary("3dfxspl3.dll")) {
GrState glideState;
FxBool didLoad; FxBool didLoad;
FARPROC fxSplash; GrSplashProc fxSplash;
FARPROC fxSplashInit; GrSplashInitProc fxSplashInit;
FARPROC fxSplashPlug; GrSplashPlugProc fxSplashPlug;
FARPROC fxSplashShutdown; GrSplashShutdownProc fxSplashShutdown;
fxSplash = GetProcAddress(newSplash, "_fxSplash@20"); fxSplash = (GrSplashProc)GetProcAddress(newSplash, "_fxSplash@20");
fxSplashInit = GetProcAddress(newSplash, "_fxSplashInit@24"); fxSplashInit = (GrSplashInitProc)GetProcAddress(newSplash, "_fxSplashInit@24");
fxSplashPlug = GetProcAddress(newSplash, "_fxSplashPlug@16"); fxSplashPlug = (GrSplashPlugProc)GetProcAddress(newSplash, "_fxSplashPlug@16");
fxSplashShutdown = GetProcAddress(newSplash, "_fxSplashShutdown@0"); fxSplashShutdown = (GrSplashShutdownProc)GetProcAddress(newSplash, "_fxSplashShutdown@0");
didLoad = ((fxSplash != NULL) && didLoad = ((fxSplash != NULL) &&
(fxSplashInit != NULL) && (fxSplashInit != NULL) &&
(fxSplashPlug != NULL) && (fxSplashPlug != NULL) &&
(fxSplashShutdown != NULL)); (fxSplashShutdown != NULL));
if (0 & didLoad) { if (didLoad & 0/* [dBorca] i am evil! harr-harr */) {
GrState glideState; /* new style DLL */
grGlideGetState(&glideState); grGlideGetState(&glideState);
{ didLoad = fxSplashInit(hWnd,
didLoad = fxSplashInit(hWnd, gc->state.screen_width, gc->state.screen_height,
gc->state.screen_width, gc->state.screen_height, nColBuffers, nAuxBuffers,
nColBuffers, nAuxBuffers, format);
format); if (didLoad) {
if (didLoad) { fxSplash(0.0f, 0.0f,
fxSplash(0.0f, 0.0f, (float)gc->state.screen_width,
(float)gc->state.screen_width, (float)gc->state.screen_height,
(float)gc->state.screen_height, 0);
0); fxSplashShutdown();
_GlideRoot.environment.noSplash = 1; _GlideRoot.environment.noSplash = 1;
} else {
fxSplashShutdown();
}
} }
grGlideSetState((const void*)&glideState); grGlideSetState((const void*)&glideState);
} } else {
/* old style DLL */
if (!_GlideRoot.environment.noSplash) { typedef int (FX_CALL *GrSplashOld) (FxU32 hWind, FxU32 scrWidth, FxU32 scrHeight, FxU32 nAuxBuffers);
if (fxSplash = GetProcAddress(newSplash, "_fxSplash@16")) { GrSplashOld fxSplashOld = (GrSplashOld)GetProcAddress(newSplash, "_fxSplash@16");
fxSplash(hWnd, gc->state.screen_width, gc->state.screen_height, nAuxBuffers); if (fxSplashOld) {
_GlideRoot.environment.noSplash = 1; grGlideGetState(&glideState);
} fxSplashOld(hWnd, gc->state.screen_width, gc->state.screen_height, nAuxBuffers);
_GlideRoot.environment.noSplash = 1;
grGlideSetState((const void*)&glideState);
}
} }
FreeLibrary(newSplash); FreeLibrary(newSplash);