Commit Graph
44 Commits
Author SHA1 Message Date
Matthew Jimenez 77ee5a9007 IMAGE: Get palette class by reference on image decoders 2025-04-12 15:47:17 +03:00
Scott Percival 7ac5047bc7 DIRECTOR: Move _mainArchive handle to DirectorEngine
_mainHandle is a pointer to the projector archive, and is set once at
the start of execution. DirectorEngine is a better place for it rather
than the first Window, as other Windows might try and access it.

Fixes crash when changing the cursor in Microphone Fiend.
2025-03-25 12:17:34 +08:00
Cameron Cawley 8d9614ccd5 GRAPHICS: MACGUI: Extend the font ID enum 2024-12-09 23:24:23 +02:00
Cameron Cawley ff530edcb1 GRAPHICS: Deprecate ManagedSurface methods that implicitly copy pixel data 2024-07-02 13:31:18 +01:00
Scott Percival df0ccad5dc DIRECTOR: Add buffer for injecting input events
Forces UnitTest to wait for the engine's event processing pipeline to
run after injecting events.
2024-05-12 22:00:19 +02:00
Le Philousophe cf3eac29c3 DIRECTOR: Migrate engine to Path 2023-12-24 13:19:25 +01:00
sluicebox 55c161140c DIRECTOR: Fix memory leak in font test. PVS-Studio V773 2023-10-30 11:28:14 -07:00
Eugene Sandulenko 9c0eb812d0 DIRECTOR: Added test for parsing Cue Sheets 2023-10-12 23:54:48 +02:00
Le Philousophe 5bdd9e6f50 ALL: Unify zlib and gzio API
zlib is used when available and falls back on gzio.
This allows performance improvements as our CRC32 and gzio
implementations are slower than base zlib.
As zlib is available when libpng is present, this is sensible to
benefit from it.
2023-08-28 21:49:03 +02:00
Eugene Sandulenko 8bccc12786 DIRECTOR: Reduce header dependency 2023-08-02 21:05:06 +02:00
Scott Percival 17e1853347 DIRECTOR: Refactor path detection
Previously, paths were verified by pathMakeRelative().
This method had several drawbacks; the code was increasingly ad-hoc
and recursive, and the function would return a Common::String that
was not guaranteed to be distinct. 90% of the time the path would need
to be converted to Common::Path so that file streams could use it.

This code has been replaced with findPath(), a function which takes a
path string as recieved from Director (e.g. a Lingo script, a filename
stored in a CastInfo record) and returns a Common::Path object for the
file on the local system. The inner workings have been split into subfunctions,
which should make it easier to add workarounds and fuzz at the correct
layer.
2023-07-08 22:01:00 +03:00
Eugene Sandulenko 95d8cf840c DIRECTOR: _allOpenResFiles -> _allSeenResFiles 2023-06-29 23:22:54 +02:00
Eugene Sandulenko 7baba61852 DIRECTOR: Modernized rest of the loops 2023-06-29 23:22:38 +02:00
Scott Percival 871c1d0907 DIRECTOR: Fix leak in Window::runTests() 2023-06-08 09:16:30 +02:00
Scott Percival 458e97933d DIRECTOR: Refactor archive loading code
Make DirectorEngine::_allOpenResFiles the de-facto owner of Archive *
objects, move all of the various loadEXE/loadMac methods off Window and
onto DirectorEngine, and replace inline Archive loading with
openArchive().
2023-06-08 09:16:30 +02:00
Eugene Sandulenko e683f9e8d3 DIRECTOR: Fix text rendering test colors 2023-05-28 12:54:06 +02:00
Scott Percival ec76e5dfc6 DIRECTOR: Refactor palette loading for D5
Previously, the palette ID namespace was shared between cast ID, builtin
ID and resource fork ID. This was quite messy.

The new approach is to use CastMemberID; builtin palettes are libId -1,
cast palettes use their respective libId, and a null CastMemberID
indicates a blank entry.
2023-05-10 09:48:50 +02:00
Eugene Sandulenko c7daae946d DIRECTOR: Fix font drawing in graphics tests 2023-04-01 18:29:41 +02:00
Einar Johan Trøan Sømåen c3b1baf906 DIRECTOR: Refactor BitmapCastMember to store a Picture instead of decoder
This is in preparation for allowing for Lingo to get/set the picture
of BitmapCastMember.

