141438 Commits

Author SHA1 Message Date
Einar Johan Trøan Sømåen
c4c13ba8f7 WATCHMAKER: Silence some warnings. 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
962bac59b7 WATCHMAKER: Optimize file loading by a lot (by not iterating over SearchMan) 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
76707bbac8 WATCHMAKER: Move GL Texture logic to its own file 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
823932c9e1 WATCHMAKER: Remove hack for skipping intro 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
8747a1c620 WATCHMAKER: Adjust the DIALOG sizes to match the retail expectations. 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
6e705c0665 WATCHMAKER: Fix missing break on EVENT_QUIT-handling 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
e973308d64 WATCHMAKER: Fix setDirectoryAndName to split on the last \, not the first.
(Which is what the original did)
2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
a63b887082 WATCHMAKER: Drop empty surface.h header 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
e9ea877133 WATCHMAKER: Add constexpr constructors for t3dV3F and t3dNORMAL 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
ca12fc10ab WATCHMAKER: Move room loading to RoomManager.
This lets us remove the dependency on malloc.h.

The replacement logic is not 100% perfect, as the original logic will
resize arrays to load additional t3dBODY-structs, and those would then
be free-d alongside their parent. This logic is currently missing, so
we will use some more memory.

However, we won't leak, as all loads are tracked by the RoomManager, and
will be freed when closing/restarting the game.
2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
6ea8aefa7b WATCHMAKER: Reduce the use of t3dFree
This does reduce the use of the linear allocator as well.
2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
16137c5cf7 WATCHMAKER: Add some missing namespaces 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
ce932f8b68 WATCHMAKER: zero-initialize WaterBuffer.
Currently the initialization of WaterBuffer is stubbed, so we get
a free() against an uninitialized pointer, which is dangerous.
2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
f6665b5d76 WATCHMAKER: Make SString's constructor constexpr to avoid global constructors. 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
acaca3e1b1 WATCHMAKER: Make t3dV3F's constructor constexpr to reduce global constructors 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
be9dba7ee0 WATCHMAKER: Avoid global constructors in CheckExtraLocalizationStrings 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
7b38c8f7c7 WATCHMAKER: Refactor Add2DStuff logic to avoid global constructors 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
439b210bcf WATCHMAKER: Move WaitingMsgs into MessageSystem 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
cf8e6d668d WATCHMAKER: Refactor Event to be MessageSystem::doEvent 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
d2a7afba15 WATCHMAKER: Movie mesh modifiers into a class.
This reduces the number of global constructors called.
2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
7d0fe48aed WATCHMAKER: Move scheduler global variables into a class.
To reduce the number of global constructors in play.
2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
cdc48ff2c8 WATCHMAKER: Use t3dV3F's constructor instead of explicit assignment. 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
b3ffa5de09 WATCHMAKER: Use Common::String in t3dLoadAnimation 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
634c448cb4 WATCHMAKER: Drop unused arg to t3dLoadCharacter 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
d9baf157ac WATCHMAKER: Guard against -1 in doDialog.
This should probably be an assertion, as something is likely wrong
here, but for now we'll just drop the call.
2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
6ece7cfbc4 WATCHMAKER: Optimize t3dGetFileDate slightly
By avoiding opening the files just to check their existence.
2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
2b3ef5e360 WATCHMAKER: Resize the KeyTable to fit any KeyCode 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
468f592d7d WATCHMAKER: Populate Portal Lists 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
cf4a76efa0 WATCHMAKER: Pad Mesh name buffer by 1.
Some meshes have no trailing 0, which breaks a lot of C-String handling.
2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
6caa7b59aa WATCHMAKER: Remove most system includes from engine
Only leaving the malloc.h include, as that needs some further code changes.
2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
70b0a45344 WACTHMAKER: Fix mistake in t3dFinalizeMaterialList 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
4fac22a1b7 WATCHMAKER: Move INV VARS into Init, to reduce the number of global constructors. 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
a0191f939f WATCHMAKER: Unstub UpdateRoomVisibility
While at it, also drop cstring/stdarg includes in ll_util.cpp
2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
f1107b4eea WATCHMAKER: Refactor rCopyMaterial to instead use rCopyMaterialList
The previous solution didn't guarantee that we were allocating all the
target entries, and since we had replaced the old C-Array with a list
of SharedPtr, we need to ensure that those SharedPtrs point somewhere.
2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
b8ead2dea2 WATCHMAKER: Move the GameRects to a class, instead of globals 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
ae7f5ed841 WATCHMAKER: Remove unused logo-code. 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
5844a03e49 WATCHMAKER: Fix some further warnings, and clean out some #if 0-ed code. 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
6f7a9362e5 WATCHMAKER: Refactor BitmapList to no longer be global 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
55cd5c8f20 WATCHMAKER: Improve some const usage (to avoid casting away constness) 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
1a23491270 WATCHMAKER: Clear out some warnings 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
4119ee5b1a WATCHMAKER: Fix an unintentional if due to missing braces 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
349bf36149 WATCHMAKER: Apply astyle formatting to code base. 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
ad47f12c1f WATCHMAKER: Unstub ME_CONTINUEEFFECT 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
4457ede6f9 WATCHMAKER: Implement "blitting" by keeping track of blits to the back buffer 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
babafef502 WATCHMAKER: Refactor/Implement viewport matrix handling. 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
6cbc4fff2d WATCHMAKER: Fix slash-handling in file loading. 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
29f690682d WATCHMAKER: Implement font loading. 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
cfeb74a842 WATCHMAKER: Refactor textures and implement movies 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
f4fdda4485 WATCHMAKER: Convert Keyboard-logic to OSystem 2023-04-29 13:01:08 +02:00
Einar Johan Trøan Sømåen
4bc0952421 WATCHMAKER: Fix rCreateMaterialList 2023-04-29 13:01:08 +02:00