From 0b6db7eede31578dfcd12502ab3f8e95283208ae Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 4 Nov 2019 01:18:38 +0100 Subject: [PATCH] - cleanup of baselayer.cpp --- source/blood/src/osdcmd.cpp | 4 +- source/build/include/baselayer.h | 6 --- source/build/src/baselayer.cpp | 75 -------------------------------- source/build/src/engine.cpp | 2 +- source/duke3d/src/osdcmds.cpp | 4 +- source/rr/src/osdcmds.cpp | 4 +- 6 files changed, 4 insertions(+), 91 deletions(-) diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index 019104d83..eef35e3e1 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -502,9 +502,7 @@ int32_t registerosdcommands(void) OSD_RegisterFunction("screenshot","screenshot [format]: takes a screenshot.", osdcmd_screenshot); OSD_RegisterFunction("vidmode","vidmode : change the video mode",osdcmd_vidmode); -#ifdef USE_OPENGL - baselayer_osdcmd_vidmode_func = osdcmd_vidmode; -#endif + return 0; } diff --git a/source/build/include/baselayer.h b/source/build/include/baselayer.h index 005a3f6c1..e9838870b 100644 --- a/source/build/include/baselayer.h +++ b/source/build/include/baselayer.h @@ -74,7 +74,6 @@ extern float g_videoGamma, g_videoContrast, g_videoBrightness; #define GAMMA_CALC ((int32_t)(min(max((float)((g_videoGamma - 1.0f) * 10.0f), 0.f), 15.f))) #ifdef USE_OPENGL -extern int32_t (*baselayer_osdcmd_vidmode_func)(osdcmdptr_t parm); extern int osdcmd_glinfo(osdcmdptr_t parm); @@ -110,8 +109,6 @@ char CONSTEXPR const g_keyAsciiTableShift[128] = { // mouse extern vec2_t g_mousePos; extern vec2_t g_mouseAbs; -extern int32_t g_mouseBits; -extern uint8_t inputState.mouseClickState(); extern bool g_mouseGrabbed; extern bool g_mouseEnabled; extern bool g_mouseInsideWindow; @@ -176,9 +173,6 @@ int32_t wm_msgbox(const char *name, const char *fmt, ...) ATTRIBUTE((format(prin int32_t wm_ynbox(const char *name, const char *fmt, ...) ATTRIBUTE((format(printf,2,3))); void wm_setapptitle(const char *name); -// baselayer.c -int32_t baselayer_init(); - #include "print.h" struct GameInterface diff --git a/source/build/src/baselayer.cpp b/source/build/src/baselayer.cpp index a6199d549..ccd0429ae 100644 --- a/source/build/src/baselayer.cpp +++ b/source/build/src/baselayer.cpp @@ -69,13 +69,6 @@ controllerinput_t joystick; void joySetCallback(void (*callback)(int32_t, int32_t)) { joystick.pCallback = callback; } void joyReadButtons(int32_t *pResult) { *pResult = appactive ? joystick.bits : 0; } -#if defined __linux || defined EDUKE32_BSD || defined __APPLE__ -# include -#endif - - - - // Calculate ylookup[] and call setvlinebpl() void calc_ylookup(int32_t bpl, int32_t lastyidx) { @@ -113,73 +106,5 @@ void calc_ylookup(int32_t bpl, int32_t lastyidx) } -void makeasmwriteable(void) -{ -} - int32_t g_logFlushWindow = 1; -#ifdef USE_OPENGL -struct glinfo_t glinfo = -{ - "Unknown", // vendor - "Unknown", // renderer - "0.0.0", // version - "", // extensions - - 1.0, // max anisotropy -}; - -// Used to register the game's / editor's osdcmd_vidmode() functions here. -int32_t (*baselayer_osdcmd_vidmode_func)(osdcmdptr_t parm); - - -#ifdef DEBUGGINGAIDS -static int osdcmd_hicsetpalettetint(osdcmdptr_t parm) -{ - int32_t parms[8]; - - if (parm->numparms < 1 || (int32_t)ARRAY_SIZE(parms) < parm->numparms) return OSDCMD_SHOWHELP; - - size_t i; - for (i = 0; (int32_t)i < parm->numparms; ++i) - parms[i] = Batol(parm->parms[i]); - for (; i < ARRAY_SIZE(parms); ++i) - parms[i] = 0; - - // order is intentional - hicsetpalettetint(parms[0],parms[1],parms[2],parms[3],parms[5],parms[6],parms[7],parms[4]); - - return OSDCMD_OK; -} -#endif - -int osdcmd_glinfo(osdcmdptr_t UNUSED(parm)) -{ - UNREFERENCED_CONST_PARAMETER(parm); - - initprintf("OpenGL information\n %s %s %s\n", - GLInterface.glinfo.vendor, GLInterface.glinfo.renderer, GLInterface.glinfo.version); - - return OSDCMD_OK; -} -#endif - - -int32_t baselayer_init(void) -{ - -#ifdef USE_OPENGL - -# ifdef DEBUGGINGAIDS - OSD_RegisterFunction("hicsetpalettetint","hicsetpalettetint: sets palette tinting values",osdcmd_hicsetpalettetint); -# endif - - OSD_RegisterFunction("glinfo","glinfo: shows OpenGL information about the current OpenGL mode",osdcmd_glinfo); - - polymost_initosdfuncs(); -#endif - - return 0; -} - diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 1e991c2eb..b1df1e98b 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -8081,7 +8081,7 @@ static tspritetype tsprite_s[MAXSPRITESONSCREEN]; int32_t enginePreInit(void) { - baselayer_init(); + polymost_initosdfuncs(); initdivtables(); #if !defined DEBUG_MAIN_ARRAYS diff --git a/source/duke3d/src/osdcmds.cpp b/source/duke3d/src/osdcmds.cpp index f349f9c1a..060b69e4e 100644 --- a/source/duke3d/src/osdcmds.cpp +++ b/source/duke3d/src/osdcmds.cpp @@ -1162,9 +1162,7 @@ int32_t registerosdcommands(void) OSD_RegisterFunction("spawn","spawn [palnum] [cstat] [ang] [x y z]: spawns a sprite with the given properties",osdcmd_spawn); OSD_RegisterFunction("vidmode","vidmode : change the video mode",osdcmd_vidmode); -#ifdef USE_OPENGL - baselayer_osdcmd_vidmode_func = osdcmd_vidmode; -#endif + return 0; } diff --git a/source/rr/src/osdcmds.cpp b/source/rr/src/osdcmds.cpp index d610b9749..697c00feb 100644 --- a/source/rr/src/osdcmds.cpp +++ b/source/rr/src/osdcmds.cpp @@ -969,9 +969,7 @@ int32_t registerosdcommands(void) OSD_RegisterFunction("spawn","spawn [palnum] [cstat] [ang] [x y z]: spawns a sprite with the given properties",osdcmd_spawn); OSD_RegisterFunction("vidmode","vidmode : change the video mode",osdcmd_vidmode); -#ifdef USE_OPENGL - baselayer_osdcmd_vidmode_func = osdcmd_vidmode; -#endif + return 0; }