- cleanup of baselayer.cpp

This commit is contained in:
Christoph Oelckers 2019-11-04 01:18:38 +01:00
parent 4bf6c306ab
commit 0b6db7eede
6 changed files with 4 additions and 91 deletions

View file

@ -502,9 +502,7 @@ int32_t registerosdcommands(void)
OSD_RegisterFunction("screenshot","screenshot [format]: takes a screenshot.", osdcmd_screenshot);
OSD_RegisterFunction("vidmode","vidmode <xdim> <ydim> <bpp> <fullscreen>: change the video mode",osdcmd_vidmode);
#ifdef USE_OPENGL
baselayer_osdcmd_vidmode_func = osdcmd_vidmode;
#endif
return 0;
}

View file

@ -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

View file

@ -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 <sys/mman.h>
#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;
}

View file

@ -8081,7 +8081,7 @@ static tspritetype tsprite_s[MAXSPRITESONSCREEN];
int32_t enginePreInit(void)
{
baselayer_init();
polymost_initosdfuncs();
initdivtables();
#if !defined DEBUG_MAIN_ARRAYS

View file

@ -1162,9 +1162,7 @@ int32_t registerosdcommands(void)
OSD_RegisterFunction("spawn","spawn <picnum> [palnum] [cstat] [ang] [x y z]: spawns a sprite with the given properties",osdcmd_spawn);
OSD_RegisterFunction("vidmode","vidmode <xdim> <ydim> <bpp> <fullscreen>: change the video mode",osdcmd_vidmode);
#ifdef USE_OPENGL
baselayer_osdcmd_vidmode_func = osdcmd_vidmode;
#endif
return 0;
}

View file

@ -969,9 +969,7 @@ int32_t registerosdcommands(void)
OSD_RegisterFunction("spawn","spawn <picnum> [palnum] [cstat] [ang] [x y z]: spawns a sprite with the given properties",osdcmd_spawn);
OSD_RegisterFunction("vidmode","vidmode <xdim> <ydim> <bpp> <fullscreen>: change the video mode",osdcmd_vidmode);
#ifdef USE_OPENGL
baselayer_osdcmd_vidmode_func = osdcmd_vidmode;
#endif
return 0;
}