Commit Graph

910 Commits

Author SHA1 Message Date
Donovan Watteau
21cd732b60 TINSEL: Fix UB for enum TINSEL_EVENT in DW2. PVS-Studio V1016
In DW2, some large TINSEL_EVENT values are read, and they're bigger than
the last TINSEL_EVENT value, but we cast them to `enum TINSEL_EVENT`
values in tinlib.cpp, which is apparently "unspecified behavior up to
C++17 and undefined behavior starting from C++17".

  tinlib.cpp:1925:39: runtime error: load of value 9041, which is not
     a valid value for type 'Tinsel::TINSEL_EVENT'
  tinlib.cpp:1935:31: runtime error: load of value 77, which is not
     a valid value for type 'Tinsel::TINSEL_EVENT'

Found with UBSan but the really clear help comes from PVS-Studio
documentation.
2022-11-29 00:41:03 +01:00
Walter Agazzi
15fd200635 TINSEL: Change "2" to "II" in DW2 title 2022-11-28 19:43:13 +01:00
Donovan Watteau
bedbc2881d TINSEL: Fix DW2 subtitle color on big-endian systems
The red text for the Suffrajester in the cemetery was printed in black
on big-endian PowerPC.

It appears that the color given to SetActorRGB() is already in native
endianness, so there's no need to call TO_32() which would do a double
conversion on big-endian hosts.
2022-11-27 23:06:24 +02:00
Donovan Watteau
16e2068aec JANITORIAL: Fix various single-character typos 2022-11-11 20:55:56 +01:00
Hubert Maier
e2d1e88d6f
TINSEL: Correct spelling mistake
aquire -> acquire
2022-10-27 15:57:30 +02:00
Le Philousophe
5ad311fbaa TINSEL: Don't use unsafe sprintf and vsprintf 2022-10-23 22:46:19 +02:00
Le Philousophe
52caebf8af TINSEL: Don't use unsafe strcat and strcpy 2022-10-23 22:46:19 +02:00
Einar Johan Trøan Sømåen
47b599de20
TINSEL: Fix wrong mapping of IO_-attributes
1839780513 made a mistake by
confusing the IO-attributes with the non-IO_-attributes,
as there is a difference in the order of the flags between
these two sets.

