From 498873bc653a48e63d595bd22687f4eed372dba1 Mon Sep 17 00:00:00 2001 From: hispidence Date: Mon, 2 Aug 2021 12:49:17 +0100 Subject: [PATCH] Remove HandleScriptMessage and associated globals - apparently this is no longer supposed to be here. --- TR5Main/Game/control.cpp | 21 ----------------- TR5Main/Specific/winmain.cpp | 45 ------------------------------------ 2 files changed, 66 deletions(-) diff --git a/TR5Main/Game/control.cpp b/TR5Main/Game/control.cpp index 7e7abf29e..16aa40522 100644 --- a/TR5Main/Game/control.cpp +++ b/TR5Main/Game/control.cpp @@ -186,32 +186,11 @@ extern bool BlockAllInput; extern int skipLoop; extern int skipFrames; extern int lockInput; -extern int newSkipLoop; -extern int newSkipFrames; -extern int newLockInput; -extern bool newSkipFramesValue; -extern bool newSkipLoopValue; -extern bool newLockInputValue; GAME_STATUS ControlPhase(int numFrames, int demoMode) { g_GameScript->OnControlPhase(); short oldLaraFrame; - if (newSkipFramesValue) - { - skipFrames = newSkipFrames; - newSkipFramesValue = false; - } - if (newSkipLoopValue) - { - skipLoop = newSkipLoop; - newSkipLoopValue = false; - } - if (newLockInputValue) - { - lockInput = newLockInput; - newLockInputValue = false; - } GameScriptLevel* level = g_GameFlow->GetLevel(CurrentLevel); diff --git a/TR5Main/Specific/winmain.cpp b/TR5Main/Specific/winmain.cpp index 4efa2cc5e..d32bdd4d0 100644 --- a/TR5Main/Specific/winmain.cpp +++ b/TR5Main/Specific/winmain.cpp @@ -39,12 +39,6 @@ bool BlockAllInput = true; int skipLoop = -1; int skipFrames = 2; int lockInput = 0; -int newSkipLoop = -1; -int newSkipFrames = 2; -int newLockInput = 0; -bool newSkipFramesValue = false; -bool newSkipLoopValue = false; -bool newLockInputValue = false; #if _DEBUG string commit; @@ -95,45 +89,6 @@ void CALLBACK HandleWmCommand(unsigned short wParam) } } -void HandleScriptMessage(WPARAM wParam) -{ - string ErrorMessage; - string message = *(string*)(wParam); - bool status = false; - - //check whether line starts with "lua " - if (message.find("lua ") == 0) { - string scriptSubstring = message.substr(4); - status = g_GameScript->ExecuteScript(scriptSubstring, ErrorMessage); - } - else { - if (message.find("SL=") == 0) - { - string scriptSubstring = message.substr(3); - newSkipLoop = stoi(scriptSubstring); - newSkipLoopValue = true; - } - else if (message.find("SF=") == 0) - { - string scriptSubstring = message.substr(3); - newSkipFrames = stoi(scriptSubstring); - newSkipFramesValue = true; - } - else if (message.find("LI=") == 0) - { - string scriptSubstring = message.substr(3); - newLockInput = stoi(scriptSubstring); - newLockInputValue = true; - } - else - { - status = g_GameScript->ExecuteString(message, ErrorMessage); - } - } - if (!status) - cout << ErrorMessage << endl; -} - LRESULT CALLBACK WinAppProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { // Disables ALT + SPACE