Difference between revisions of "Wintermute/Externals"

Jump to navigation Jump to search
2,549 bytes added ,  15:28, 29 August 2020
no edit summary
Line 68: Line 68:
Returns 1 on success, other value on fail (which leads to Game.QuitGame() in non-Debug mode)
Returns 1 on success, other value on fail (which leads to Game.QuitGame() in non-Debug mode)


== Various games by Corbomite Games ===
== Various games by Corbomite Games ==
=== dlltest.dll ===
=== dlltest.dll ===
==== IRC_init ====
==== IRC_init ====
Line 236: Line 236:


Return value is never used in Zbang scripts
Return value is never used in Zbang scripts
== Stroke of Fate dilogy ==
=== [TODO]routine.dll ===
==== GetDPI ====
Used at CheckFont() function to select font DPI.
Unused, if Game.RegReadNumber("DefaultDPI", 0) is not 0.
Specification: external "routine.dll" cdecl long GetDPI()
Known usage: dpi = GetDPI()
==== GetCaption ====
Used at CheckCaption() function to get window title.
Expects CheckCaption(Game.Hwnd).IndexOf("Wintermute Engine", 0) >= 0
Specification: external "routine.dll" cdecl string GetCaption(long)
Known usage: GetCaption(Game.Hwnd)
==== SetCaption ====
Used at CheckCaption() function to set window title.
Specification: external "routine.dll" cdecl bool SetCaption(long, string)
Known usage: SetCaption(Game.Hwnd, Game.ExpandString("/MAIN_CAPTION3/"))
==== RemoveFile ====
Used at SaveTempScreenShot() & RemoveTempScreenShot() functions to manage screenshot files.
Specification: external "routine.dll" cdecl bool RemoveFile(string)
Known usage: RemoveFile(Directory.TempDirectory + "\tempss.bmp")
Known usage: RemoveFile(Game.SaveDirectory + "\" + newname + ".bmp")
==== RenameFile ====
Used at SaveTempScreenShot() & RemoveTempScreenShot() functions to manage screenshot files.
Specification: external "routine.dll" cdecl bool RenameFile(string, string)
Known usage: RenameFile(Directory.TempDirectory + "\tempss.bmp", Game.SaveDirectory + "\" + newname + ".bmp")
=== [TODO]protect.dll ===
Steam version of Stroke of Fate: Operation Bunker does not have this DLL.
However, game code contain some checks that depend on GetOptions() results.
Specifications:
    external "protect.dll" stdcall long PSA_IsTrialMode(membuffer);
    external "protect.dll" stdcall long PSA_DisableFeaturesGrantedByLicense(membuffer);
    external "protect.dll" stdcall long PSA_GetFeaturesGrantedByLicense(membuffer);
    external "protect.dll" stdcall long PSA_IsDemoMode(membuffer);
    external "protect.dll" stdcall PSA_DummyFunction();
Usage:
    function GetOptions() {
        var p;
        var buf = new MemBuffer(4);
        buf.SetInt(0, 0);
        PSA_GetFeaturesGrantedByLicense(buf);
        p.R1 = (buf.GetInt(0) % 2);
        p.R2 = (((buf.GetInt(0) - p.R1) / 2) % 2);
        p.R3 = (((buf.GetInt(0) - p.R2) / 4) % 2);
        p.R4 = (((buf.GetInt(0) - p.R3) / 8) % 2);
        p.R5 = (((buf.GetInt(0) - p.R4) / 16) % 2);
        buf.SetSize(1);
        buf.SetBool(0, FALSE);
        PSA_IsDemoMode(buf);
        p.D = buf.GetBool(0);
        buf.SetBool(0, FALSE);
        PSA_IsTrialMode(buf);
        p.T = buf.GetBool(0);
        return p;
    }
234

edits

Navigation menu