In particular, storing a Picture lets us easily replace the existing
image (instead of having to rely on ImageDecoder as source).

Also, having Picture instances that are easy to copy will make lifetime
management easier if pictures are copied into longer-living things such
as globals.
2023-03-26 19:11:46 +02:00
Eugene Sandulenko fb7095f5a4 COMMON: Move all compression-related files to a separate directory 2022-12-01 11:53:02 +01:00
sluicebox 2775987cba MACGUI: Expose font families in MacFontManager
MacFontManager didn't have a mechanism to report which fonts it loaded
from an external resource. It also requires that any fonts that aren't
built-in be explicitly registered by name by the client before they can
be used. This combination meant that a client couldn't load fonts from
an external file and use them by their properties (id / size / style).

SCI contains Mac fonts in its executable along with a table that maps
each SCI font id to a Mac font id and size. The font name isn't a part
of this since the Classic Mac Toolbox API took id / size / style as
input when drawing text.

Now MacFontManager exposes the font families it has loaded along with
their names. This allows a client to see which fonts were loaded,
register them by name, and proceed to use them with the existing API.
2022-11-06 23:05:20 -08:00
Eugene Sandulenko 7eb121f708 DIRECTOR: Made graphics test more robust 2022-11-03 20:37:02 +01:00
Eugene Sandulenko caa681f179 DIRECTOR: Switch test dithering to common code 2022-11-03 20:37:02 +01:00
Eugene Sandulenko a717dd278a DIRECTOR: Temporarily disable picture test 2022-07-10 11:54:40 +02:00
Pragyansh Chaturvedi 686e720275 DIRECTOR: Implement Movie::createOrReplaceCastMember() and Cast::setCastMember() functions, add blend2.pic to tests 2022-07-03 19:24:04 +02:00
Pragyansh Chaturvedi 7775518224 DIRECTOR: Instantiate new CastMember for importFileInto builtin 2022-07-03 19:24:04 +02:00
Pragyansh Chaturvedi b9cd319a13 DIRECTOR: Add PICT to tests, test importFileInto 2022-07-03 19:24:04 +02:00
Eugene Sandulenko b7735a6326 DIRECTOR: Encapsulated tile access and implement override by VWTL 2022-06-15 01:01:05 +02:00
Eugene Sandulenko 43b1306bcd DIRECTOR: Simplify builtin tiles decompressing 2022-06-14 01:03:02 +02:00
Eugene Sandulenko aa34532742 DIRECTOR: Added built-in tile drawing to tests 2022-06-13 18:12:22 +02:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
djsrv 0592520ddf DIRECTOR: Test multiple possible paths for shared cast 2021-07-16 16:22:06 -04:00
Eugene Sandulenko 5ea23f666f DIRECTOR: Make rendering tests work in 32bpp 2020-08-15 14:50:26 +02:00
djsrv 9c537a8744 DIRECTOR: Rename Stage to more general Window
The stage and windows are the same type of thing, but the stage only
refers to one particular window.
2020-08-04 23:54:09 -04:00
djsrv 990b3451d4 DIRECTOR: Disable outdated lingo in test movie 2020-07-16 17:21:08 -04:00
djsrv 07bc3e58e8 DIRECTOR: Remove vm arg from constructors
Pass the object's direct parent instead, and get things like the stage
from that instead of from the _vm when possible.
2020-07-03 15:55:14 -04:00
djsrv 2c41b3f291 DIRECTOR: Give Stage ownership of movies 2020-07-03 15:55:14 -04:00
Eugene Sandulenko dd58587960 DIRECTOR: Fix director test execution 2020-07-01 19:11:18 +02:00
Eugene Sandulenko 5186f7194b DIRECTOR: Reduce header dependency 2020-07-01 17:49:48 +02:00
djsrv 5ae6c34074 DIRECTOR: Separate Movie and Cast from Score 2020-07-01 10:50:31 -04:00
Eugene Sandulenko 88a057d2ef DIRECTOR: Added sanity check to tests 2020-06-15 12:15:50 +02:00
djsrv d76e876e7a DIRECTOR: LINGO: Load shared cast with loadArchive 2020-06-11 12:02:47 -04:00
Eugene Sandulenko 787f3e4e61 DIRECTOR: Added test score for the test target 2020-06-04 00:07:34 +02:00
Eugene Sandulenko 38a5b8e9ef DIRECTOR: Moved all director test-related code to tests.cpp 2020-06-04 00:07:34 +02:00