diff --git a/glide2x/cvg/glide/src/gglide.c b/glide2x/cvg/glide/src/gglide.c index ca32e83..4780f53 100644 --- a/glide2x/cvg/glide/src/gglide.c +++ b/glide2x/cvg/glide/src/gglide.c @@ -768,9 +768,11 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval)) #endif /* (GLIDE_PLATFORM & GLIDE_HW_CVG) */ #if ((GLIDE_PLATFORM & GLIDE_HW_CVG) || (GLIDE_PLATFORM & GLIDE_HW_H3)) + #ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); - + #endif + /* check for environmental override. * * NB: If we are sli, the application passes in 0, and the user has diff --git a/glide2x/cvg/glide/src/gpci.c b/glide2x/cvg/glide/src/gpci.c index 3459d08..a514631 100644 --- a/glide2x/cvg/glide/src/gpci.c +++ b/glide2x/cvg/glide/src/gpci.c @@ -746,8 +746,16 @@ _GlideInitEnvironment(void) (((envStr = GETENV(__envVar)) == NULL) ? (__defVal) : atol(envStr)) _GlideRoot.environment.triBoundsCheck = (GETENV("FX_GLIDE_BOUNDS_CHECK") != NULL); +#ifdef GLIDE_SPLASH _GlideRoot.environment.noSplash = (GETENV("FX_GLIDE_NO_SPLASH") != NULL); +#else + _GlideRoot.environment.noSplash = 1; +#endif +#ifdef GLIDE_PLUG _GlideRoot.environment.shamelessPlug = (GETENV("FX_GLIDE_SHAMELESS_PLUG") != NULL); +#else + _GlideRoot.environment.shamelessPlug = 0; +#endif _GlideRoot.environment.ignoreReopen = (GETENV("FX_GLIDE_IGNORE_REOPEN") != NULL); _GlideRoot.environment.texLodDither = ((GETENV("FX_GLIDE_LOD_DITHER") == NULL) ? 0x00UL diff --git a/glide2x/cvg/glide/src/gsplash.c b/glide2x/cvg/glide/src/gsplash.c index 3cc1e65..bc729f9 100644 --- a/glide2x/cvg/glide/src/gsplash.c +++ b/glide2x/cvg/glide/src/gsplash.c @@ -90,6 +90,13 @@ #include "fxglide.h" #include "fxinline.h" +#ifndef GLIDE_SPLASH +GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) { +/* nothing */ +} + +#else /* GLIDE_SPLASH */ + /*----------------------------- Constants -----------------------------*/ @@ -951,3 +958,4 @@ GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) } +#endif /* GLIDE_SPLASH */ diff --git a/glide2x/cvg/glide/src/gsst.c b/glide2x/cvg/glide/src/gsst.c index 38966ef..891ace2 100644 --- a/glide2x/cvg/glide/src/gsst.c +++ b/glide2x/cvg/glide/src/gsst.c @@ -1571,6 +1571,7 @@ __errSliExit: /* -------------------------------------------------------- Splash Screen --------------------------------------------------------*/ +#ifdef GLIDE_SPLASH #if (GLIDE_PLATFORM & GLIDE_OS_WIN32) if (!_GlideRoot.environment.noSplash) { HMODULE newSplash = LoadLibrary("3dfxspl2.dll"); @@ -1634,6 +1635,7 @@ __errSliExit: 0); _GlideRoot.environment.noSplash = 1; } +#endif _GlideRoot.windowsInit = FXTRUE; /* to avoid race with grSstControl() */ diff --git a/glide2x/h3/glide/src/gbanner.c b/glide2x/h3/glide/src/gbanner.c index 65d2882..8cae198 100644 --- a/glide2x/h3/glide/src/gbanner.c +++ b/glide2x/h3/glide/src/gbanner.c @@ -74,28 +74,45 @@ #include #include "fxglide.h" +#ifdef GLIDE_PLUG + +#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) +static const void * +getPlugdata (FxU32* w, FxU32* h, FxI32* strideInBytes, + GrLfbWriteMode_t* format) +{ + GR_DCL_GC; + if (gc->pluginInfo.plugProc != NULL) + return (*gc->pluginInfo.plugProc)(w,h,strideInBytes,format); + return NULL; +} +#else +static __inline const void * +getPlugdata (FxU32* w, FxU32* h, FxI32* strideInBytes, + GrLfbWriteMode_t* format) +{ + return NULL; +} +#endif + + void _grShamelessPlug(void) { + GrState state; + FxU32 plugWidth, plugHeight; + FxI32 plugStride; + GrLfbWriteMode_t plugFormat; + const void* plugData; + GR_BEGIN_NOFIFOCHECK("_grShamelessPlug", 80); GDBG_INFO_MORE(gc->myLevel, "()\n"); -#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) - if (gc->pluginInfo.plugProc != NULL) { - FxU32 - plugWidth, plugHeight, - plugStride; - GrLfbWriteMode_t - plugFormat; - const void* - plugData = (*gc->pluginInfo.plugProc)(&plugWidth, &plugHeight, - &plugStride, - &plugFormat); + plugData = + getPlugdata(&plugWidth, &plugHeight, &plugStride, &plugFormat); + + if (!plugData) return; - if (plugData != NULL) { -#ifdef GLIDE_PLUG - GrState state; - grGlideGetState(&state); grDisableAllEffects(); @@ -133,10 +150,8 @@ _grShamelessPlug(void) plugData); grGlideSetState(&state); -#endif /* GLIDE_PLUG */ - } - } -#endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ GR_END(); } /* _grShamelessPlug */ + +#endif /* GLIDE_PLUG */ diff --git a/glide2x/h3/glide/src/gglide.c b/glide2x/h3/glide/src/gglide.c index 97d8796..418c4b3 100644 --- a/glide2x/h3/glide/src/gglide.c +++ b/glide2x/h3/glide/src/gglide.c @@ -768,8 +768,10 @@ GR_ENTRY(grBufferSwap, void, (int swapInterval)) GR_BEGIN_NOFIFOCHECK(FN_NAME,86); GDBG_INFO_MORE(gc->myLevel,"(%d)\n",swapInterval); +#ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); +#endif /* check for environmental override */ if (_GlideRoot.environment.swapInterval >= 0) { diff --git a/glide2x/h3/glide/src/gpci.c b/glide2x/h3/glide/src/gpci.c index e76e829..1e5ded2 100644 --- a/glide2x/h3/glide/src/gpci.c +++ b/glide2x/h3/glide/src/gpci.c @@ -908,12 +908,20 @@ _GlideInitEnvironment(void) GDBG_INFO(80,"\ttriBoundsCheck: %d\n", _GlideRoot.environment.triBoundsCheck); +#ifdef GLIDE_SPLASH _GlideRoot.environment.noSplash = (GETENV("FX_GLIDE_NO_SPLASH") != NULL); +#else + _GlideRoot.environment.noSplash = 1; +#endif GDBG_INFO(80,"\tnoSplash: %d\n",_GlideRoot.environment.noSplash); +#ifdef GLIDE_PLUG _GlideRoot.environment.shamelessPlug = (GETENV("FX_GLIDE_SHAMELESS_PLUG") != NULL); +#else + _GlideRoot.environment.shamelessPlug = 0; +#endif GDBG_INFO(80,"\tshamelessPlug: %d\n", _GlideRoot.environment.shamelessPlug); diff --git a/glide2x/h3/glide/src/gsst.c b/glide2x/h3/glide/src/gsst.c index b252b9d..9e3d5da 100644 --- a/glide2x/h3/glide/src/gsst.c +++ b/glide2x/h3/glide/src/gsst.c @@ -594,9 +594,11 @@ assertDefaultState( void ) static void doSplash(void) { +#if defined(GLIDE_SPLASH) || ((GLIDE_PLATFORM & GLIDE_OS_WIN32) && defined(GLIDE_PLUG)) GR_DCL_GC; +#endif -#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) +#if (GLIDE_PLATFORM & GLIDE_OS_WIN32) && (defined(GLIDE_SPLASH)||defined(GLIDE_PLUG)) { FxBool didLoad; @@ -633,6 +635,7 @@ doSplash(void) } #endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ +#ifdef GLIDE_SPLASH if (_GlideRoot.environment.noSplash == 0) { grSplash(0.0f, 0.0f, (float)gc->state.screen_width, @@ -640,6 +643,7 @@ doSplash(void) 0); } _GlideRoot.environment.noSplash = 1; +#endif } /* doSplash */ diff --git a/glide2x/sst1/glide/src/gglide.c b/glide2x/sst1/glide/src/gglide.c index 34dab48..f9fd7f4 100644 --- a/glide2x/sst1/glide/src/gglide.c +++ b/glide2x/sst1/glide/src/gglide.c @@ -559,9 +559,11 @@ GR_ENTRY(grBufferSwap, void, ( int swapInterval )) pending = grBufferNumPending(); } while (pending > 3); +#ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); +#endif initSwapBuffers( swapInterval ); @@ -578,9 +580,11 @@ GR_ENTRY(grBufferSwap, void, ( int swapInterval )) P6_NUDGE_OF_LOVE; #elif ( GLIDE_PLATFORM & GLIDE_HW_SST1 ) + #ifdef GLIDE_PLUG /* optionally display the 3Dfx powerfield logo overlay */ if (_GlideRoot.environment.shamelessPlug) _grShamelessPlug(); + #endif /* check for environmental override */ if (_GlideRoot.environment.swapInterval >= 0) { diff --git a/glide2x/sst1/glide/src/gpci.c b/glide2x/sst1/glide/src/gpci.c index cc388c2..78608e1 100644 --- a/glide2x/sst1/glide/src/gpci.c +++ b/glide2x/sst1/glide/src/gpci.c @@ -389,10 +389,18 @@ _GlideInitEnvironment( void ) getenv("FX_GLIDE_BOUNDS_CHECK") != NULL; _GlideRoot.environment.swapInterval = -1; _GlideRoot.environment.swFifoLWM = -1; +#ifdef GLIDE_SPLASH _GlideRoot.environment.noSplash = getenv("FX_GLIDE_NO_SPLASH") != NULL; +#else + _GlideRoot.environment.noSplash = 1; +#endif +#ifdef GLIDE_PLUG _GlideRoot.environment.shamelessPlug = getenv("FX_GLIDE_SHAMELESS_PLUG") != NULL; +#else + _GlideRoot.environment.shamelessPlug = 0; +#endif if (getenv("FX_GLIDE_LWM")) _GlideRoot.environment.swFifoLWM = atoi(getenv("FX_GLIDE_LWM")); if (getenv("FX_GLIDE_SWAPINTERVAL")) { diff --git a/glide2x/sst1/glide/src/gsplash.c b/glide2x/sst1/glide/src/gsplash.c index 01350a7..fd7582f 100644 --- a/glide2x/sst1/glide/src/gsplash.c +++ b/glide2x/sst1/glide/src/gsplash.c @@ -59,6 +59,13 @@ #include +#ifndef GLIDE_SPLASH +GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) { +/* nothing */ +} + +#else /* GLIDE_SPLASH */ + /*----------------------------- Constants -----------------------------*/ @@ -889,5 +896,4 @@ GR_DIENTRY(grSplash,void,(float x,float y,float w,float h,FxU32 _frame)) grGlideSetState(&oldState); } - - +#endif /* GLIDE_SPLASH */ diff --git a/glide2x/sst1/glide/src/gsst.c b/glide2x/sst1/glide/src/gsst.c index e17c146..87b9522 100644 --- a/glide2x/sst1/glide/src/gsst.c +++ b/glide2x/sst1/glide/src/gsst.c @@ -951,6 +951,7 @@ GR_ENTRY(grSstWinOpen, FxBool, ( grSstOrigin( GR_ORIGIN_LOWER_LEFT ); +#ifdef GLIDE_SPLASH if (!_GlideRoot.environment.noSplash) { HMODULE newSplash = LoadLibrary("3dfxsplash2.dll"); if (newSplash) { @@ -962,8 +963,10 @@ GR_ENTRY(grSstWinOpen, FxBool, ( } } } +#endif #endif /* (GLIDE_PLATFORM & GLIDE_OS_WIN32) */ +#ifdef GLIDE_SPLASH /* If it's still 0, then do the old one */ if (!_GlideRoot.environment.noSplash) { grSplash(0.0f, 0.0f, @@ -972,6 +975,8 @@ GR_ENTRY(grSstWinOpen, FxBool, ( 0); _GlideRoot.environment.noSplash = 1; } +#endif + grGlideSetState(&state); }