Add autosave
This commit is contained in:
@@ -33,6 +33,7 @@ static void HandleGamepadAxisInput(int gamepad_id, int axis, int value);
|
||||
static int RemapSdlButton(int button);
|
||||
static void HandleGamepadInput(int button, bool pressed);
|
||||
static void HandleInput(int keyCode, int keyMod, bool pressed);
|
||||
static void HandleCommand(uint32 j, bool pressed);
|
||||
void OpenGLRenderer_Create(struct RendererFuncs *funcs);
|
||||
|
||||
bool g_debug_flag;
|
||||
@@ -525,9 +526,11 @@ int main(int argc, char** argv) {
|
||||
lastTick = curTick;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (g_config.autosave)
|
||||
HandleCommand(kKeys_Save + 0, true);
|
||||
|
||||
// clean sdl
|
||||
SDL_PauseAudioDevice(g_audio_device, 1);
|
||||
SDL_CloseAudioDevice(g_audio_device);
|
||||
@@ -587,8 +590,6 @@ static void RenderNumber(uint8 *dst, size_t pitch, int n, uint8 big) {
|
||||
RenderDigit(dst + (i << big), pitch, *s - '0', 0xffffff, big);
|
||||
}
|
||||
|
||||
static void HandleCommand_Locked(uint32 j, bool pressed);
|
||||
|
||||
static void HandleCommand(uint32 j, bool pressed) {
|
||||
if (j <= kKeys_Controls_Last) {
|
||||
static const uint8 kKbdRemap[] = { 0, 4, 5, 6, 7, 2, 3, 8, 0, 9, 1, 10, 11 };
|
||||
|
||||
Reference in New Issue
Block a user