- fixed compilation.

This commit is contained in:
Christoph Oelckers 2019-11-04 17:58:18 +01:00
parent e7f4433df6
commit 1ee4efebb0
11 changed files with 26 additions and 32 deletions

View file

@ -183,18 +183,10 @@ void ShutDown(void)
sfxTerm(); sfxTerm();
scrUnInit(); scrUnInit();
CONTROL_Shutdown(); CONTROL_Shutdown();
KB_Shutdown();
OSD_Cleanup(); OSD_Cleanup();
// PORT_TODO: Check argument // PORT_TODO: Check argument
if (syncstate) if (syncstate)
printf("A packet was lost! (syncstate)\n"); printf("A packet was lost! (syncstate)\n");
#if 0 // never used anywhere.
for (int i = 0; i < 10; i++)
{
if (gSaveGamePic[i])
Resource::Free(gSaveGamePic[i]);
}
#endif
DO_FREE_AND_NULL(pUserTiles); DO_FREE_AND_NULL(pUserTiles);
DO_FREE_AND_NULL(pUserSoundRFF); DO_FREE_AND_NULL(pUserSoundRFF);
DO_FREE_AND_NULL(pUserRFF); DO_FREE_AND_NULL(pUserRFF);

View file

@ -175,7 +175,7 @@ void CGameMenuMgr::Draw(void)
if (!MOUSEACTIVECONDITION) if (!MOUSEACTIVECONDITION)
m_mousewake_watchpoint = 1; m_mousewake_watchpoint = 1;
if (MOUSEACTIVECONDITIONAL(mouseAdvanceClickState()) || m_mousepos.x != m_prevmousepos.x || m_mousepos.y != m_prevmousepos.y) if (MOUSEACTIVECONDITIONAL(inputState.mouseAdvanceClickState()) || m_mousepos.x != m_prevmousepos.x || m_mousepos.y != m_prevmousepos.y)
{ {
m_prevmousepos = m_mousepos; m_prevmousepos = m_mousepos;
m_mouselastactivity = (int)totalclock; m_mouselastactivity = (int)totalclock;

View file

@ -107,12 +107,6 @@ char CONSTEXPR const g_keyAsciiTableShift[128] = {
}; };
// mouse // mouse
extern vec2_t g_mousePos;
extern vec2_t g_mouseAbs;
extern bool g_mouseGrabbed;
extern bool g_mouseEnabled;
extern bool g_mouseInsideWindow;
extern bool g_mouseLockedToWindow;
// joystick // joystick

View file

@ -1783,8 +1783,8 @@ int32_t handleevents_sdlcommon(SDL_Event *ev)
if (j < 0) if (j < 0)
break; break;
event_t ev = { (ev->button.state == SDL_PRESSED)? EV_KeyDown : EV_KeyUp, 0, j}; event_t evt = { (ev->button.state == SDL_PRESSED)? EV_KeyDown : EV_KeyUp, 0, j};
D_PostEvent(ev); D_PostEvent(&evt);
break; break;
} }
@ -1867,7 +1867,9 @@ int32_t handleevents_sdlcommon(SDL_Event *ev)
// Argh. This is just gross. // Argh. This is just gross.
int scancodetoasciihack(SDL_Event &ev) int scancodetoasciihack(SDL_Event &ev)
{ {
int sc = ev.key.keysym.scancode;
SDL_Keycode keyvalue = ev.key.keysym.sym; SDL_Keycode keyvalue = ev.key.keysym.sym;
int code = keytranslation[sc];
// Modifiers that have to be held down to be effective // Modifiers that have to be held down to be effective
// (excludes KMOD_NUM, for example). // (excludes KMOD_NUM, for example).
static const int MODIFIERS = static const int MODIFIERS =

View file

@ -5,9 +5,13 @@
#include "scancodes.h" #include "scancodes.h"
#include "c_bind.h" #include "c_bind.h"
#include "d_event.h" #include "d_event.h"
#include "osd.h"
extern char appactive;
typedef uint8_t kb_scancode; typedef uint8_t kb_scancode;
typedef struct typedef struct
{ {
const char* key; const char* key;
@ -28,6 +32,14 @@ enum
extern int32_t CONTROL_ButtonFlags[NUMKEYS]; extern int32_t CONTROL_ButtonFlags[NUMKEYS];
extern bool CONTROL_BindsEnabled; extern bool CONTROL_BindsEnabled;
extern vec2_t g_mousePos;
extern vec2_t g_mouseAbs;
extern bool g_mouseGrabbed;
extern bool g_mouseEnabled;
extern bool g_mouseInsideWindow;
extern bool g_mouseLockedToWindow;
// Order is that of EDuke32 by necessity because it exposes the key binds to scripting by index instead of by name. // Order is that of EDuke32 by necessity because it exposes the key binds to scripting by index instead of by name.
enum GameFunction_t enum GameFunction_t
{ {
@ -297,7 +309,7 @@ public:
void keyFlushScans(void) void keyFlushScans(void)
{ {
Bmemset(&g_keyFIFO, 0, sizeof(g_keyFIFO)); memset(&g_keyFIFO, 0, sizeof(g_keyFIFO));
g_keyFIFOpos = g_keyFIFOend = 0; g_keyFIFOpos = g_keyFIFOend = 0;
} }
@ -323,7 +335,7 @@ public:
void keyFlushChars(void) void keyFlushChars(void)
{ {
Bmemset(&g_keyAsciiFIFO, 0, sizeof(g_keyAsciiFIFO)); memset(&g_keyAsciiFIFO, 0, sizeof(g_keyAsciiFIFO));
g_keyAsciiPos = g_keyAsciiEnd = 0; g_keyAsciiPos = g_keyAsciiEnd = 0;
} }
@ -412,9 +424,10 @@ public:
} }
return 0; return 0;
} }
static inline int32_t MouseGetButtons(void) { return mouseReadButtons(); }
static inline void MouseClearButton(int32_t b) { g_mouseBits &= ~b; } int32_t MouseGetButtons(void) { return mouseReadButtons(); }
static inline void MouseClearAllButtonss(void) { g_mouseBits = 0; } inline void MouseClearButton(int32_t b) { g_mouseBits &= ~b; }
inline void MouseClearAllButtonss(void) { g_mouseBits = 0; }
}; };

