mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-02-20 11:03:09 +00:00
- Moved debugger intialistion after GameDll load
- DebuggerServer will not intialize when the additional function FT_UpdateDebugger is not set
This commit is contained in:
parent
61019b97ff
commit
784f1d567c
3 changed files with 16 additions and 9 deletions
|
@ -116,6 +116,8 @@ volatile int com_ticNumber; // 60 hz tics
|
|||
int com_editors; // currently opened editor(s)
|
||||
bool com_editorActive; // true if an editor has focus
|
||||
|
||||
bool com_debuggerSupported = false; // only set to true when the updateDebugger function is set. see GetAdditionalFunction()
|
||||
|
||||
#ifdef _WIN32
|
||||
HWND com_hwndMsg = NULL;
|
||||
bool com_outputMsg = false;
|
||||
|
@ -3181,15 +3183,15 @@ void idCommonLocal::InitGame( void ) {
|
|||
// initialize the user interfaces
|
||||
uiManager->Init();
|
||||
|
||||
// startup the script debugger
|
||||
if ( com_enableDebuggerServer.GetBool( ) )
|
||||
DebuggerServerInit();
|
||||
|
||||
PrintLoadingMessage( common->GetLanguageDict()->GetString( "#str_04350" ) );
|
||||
|
||||
// load the game dll
|
||||
LoadGameDLL();
|
||||
|
||||
// startup the script debugger
|
||||
if ( com_enableDebuggerServer.GetBool( ) )
|
||||
DebuggerServerInit( );
|
||||
|
||||
PrintLoadingMessage( common->GetLanguageDict()->GetString( "#str_04351" ) );
|
||||
|
||||
// init the session
|
||||
|
@ -3313,6 +3315,7 @@ bool idCommonLocal::GetAdditionalFunction(idCommon::FunctionType ft, idCommon::F
|
|||
Warning("Called idCommon::GetAdditionalFunction() with out_fnptr == NULL!\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
switch(ft)
|
||||
{
|
||||
case idCommon::FT_IsDemo:
|
||||
|
@ -3322,7 +3325,7 @@ bool idCommonLocal::GetAdditionalFunction(idCommon::FunctionType ft, idCommon::F
|
|||
|
||||
case idCommon::FT_UpdateDebugger:
|
||||
*out_fnptr = (idCommon::FunctionPointer)updateDebugger;
|
||||
|
||||
com_debuggerSupported = true;
|
||||
return true;
|
||||
|
||||
default:
|
||||
|
|
|
@ -87,6 +87,8 @@ extern volatile int com_ticNumber; // 60 hz tics, incremented by async functio
|
|||
extern int com_editors; // current active editor(s)
|
||||
extern bool com_editorActive; // true if an editor has focus
|
||||
|
||||
extern bool com_debuggerSupported; // only set to true when the updateDebugger function is set. see GetAdditionalFunction()
|
||||
|
||||
#ifdef _WIN32
|
||||
const char DMAP_MSGID[] = "DMAPOutput";
|
||||
const char DMAP_DONE[] = "DMAPDone";
|
||||
|
@ -271,10 +273,6 @@ public:
|
|||
// it returns true if we're currently running the doom3 demo
|
||||
// not relevant for mods, only for game/ aka base.dll/base.so/...
|
||||
FT_IsDemo = 1,
|
||||
// the function's signature is bool fn(void) - no arguments.
|
||||
// it returns true if the game debugger is active
|
||||
// relevant for mods.
|
||||
FT_DebuggerActive,
|
||||
// the function's signature is bool fn(idInterpreter,idProgram,int) with arguments:
|
||||
// idInterpreter *interpreter, idProgram *program, int instructionPointer
|
||||
// it returns true if the game debugger is active.
|
||||
|
|
|
@ -149,6 +149,12 @@ bool DebuggerServerInit ( void )
|
|||
{
|
||||
com_enableDebuggerServer.ClearModified( );
|
||||
|
||||
if ( !com_debuggerSupported )
|
||||
{
|
||||
common->Warning( "Called DebuggerServerInit() without the gameDLL supporting it!\n" );
|
||||
return false;
|
||||
}
|
||||
|
||||
// Dont do this if we are in the debugger already
|
||||
if ( gDebuggerServer != NULL
|
||||
|| ( com_editors & EDITOR_DEBUGGER ) )
|
||||
|
|
Loading…
Reference in a new issue