Fixes bug: https://bugs.scummvm.org/ticket/13810
2022-09-25 20:42:08 +02:00
Cameron Cawley
f3b094e53f ENGINES: Change the MetaEngineDetection interface to match MetaEngine 2022-07-23 23:31:58 +02:00
D G Turner
f8c025dbf0 TINSEL: Fix Signed vs. Unsigned Comparison GCC Compiler Warnings 2022-06-11 22:38:46 +01:00
Le Philousophe
6a9bf4785d TINSEL: Fix int32 discrepancy 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
afc09057ab TINSEL: Refactor Notebook and System reels to follow naming conventions 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
5b2a8fea37 TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
50eb3bb542 TINSEL: Rename the public methods in Dialogs to follow convention 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
c2e94a0cf5 TINSEL: Rename the private methods in Dialogs to follow convention
Changing from PascalCase to camelCase
2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
bc178e9784 TINSEL: Add debug commands to add all clues, as well as listing them.
At the same time, name the NOTEBOOK_CLUE attribute appropriately
2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
1f1f97c745 TINSEL: Implement pointer handling for Notebook 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
5c873a17b2 TINSEL: Implement polygon-handling for Notebook 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
a0e5f431de TINSEL: Add initial event support to Notebook.
For now this should be enough to flip pages.
2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
8d1abb5192 TINSEL: Close Inventories when switching between them. 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
5c409b4bbb TINSEL: Implement library function CROSSCLUE 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
ec6835dac7 TINSEL: Implement Notebook logic for adding clues and showing pages. 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
de164c168d TINSEL: Implement InventoryOrNotebookActive 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
54f179dfab TINSEL: Minor style-fixes 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
aa4c3184eb TINSEL: Refactor IsInPolygon to be partially a member-function 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
9ebe1cd31b TINSEL: Replace LockMem with GetFrame for FRAME 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
72aa757d2c TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT 2022-06-10 23:12:34 +03:00
Einar Johan Trøan Sømåen
18668bd218 TINSEL: Further refactor InventoryObjects
So that we don't need vtables for the InventoryObject-objects, only
for the container.
2022-06-10 23:12:34 +03:00
Orgad Shaneh
e99d7f0a1d TINSEL: Silence signed/unsigned comparison compiler warning
../scummvm/engines/tinsel/handle.cpp: In member function 'void Tinsel::Handle::LoadFile(Tinsel::MEMHANDLE*)':
../scummvm/engines/tinsel/handle.cpp:293:27: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' [-Wsign-compare]
  293 |                 if (bytes == (pH->filesize & FSIZE_MASK)) {
      |                     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-06-02 23:41:32 +03:00
Einar Johan Trøan Sømåen
51b2994659
Revert TINSEL refactors that happened too close to code freeze.
Revert "TINSEL: Fix int32 discrepancy"
- This reverts commit a640e6b489.

Revert "TINSEL: Refactor Notebook and System reels to follow naming conventions"
- This reverts commit 2cfc3b4ed2.

Revert "TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove"
- This reverts commit 5ba099f408.

Revert "TINSEL: Rename the public methods in Dialogs to follow convention"
- This reverts commit 8ef52754a1.

Revert "TINSEL: Rename the private methods in Dialogs to follow convention"
- This reverts commit a3d0b5206b.

Revert "TINSEL: Add debug commands to add all clues, as well as listing them."
- This reverts commit fdfede64ca.

Revert "TINSEL: Implement pointer handling for Notebook"
- This reverts commit 195b04c9cf.

Revert "TINSEL: Implement polygon-handling for Notebook"
- This reverts commit 10cce703dc.

Revert "TINSEL: Add initial event support to Notebook."
- This reverts commit 61c94379cd.

Revert "TINSEL: Close Inventories when switching between them."
- This reverts commit 337aed1915.

Revert "TINSEL: Implement library function CROSSCLUE"
- This reverts commit 9519288acd.

Revert "TINSEL: Implement Notebook logic for adding clues and showing pages."
- This reverts commit 3580c17cc5.

Revert "TINSEL: Implement InventoryOrNotebookActive"
- This reverts commit 89aefb7794.

Revert "TINSEL: Minor style-fixes"
- This reverts commit e92fafb955.

Revert "TINSEL: Refactor IsInPolygon to be partially a member-function"
- This reverts commit fa7d448051.

Revert "TINSEL: Replace LockMem with GetFrame for FRAME"
- This reverts commit ec9c630fc5.

Revert "TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT"
- This reverts commit fa8e3c506b.

Revert "TINSEL: Further refactor InventoryObjects"
- This reverts commit 1a2f18e421.
2022-05-27 19:55:36 +02:00
Le Philousophe
a640e6b489 TINSEL: Fix int32 discrepancy 2022-05-27 17:04:26 +02:00
Einar Johan Trøan Sømåen
2cfc3b4ed2
TINSEL: Refactor Notebook and System reels to follow naming conventions 2022-05-27 10:39:56 +02:00
Einar Johan Trøan Sømåen
5ba099f408
TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove 2022-05-27 10:29:38 +02:00
Einar Johan Trøan Sømåen
8ef52754a1
TINSEL: Rename the public methods in Dialogs to follow convention 2022-05-27 10:25:33 +02:00
Einar Johan Trøan Sømåen
a3d0b5206b
TINSEL: Rename the private methods in Dialogs to follow convention
Changing from PascalCase to camelCase
2022-05-27 08:59:44 +02:00
Einar Johan Trøan Sømåen
fdfede64ca
TINSEL: Add debug commands to add all clues, as well as listing them.
At the same time, name the NOTEBOOK_CLUE attribute appropriately
2022-05-26 23:08:35 +02:00
Einar Johan Trøan Sømåen
195b04c9cf
TINSEL: Implement pointer handling for Notebook 2022-05-26 22:29:36 +02:00
Einar Johan Trøan Sømåen
10cce703dc
TINSEL: Implement polygon-handling for Notebook 2022-05-26 22:29:22 +02:00
Einar Johan Trøan Sømåen
61c94379cd
TINSEL: Add initial event support to Notebook.
For now this should be enough to flip pages.
2022-05-26 22:09:31 +02:00
Einar Johan Trøan Sømåen
337aed1915
TINSEL: Close Inventories when switching between them. 2022-05-26 21:49:53 +02:00
Einar Johan Trøan Sømåen
9519288acd
TINSEL: Implement library function CROSSCLUE 2022-05-26 21:49:16 +02:00
Einar Johan Trøan Sømåen
3580c17cc5
TINSEL: Implement Notebook logic for adding clues and showing pages. 2022-05-26 21:48:17 +02:00
Einar Johan Trøan Sømåen
89aefb7794
TINSEL: Implement InventoryOrNotebookActive 2022-05-26 21:07:21 +02:00
Einar Johan Trøan Sømåen
e92fafb955
TINSEL: Minor style-fixes 2022-05-26 21:06:58 +02:00
Einar Johan Trøan Sømåen
fa7d448051
TINSEL: Refactor IsInPolygon to be partially a member-function 2022-05-26 21:06:27 +02:00
Einar Johan Trøan Sømåen
ec9c630fc5
TINSEL: Replace LockMem with GetFrame for FRAME 2022-05-26 21:04:41 +02:00
Einar Johan Trøan Sømåen
fa8e3c506b
TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT 2022-05-26 21:04:36 +02:00
Einar Johan Trøan Sømåen
1a2f18e421
TINSEL: Further refactor InventoryObjects
So that we don't need vtables for the InventoryObject-objects, only
for the container.
2022-05-26 21:02:05 +02:00
Donovan Watteau
5b1ec56f96 JANITORIAL: Fix some lost or outdated URLs in comments 2022-05-19 07:57:31 +03:00
Filippos Karapetis
022906fb86 TINSEL: Remove unused defines 2022-05-12 01:25:18 +03:00