View file

@ -5708,7 +5708,6 @@ void G_Shutdown(void)
S_SoundShutdown(); S_SoundShutdown();
S_MusicShutdown(); S_MusicShutdown();
CONTROL_Shutdown(); CONTROL_Shutdown();
KB_Shutdown();
engineUnInit(); engineUnInit();
G_Cleanup(); G_Cleanup();
OSD_Cleanup(); OSD_Cleanup();

View file

@ -7060,7 +7060,7 @@ void M_DisplayMenus(void)
m_mousewake_watchpoint = 1; m_mousewake_watchpoint = 1;
#endif #endif
if (MOUSEACTIVECONDITIONAL(mouseAdvanceClickState()) || m_mousepos.x != m_prevmousepos.x || m_mousepos.y != m_prevmousepos.y) if (MOUSEACTIVECONDITIONAL(inputState.mouseAdvanceClickState()) || m_mousepos.x != m_prevmousepos.x || m_mousepos.y != m_prevmousepos.y)
{ {
m_prevmousepos = m_mousepos; m_prevmousepos = m_mousepos;
m_mouselastactivity = (int32_t) totalclock; m_mouselastactivity = (int32_t) totalclock;

View file

@ -78,7 +78,7 @@ void GLInstance::Init()
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glinfo.maxanisotropy); glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &glinfo.maxanisotropy);
if (!glinfo.dumped) if (!glinfo.dumped)
{ {
osdcmd_glinfo(NULL); //osdcmd_glinfo(NULL);
glinfo.dumped = 1; glinfo.dumped = 1;
} }
new(&renderState) PolymostRenderState; // reset to defaults. new(&renderState) PolymostRenderState; // reset to defaults.

View file

@ -7075,7 +7075,6 @@ void G_Shutdown(void)
S_SoundShutdown(); S_SoundShutdown();
S_MusicShutdown(); S_MusicShutdown();
CONTROL_Shutdown(); CONTROL_Shutdown();
KB_Shutdown();
G_SetFog(0); G_SetFog(0);
engineUnInit(); engineUnInit();
G_Cleanup(); G_Cleanup();

View file

@ -7540,7 +7540,7 @@ void M_DisplayMenus(void)
m_mousewake_watchpoint = 1; m_mousewake_watchpoint = 1;
#endif #endif
if (MOUSEACTIVECONDITIONAL(mouseAdvanceClickState()) || m_mousepos.x != m_prevmousepos.x || m_mousepos.y != m_prevmousepos.y) if (MOUSEACTIVECONDITIONAL(inputState.mouseAdvanceClickState()) || m_mousepos.x != m_prevmousepos.x || m_mousepos.y != m_prevmousepos.y)
{ {
m_prevmousepos = m_mousepos; m_prevmousepos = m_mousepos;
m_mouselastactivity = (int32_t) totalclock; m_mouselastactivity = (int32_t) totalclock;

View file

@ -662,10 +662,6 @@ TerminateGame(void)
//TenScreen(); //TenScreen();
} }
////--->>>> sound stuff was there
//uninitkeys();
KB_Shutdown();
engineUnInit(); engineUnInit();
G_SaveConfig(); G_SaveConfig();
@ -774,7 +770,6 @@ void MultiSharewareCheck(void)
//uninitmultiplayers(); //uninitmultiplayers();
//uninitkeys(); //uninitkeys();
G_SaveConfig(); G_SaveConfig();
KB_Shutdown();
engineUnInit(); engineUnInit();
UnInitSound(); UnInitSound();
timerUninit(); timerUninit();