- Added a vmengine console command to switch the VM engine at runtime.

SVN r2164 (scripting)
This commit is contained in:
Randy Heit 2010-02-14 20:16:05 +00:00
parent 6f1bf257e9
commit 873ece3d55
2 changed files with 37 additions and 0 deletions

View File

@ -923,3 +923,31 @@ CCMD(nextsecret)
Printf("no next secret map!\n"); Printf("no next secret map!\n");
} }
} }
//-----------------------------------------------------------------------------
//
//
//
//-----------------------------------------------------------------------------
CCMD(vmengine)
{
if (argv.argc() == 2)
{
if (stricmp(argv[1], "default") == 0)
{
VMSelectEngine(VMEngine_Default);
return;
}
else if (stricmp(argv[1], "checked") == 0)
{
VMSelectEngine(VMEngine_Checked);
return;
}
else if (stricmp(argv[1], "unchecked") == 0)
{
VMSelectEngine(VMEngine_Unchecked);
return;
}
}
Printf("Usage: vmengine <default|checked|unchecked>\n");
}

View File

@ -114,6 +114,15 @@ VMExec_Checked::Exec
#endif #endif
; ;
//===========================================================================
//
// VMSelectEngine
//
// Selects the VM engine, either checked or unchecked. Default will decide
// based on the NDEBUG preprocessor definition.
//
//===========================================================================
void VMSelectEngine(EVMEngine engine) void VMSelectEngine(EVMEngine engine)
{ {
switch (engine) switch (engine)