- reduce backend's dependency on game state by using callbacks.

This commit is contained in:
Christoph Oelckers 2020-04-11 18:22:21 +02:00
commit 56f2b2ac56
29 changed files with 289 additions and 276 deletions

View file

@ -0,0 +1,3 @@
#include "i_interface.h"
SystemCallbacks *sysCallbacks;

View file

@ -0,0 +1,13 @@
#pragma once
struct SystemCallbacks
{
bool (*WantGuiCapture)();
bool (*WantLeftButton)();
bool (*NetGame)();
bool (*WantNativeMouse)();
bool (*CaptureModeInGame)();
};
extern SystemCallbacks *sysCallbacks;

View file

@ -71,6 +71,7 @@ void PaletteContainer::SetPalette(const uint8_t* colors, int transparent_index)
Remap[i] = i;
}
uniqueRemaps[0]->MakeIdentity(); // update the identity remap.
if (transparent_index >= 0 && transparent_index <= 255)