Commit graph

29 commits

Author SHA1 Message Date
Walter Agazzi
5d58384af2 AGS: remove "supersampling" setting, as not entirely supported
This setting comes from the original mobile port of AGS, but it's not clear whether it was
useful. More importantly, there are issues with this:
1. It was never implemented in another hardware accelerated driver (Direct3D), being
exclusive to OpenGL.
2. It was never added to standard setup, so not very visible.
3. It's not clear whether it was working properly all this time. There were multiple changes to graphic renderers, and some of them may assume that rendering at "native resolution" is done at exactly, well, native resolution.
2024-10-30 18:07:42 +02:00
Walter Agazzi
7a0876b6b0 AGS: Engine: in CopyScreenIntoBitmap support src rect for legacy letterbox
Partially From upstream 6c028465648be5afe20eef34f0e5d0955329d3dd
2024-10-30 18:07:42 +02:00
Walter Agazzi
49af109669 AGS: Engine: implemented a method of skipping sprite batches on screenshot
This is meant to skip certain groups of sprites when taking a "screenshot",
 for instance when preparing a frozen game screen for the room transition
  (fade-out etc).
Think of hiding mouse cursor and engine overlay (fps counter etc).
Partially from upstream b0cd961483dcee8ffff7543c429fcd3272b413d5
2024-10-30 18:07:42 +02:00
Walter Agazzi
b498b14ecc AGS: Engine: save global draw method args in DrawState struct
Avoid query gfxDriver's properties all the time, instead save them once in init_draw_method() and use saved values.

From upstream db535512af65119d50ae3d6fb06c221d56f42d85
2024-10-30 18:07:42 +02:00
Walter Agazzi
a3d471074f AGS: Engine: Engine: query gfxdriver for texture mem, and optionally restrict cache 2024-10-30 18:07:42 +02:00
Walter Agazzi
65237c4ae8 AGS: Engine: in GraphicsDriver made alpha & opaque params consistent
Partially from upstream b10108614a82622de15bb835d65597947952f0d9
2024-10-30 18:07:42 +02:00
Walter Agazzi
e8248f3a46 AGS: Engine: mark transition screenshot screen as opaque texture
This is a minor perf optimization.
+ added couple of TODO comments.
From upstream 33a7a29d35f53bf0d389eb69f85bbb68bd172dd3
2024-10-30 18:07:42 +02:00
Hubert Maier
27deb1a128 JANITORIAL: Fix accomodating typo in graphics_driver.h 2024-07-15 20:50:41 +03:00
Le Philousophe
49b4c1b3c4 AGS: Revert to use std namespace
This allows to minimize changes from upstream
2024-07-08 21:37:28 +02:00
Paul Gilbert
c2a476411c AGS: Move std namespace into common/std/ 2024-07-07 15:28:31 -07:00
Walter Agazzi
b395603107 AGS: Engine: print which gfx driver is set to the log
Partially from upstream f58f9634422ae28f54d1fd9dc6112c62ad283597
2024-01-17 03:12:28 +01:00
Walter Agazzi
2db380f1d1 AGS: Engine: save vsync property when the result is known
From upstream 178a25b4384c3c96998fc6750a3bc0b4ebda3e5d
2023-04-29 13:11:41 +02: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
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
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
2359c13d23 AGS: Engine: moved global sprite offset & flip to the parent batch transform
Partially from upstream 76a2a22ebfd5a8513337a64d6d4e857295ee38bc
2023-03-12 20:58:28 +00:00
Thierry Crozat
e9c84767f7 AGS: Merged BitmapFlip with engine's GlobalFlipType (same values)
From upstream a747deafe67d536b6bcaf408077ca83f6e61a33d
2022-06-24 20:54:47 +01:00
Thierry Crozat
db1d5b17cd AGS: Tidy vsync setting methods in renderers
From upstream 5ff955152c43f6adfe03298a7cac069efffbee4d
2022-06-21 23:28:01 +01:00
Thierry Crozat
aecb62429d AGS: Update shared texture when dynamic sprite changes
From upstream 6be0e6d094e70e96d93a9ee4dd31ca166663eeaf
2022-06-13 00:30:21 +01:00
Thierry Crozat
487a58b3a8 AGS: Implements short-term texture cache in graphic renderers
- caches textures while they are in the immediate use;
- this lets to share same texture data among multiple sprites on screen.
- texture entries are identified by an arbitrary uint32 number.

From upstream 6f3f84e049df2f800aa4b06d221a393d904c2826
2022-06-13 00:30:21 +01:00
Paul Gilbert
8b027e0d82 AGS: Support sprite batch's alpha
From upstream 190897b97c8959954fea3f3561923e1b1c73a2b6
2022-05-01 17:23:23 -07:00
Paul Gilbert
2b96f0ff67 AGS: Sprite batches may have parents
From upstream 369b3985400284df53695cee4d3f8f2dfc138beb
2022-05-01 17:23:20 -07:00
Paul Gilbert
f009829e67 AGS: Further unifying VideoPlayer code in the base class
From upstream 6c6507e0427bbb8783616691affea83fdcaf10ef
2022-04-12 22:27:57 -07:00
Paul Gilbert
27ad60df72 AGS: Unify video flags in VideoPlayer, convert in script functions
From upstream e5c8293a8c8350c38a8df338f56e3806fdc4f119
Plus changes to local video player implementation to reflect changes
2022-04-12 22:27:56 -07:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Paul Gilbert
12b9c52fba AGS: IGraphicsDriver must also know native game color depth
From upstream 0f9392acc1dd71b9b849af0eefbccdd92be12b30
2021-07-31 14:34:09 -07:00
Paul Gilbert
cf3cc50981 AGS: Remove global macro from some strings and comments 2021-07-12 20:05:28 -07:00
Paul Gilbert
701396361c AGS: Import of fresh codebase 2021-06-13 21:08:44 -07:00
Renamed from engines/ags/engine/gfx/graphicsdriver.h (Browse further)