2126 Commits

Author SHA1 Message Date
Thierry Crozat
2808192828 AGS: fixed find_free_audio_channel() incorrect compat fix
From upstream b3f4909.

Fixes a regression from d2b0380 (86564e9 in upstream)  where the extra
channel allowance was added excessively for all cases.

Fixes bug #14353 (crash in unavowed).
2023-03-29 22:02:38 +01:00
Thierry Crozat
332d428db0 AGS: Add detection for newer Steam Mac versions of Unavowed and The Excavation of Hob's Barrow 2023-03-29 20:55:41 +01:00
Thierry Crozat
42838612d2 AGS: Fix double-free of room cameras surfaces
This fixes a crash in Dreams in a Witch House (bug #14338)
2023-03-27 01:01:55 +01:00
Walter Agazzi
ea4df6f04c AGS: Add detection for a few old versions 2023-03-24 15:17:48 +01:00
Walter Agazzi
baab2ecb56 AGS: Add Dreams in the Witch House 1.05 GOG 2023-03-24 14:30:22 +01:00
Walter Agazzi
bd6acf7efc AGS: Fix two entries requiring punycode 2023-03-24 13:58:44 +01:00
antoniou79
10a5566dab AGS: Fix formatting of debug message
About bad index of audio channel
2023-03-23 13:53:04 +02:00
Walter Agazzi
1c89af1757 AGS: Add a few games/versions
From TRAC reports
2023-03-21 18:30:26 +01:00
marius david
9acaed1f89 AGS: auto-detect Linux games based on executable
ags64 (and also ags32) are the name of the engine executable on Linux.
These names seems to be exclusivelly used for that OS.
Fix a bug in Zniw Adventure (GOG, Linux) due to translation path being
different between Linux and Windows.
2023-03-20 00:17:20 +01:00
Walter Agazzi
8175117a71 AGS: Add detection for two games
Dreams Witch House 1.04 / Rosewater Demo
2023-03-18 23:16:11 +01:00
Vladimir Serbinenko
af3f37afa8 AGS: Add Russian Black Cauldron remake 2023-03-13 15:19:42 +01:00
Walter Agazzi
fd7f0544ff AGS: Add detection for two new versions
From TRAC #14320-1
2023-03-13 12:50:41 +01:00
D G Turner
be309e97eb AGS: Fix GCC Compiler Warnings 2023-03-12 20:58:29 +00:00
Walter Agazzi
bdec317f27 AGS: Updated build version (3.6.0.41)
Partially from upstream 81b5fbc917d83a02cebc152969fd769b2b7b9b15
2023-03-12 20:58:29 +00:00
Walter Agazzi
07bbbcd233 AGS: Engine: replaced couple more shared_ptr<char> with vector<char>
From upstream 1cccdfea5c1009123de7ba25be72b2757f74d06f
2023-03-12 20:58:28 +00:00
Walter Agazzi
9a4817653c AGS: Engine: resizable flag is necessary for fullscreen app rotation
From upstream 51a7e64efd628e62c73b1b1b8011d22ec83b0c38
2023-03-12 20:58:28 +00:00
Walter Agazzi
15d43b09ad AGS: Common: add AGS_PLATFORM_MOBILE for Android and iOS
Partially from upstream 4404881c6a49e3a74f316998ee46368b00895fc7
2023-03-12 20:58:28 +00:00
Walter Agazzi
9743b0dd6c AGS: Engine: restored GUI draw sort, where equal z is resolved with IDs
NOTE: the code theoretically allows any object to be sorted this
way, but the problem is, the ID sequences are not shared, and
multiple object types may have same IDs.
This is something to consider in the future.
2023-03-12 20:58:28 +00:00
Walter Agazzi
953356c758 AGS: Common: call OnMouseLeave on focused control in ResetOverControl()
From upstream b8de51fedf0318e8243e1fc3872c61f366a23144
2023-03-12 20:58:28 +00:00
Walter Agazzi
9a469f1e2b AGS: Engine: support fixing up RoomStatuses restored from older save formats
This allows to properly fixup (upgrade) RoomStatus structs
restored from a older format save in an upgraded game.
For example: game was upgraded from 3.4.0 to 3.6.0, but player
tries loading 3.4.0 save. In this situation the engine must know and
keep track of what version each RoomStatus was saved in.
This is necessary, because RoomStatus can only be updated upon
loading a corresponding room file (when entering a room). This
means that multiple RoomStatus objects will be staying in memory
not being upgraded yet, until player enters particular room.

From upstream 205232af5909e0a257494ff404f36003b004ebc4
2023-03-12 20:58:28 +00:00
Walter Agazzi
2daaef2d48 AGS: Engine: updated SavegameVersion (had few cmp changes since last one)
From upstream 84417e8c73815bcd35f4a6812d6f118cfb3acacb
2023-03-12 20:58:28 +00:00
Walter Agazzi
89ea094df1 AGS: Engine: fixed idle_anim_speed after restoring old save in updated game
From upstream 0f19fc3d2b9efbc4eb809032bcb7d60b652e1150
2023-03-12 20:58:28 +00:00
Walter Agazzi
3d91a8835e AGS: Engine: fixed button keeps "mouse over" pic after Visible = false
From upstream dcec61ba9825be21a0d2009a73b2af24df6a912d
2023-03-12 20:58:28 +00:00
Walter Agazzi
50d8eaddcf AGS: Engine: in IAGSEngine::SetVirtualScreen set Stage buffer, not whole VS
When plugin calls SetVirtualScreen (for software renderer), don't
replace whole virtual screen, instead replace only the current
render stage buffer.
This is complementary to the older changes in software renderer,
made during development of AGS 3.5.0, which featured advanced
room viewports and cameras. Since that change, separate render
stages could draw on sub-bitmaps of smaller size.

While IAGSEngine::GetVirtualScreen() was adjusted to follow that
change, and return not the whole virtual screen, but only a "stage
buffer" (which may be a VS sub-bitmap, or an intermediate bitmap
created specifically for this render stage), SetVirtualScreen() was
NOT adjusted accordingly and kept replacing whole VS. As a
result, this discrepancy could cause logical errors, as well as
crashes with plugins that use this API (e.g. original SnowRain
plugin).

