Permalink
Browse files

WINTERMUTE: Add FoxTail screen methods

FoxTail use 2x, 3x, 4x, etc so-called "screen modes", that are switched between in Options menu.
Current implementation makes FoxTail no choice but to think that 2x is the only option avaliable, since we don't want game to mess with actual render filter settings.
  • Loading branch information...
lolbot-iichan committed Aug 26, 2018
1 parent b0ace07 commit 0806ffdf5ef487e04021b762ab0aa90ba546ad29
Showing with 80 additions and 0 deletions.
  1. +80 −0 engines/wintermute/base/base_game.cpp
@@ -1967,6 +1967,86 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
return STATUS_OK;
}

#ifdef ENABLE_FOXTAIL
//////////////////////////////////////////////////////////////////////////
// [FoxTail] GetScreenType
// Returns 0 on fullscreen and 1 on window
// Used to init and update controls at options.script and methods.script
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetScreenType") == 0) {
stack->correctParams(0);
int type = !g_system->getFeatureState(OSystem::kFeatureFullscreenMode);
stack->pushInt(type);

return STATUS_OK;
}

//////////////////////////////////////////////////////////////////////////
// [FoxTail] GetScreenMode
// Returns integer to be used as a pixelization mode multiplier
// Used to init and update controls at options.script and methods.script
// This implementation fakes window size as 2*320 x 2*240
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetScreenMode") == 0) {
stack->correctParams(0);
stack->pushInt(2);

return STATUS_OK;
}

//////////////////////////////////////////////////////////////////////////
// [FoxTail] GetDesktopDisplayMode
// Returns struct with "w" and "h" fields of desktop size
// Used to init and update controls at options.script and methods.script
// Avaliable screen modes are calcucated as 2...N, N*320<w and N*240<h
// This implementation fakes avaliable size as 2*320 x 2*240 only
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetDesktopDisplayMode") == 0) {
stack->correctParams(0);
stack->pushInt(2*240+1);
stack->pushInt(2*320+1);
stack->pushInt(0);
BaseScriptable* obj = makeSXObject(_gameRef, stack);
obj->scSetProperty("w", stack->pop());
obj->scSetProperty("h", stack->pop());
stack->pushNative(obj, false);

return STATUS_OK;
}

//////////////////////////////////////////////////////////////////////////
// [FoxTail] SetScreenTypeMode
// This implementation ignores mode, toggles screen type only
// Used to change screen type&mode at options.script and methods.script
// Return value is never used
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetScreenTypeMode") == 0) {
stack->correctParams(2);
int type = stack->pop()->getInt();
stack->pop()->getInt(); //mode is unused
g_system->beginGFXTransaction();
g_system->setFeatureState(OSystem::kFeatureFullscreenMode, !type);
g_system->endGFXTransaction();
stack->pushNULL();

return STATUS_OK;
}

//////////////////////////////////////////////////////////////////////////
// [FoxTail] ChangeWindowGrab
// Used at game.script on "Keypress" event on F11
// Readme of FoxTail says: "F11 - free the mouse pointer from the window"
// This implementation does nothing
// Return value is never used
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "ChangeWindowGrab") == 0) {
stack->correctParams(0);
stack->pushNULL();

return STATUS_OK;
}
#endif

//////////////////////////////////////////////////////////////////////////
// ShowStatusLine
//////////////////////////////////////////////////////////////////////////

0 comments on commit 0806ffd

Please sign in to comment.