This log() function was previously unimplemented in ScummVM. Its
purpose is to write log messages and some metadata about the game state
to a file.
This functionality does not affect game play. Presumably Sierra used
this to beta test their games. They would log the words that their
testers used but the game did not understand. The testers would
then submit the log file back to Sierra. Sierra would add the missing
words or descriptions to their games before release.
This is the first diff of a couple which will incrementally add this
functionality. In this diff, we just collect the information we need to
generate a log message close to what AGI actually did.
There are two notable differences which will be fixed in future diffs:
(See the comments in the code for more details.)
1. No message formatting.
2. We log to the console only.
For context, I'm currently writing an AGI game and would like to
collect this output from my friends and family, which is why I'm
implementing this functionality today.
This render stage overlays the room with objects and characters, but
stays within room transform, therefore will work with non-standard
viewport positions and multiple cameras.
The next closest stage is AGSE_PREGUIDRAW, which is rendered outside
room viewport. The new one fills the missing stage, lacking after the
viewport/camera update in 3.5.0.
From upstream 4ff7e14400ab81693fb64195d9ada70e979647ac
This may result in object texture not updating if the old sprite was deleted but a new dynamic sprite was created right after having same ID.
Was broken by upstream 9dffb04 in 3.5.1, and also some later changes in 3.6.0.
From upstream 7ed51861898d864902b0f61b0cb7d0acadef1fe3
This allows to fully pack InputType, KeyMod and KeyCode/MouseButton/etc in a int32:
- 8 bits (0xFF) - input type
- 8 bits (0xFF) - key mod flags
- 4 bits (0xF) - reserved (potentially for expanding mod flags, if that will be necessary)
- 12 bits (0xFFF) - KeyCode, mouse codes, gamepad buttons, etc.
Purpose:
1. Potentially allow to set keycodes + mods in an integer and assign to an integer variable/property, such as "skip key", instead of using existing "combo keys"
2. In fact, with InputType flags, this makes it possible to assign a mouse or gamepad button to the same variables.
3. Potentially allow to return keycode + mods from Wait* (currently returns only single key).
From upstream 0203e8feb73b96c501ac2439aa3fe3d6c182c8f4
* Changed from -1 - based constants to 0 - based constants;
* These were purely internal values, therefore no API would be harmed;
* Removed necessity of converting from internal mouse button code to script and back all the time;
* On a side note, this fixes a bug where WaitMouse etc were returning incorrect values on mouse skip, because we forgot to convert from internal to script code.
From upstream 471098d239b076c494beb2d554572ccb69372667
This may lead to unexpected effects when resources are not fully preloaded yet, but a Slider's "UpdateMetrics" was called.
From upstream 5654fb52a64904a6b0cdcec674224f7a0d91a8eb
This could make a new sprite look differently, depending on placeholder's (sprite 0) settings, until the game is saved once.
From upstream f2a922a9cefd40337502bde734503605a76550db
Sprite Cache and Managed Objects produce a lot of entries in the log currently.
They use a macro to set if they should be on or not, but this macro may be set =0, with the intent of disabling.
Let's instead use #if when testing these macros.
Additionally
- only define DEBUG_MANAGED_OBJECTS if AGS_DEBUG_MANAGED_OBJECTS is true
- adds a new command line flag AGS_DEBUG_SPRITECACHE, which will only define DEBUG_SPRITECACHE if true
- guard indefinition through core/platform.h
From upstream e8bd58da2e09d844068dc087f1da153a693b7aa8
Works around script bugs in the original game that often accidentally
worked because of the time it took the original interpreter to load and
begin playing a sound.
Fixes bugs #10224, #10231, #10232, #10237, #10238