Avoid query gfxDriver's properties all the time, instead save them once in init_draw_method() and use saved values.
From upstream db535512af65119d50ae3d6fb06c221d56f42d85
Historically, neither Character.z (vertical offset), nor picture offsets (ones set by Character.LockViewAligned() and Character.LockViewOffset())
were not scaled along with the character's sprite.
Although it seems like that would be a right thing to do in a majority of practical applications of these properties.
This change introduces a separate zoom factor for these parameters. It's done separately to be able to maintain backwards compatibility.
In backwards mode this factor is always 100 (%), in the new mode it is always set equal to regular character's zoom (whether got from
a manual property, or a walkable area scaling).
The switch between modes is controlled by OPT_SCALECHAROFFSETS. This supposed to be always set in the new games. But this is also
a backup opportunity to disable this behavior, if a user finds it making it impossible to achieve a previously possible effect: in such case
one may disable this when compiling a game, or call SetGameOption(OPT_SCALECHAROFFSETS, 0) in script.
Code-wise, I had to move get_effective_y() method to CharacterExtras class, which makes more sense, as that's a runtime character class,
as opposed to CharacterInfo which is a game data serialization class, shared with the Editor.
There's still alot of potential for refactor and tidying the code, but I'd leave that for another task.
From upstream a2b0c88379f37fdaf44155e37f372b7de725db21
Separated internal RoomObject's storage values for ANIM_* types into OBJANIM_ constants.
Use common ANIM_* constants in shared code, such as ValidateViewAnimParams() and CycleViewAnim().
The internal storage values of objects, characters and buttons are converted from and to ANIM_ values
as necessary.
Since older commit 5f3b8eb the properties are stored in vectors,
strictly resized to the number of characters and objects.
But the script functions that access these do not do any assertion
whether the object or char is valid, which could cause bad mem
access in case script loops over a array of objects of MAX_OBJECTS
size, or tries to access something using Object* pointer from another room.
From upstream 6ad4b220d75a32ea8df959e9a7b7f1ecb21d0c26
This was broken by eb376e6
1. Treating negative loop and frame as an instruction to keep latest object's
loop and frame values was introduced around AGS 2.70 by Object.SetView(),
but this behavior also propagated to SetObjectFrame() command.
2. Removed clamping of loop and frame values inside Object.SetView(),
as that prevented applying a historical behavior of SetObjectFrame(),
where any invalid loop and frame value would be changed to just 0.
3. Don't quit the game in case of invalid loop and frame, but fallback
to default 0 value, and print a warning.
Also removed some redundant assignments to RoomObject,
possibly a result of a commit merge from another branch.
From upstream 66bb18f0224eebfb2a130395e9b18ce59b584e13
This is the 3.6.1 branch, but the fix is required to solve a game-breaking
bug in Chronicle of Innsmouth
This is because of legacy AnimateObject behavior, which treated IDs >= 100
as a command to run AnimateCharacter(ID - 100) instead.
From upstream 8365802092cd3f704aecffe7d08b4d9f65f1f396
From upstream b628fb4d1b3ca6a85e2b2424a468f4cec94ae9c6
Also includes new implementation of std::vector class to
properly allow for arrays of smart pointers