The immediate reason of error is that plugin would remember a
pointer returned from GetVirtualScreen (which is a stage buffer),
and then try to set it back with SetVirtualScreen. As a result,
engine's own stage buffer is assigned as a full virtual screen.

From upstream 09143ea7fbf8474f78932116ae1c81ceff4de95a
2023-03-12 20:58:28 +00:00
Walter Agazzi
43723e170a AGS: Engine: in SetMemoryBackBuffer() don't reset batch surfs during render
In ALSoftwareGraphicsDriver:
* Save index of a currently rendered sprite batch (or none, if not inside
a render pass).
* In SetMemoryBackBuffer() don't reset virtual screen subbitmaps
  unless we are outside render pass.
* In InitSpriteBatch() also test if batch's surface is subbitmap to the
  current virtual screen (in case one was replaced, but batch's surface
  stayed).

Partially from upstream 5dd078961020da6478347dac01dea729471333d1
2023-03-12 20:58:28 +00:00
Walter Agazzi
e62a2c3504 AGS: Engine: don't reset batch surfaces in software driver's ResetAllBatches
From upstream 662318d0dc1e877a334e91b1a964a41de2b46573
2023-03-12 20:58:28 +00:00
Walter Agazzi
5b7f95075e AGS: Engine: removed unused global var
From upstream b2dc19eef19f1498e4510de5672cb65c281d33d4
2023-03-12 20:58:28 +00:00
Walter Agazzi
1bc1c49dbf AGS: Engine: fixed missing channels after restoring old save in updated game
From upstream d5ded80f8219b1f04e484c369d647bbc9ed8edd8
2023-03-12 20:58:28 +00:00
Walter Agazzi
f0c18ccacb AGS: Engine: fixed GUI sorting for cases when ZOrder is equal
Was broken by fcc873e
From upstream ff210b2ce50cea0e903cd1d09fa7ad1734a862b0
2023-03-12 20:58:28 +00:00
Walter Agazzi
26c2a748de AGS: Alfont: fix leak, release before freeing last reference
From upstream 43c5560bd6d2f28a31ec402081c7fa7c5bbf78de
2023-03-12 20:58:28 +00:00
Walter Agazzi
7b5bcb881a AGS: Engine: fail when reading game data should return error
From upstream 416c456db0b20f5896506f86525faec0a353893f
2023-03-12 20:58:28 +00:00
Walter Agazzi
0f90b07118 AGS: Common: also assert in GetScanLineForWriting()
From upstream 872598fea699341c7de82484b43678d91dcc425e
2023-03-12 20:58:28 +00:00
Walter Agazzi
da88b81fdf AGS: SnowRain: do not override user-set baselines
Reimplemented from upstream a01f58a826e56746b3fc5e503bebb3f3dcbcf884
2023-03-12 20:58:28 +00:00
Walter Agazzi
88a1083e0d AGS: Move strlen out of loops
From upstream b476dfca4b40bc2ca59b7f0fd793543524397ccf
2023-03-12 20:58:28 +00:00
Walter Agazzi
b3a7b2e8de AGS: Updated build version (3.6.0.40) and copyright year to 2023
Partially from upstream bacd73914fbad9d48c5390de16c545bf82acd669
2023-03-12 20:58:28 +00:00
Walter Agazzi
c6864a8a67 AGS: Engine: added _rendSpriteBatch counter to software renderer
From upstream 5d051d614cafe2a4f73cc4399eeb78cb38d8ed2d
2023-03-12 20:58:28 +00:00
Walter Agazzi
1e3bb9c241 AGS: Engine: support optional size and position for gfxdriver's stage screen
This is primarily for backwards compatibility with the older plugins,
that relied only on software drawing.

Previously we added "stage screens" to the hardware-accelerated
graphic drivers (Direct3D/OpenGL), which provide a surface for
plugins to draw upon. If used, these surfaces would then be rendered
as plain sprites in 3D scene at certain place in the sprite sequence.

The remaining problem (left unnoticed) was that the surfaces which
correspond to the two room render callbacks (right after background,
and right after all objects) did not follow the room camera position and
scaling correctly (not all, tbh). This commit addresses these problems by
letting the engine to request certain size and optional position for these
"stage screens" for particular sprite batches.

Partially from upstream 2d43bffc2cb07935ae72d7c5677ad622c8b4d37e
2023-03-12 20:58:28 +00:00
Walter Agazzi
823eda7991 AGS: Engine: renamed "NullSpriteCallback", give more meaningful name
From upstream e3c6f5f0b607b8d3a747fa56bdac723ff833f482
2023-03-12 20:58:28 +00:00
Walter Agazzi
491f59d3fe AGS: Plugin: fix pal_render logic mistakes
From upstream 91ecc267e8ab607e0948416c82433da6f7802dde
2023-03-12 20:58:28 +00:00
Walter Agazzi
cd43ec26ed AGS: Common: wrong clamping in memory stream
From upstream 020189c4c3e8be9c68fb9f6c0896c7d3506d1113
2023-03-12 20:58:28 +00:00
Walter Agazzi
6343759e09 AGS: Engine: changed member names in StageScreen to avoid conflicts
From upstream 874953aea46a23f2ea49ee571cbce28fdc701f25
2023-03-12 20:58:28 +00:00
Walter Agazzi
982abc24f3 AGS: Engine: create raw draw screens only on plugin's demand
This significantly reduces memory usage, as screens will be only
created for sprite batches, during which the plugin requested
memory backbuffer for drawing.
Partially from upstream 1b71780d6e94eca33ee3234fd138213874640ab1
2023-03-12 20:58:28 +00:00
Walter Agazzi
711ca20dd1 AGS: Engine: abort in case failed both to switch and restore gfx mode
This may be a temporary solution, but it's necessary, because otherwise
engine will fail later, with a seemingly unrelated error, which will
be harder to diagnose.
From upstream 902568c4eba9dba4eb762882890c6e8a308683aa
2023-03-12 20:58:28 +00:00
Walter Agazzi
f0887a3b9f AGS: Engine: in gfx drivers record sprite range for each batch
Partially from upstream eaa806927bf4608195fe58de405750836093032c
2023-03-12 20:58:28 +00:00
Walter Agazzi
b828199c25 AGS: Engine: renderers support creating DDB as a render target
Partially from upstream 4c8218e9ca4da7403ff14e45c57584517d2abc2f
2023-03-12 20:58:28 +00:00
Walter Agazzi
af16689b2b AGS: Plugin: SnowRain adjust height/baseline before entering room
From upstream 1e3a66df0e3bc0f7bbb743a5fec4b2966ea9df66
2023-03-12 20:58:28 +00:00
Walter Agazzi
48592b9eee AGS: Engine: add screen functions to plugin exports
Reimplemented from upstream 5497c87cc1443d155bd89a76dddf91934b7e0bb5
2023-03-12 20:58:28 +00:00
Walter Agazzi
5a2405d291 AGS: Engine: debug use AppendFmt at send msg and clang-tidy fixes
From upstream 96f0b3d5e216fbba6df3cb47df3d28687b4dd5e4
2023-03-12 20:58:28 +00:00
Walter Agazzi
d563f6dec9 AGS: Updated build version (3.6.0.39)
From upstream ae3dd50f4693988906eff9d8872965756a3bc869
2023-03-12 20:58:28 +00:00
Walter Agazzi
97d08215b5 AGS: Engine: Use a single function to send messages to editor debugger
From upstream 003243d6c925d176d6e206bed7c1c930952ba2da
2023-03-12 20:58:28 +00:00