scummvm/engines/tinsel/inv_objects.cpp

130 lines
3.7 KiB
C++
Raw Normal View History

/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#include "tinsel/inv_objects.h"
#include "common/memstream.h"
#include "tinsel/tinsel.h"
namespace Tinsel {
InventoryObject::InventoryObject(Common::MemoryReadStreamEndian &stream) {
_id = stream.readUint32();
_hIconFilm = stream.readUint32();
_hScript = stream.readUint32();
Revert TINSEL refactors that happened too close to code freeze. Revert "TINSEL: Fix int32 discrepancy" - This reverts commit a640e6b48991c027c3974607d025b16c054354f1. Revert "TINSEL: Refactor Notebook and System reels to follow naming conventions" - This reverts commit 2cfc3b4ed29f133730a9d54db3b7e45503d55068. Revert "TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove" - This reverts commit 5ba099f408f7a78206a10dc4ee8b52360d208504. Revert "TINSEL: Rename the public methods in Dialogs to follow convention" - This reverts commit 8ef52754a1c0189f68a1ac5d64168b236ca38e69. Revert "TINSEL: Rename the private methods in Dialogs to follow convention" - This reverts commit a3d0b5206b9cacfd36dacf8aca1262c986b3df31. Revert "TINSEL: Add debug commands to add all clues, as well as listing them." - This reverts commit fdfede64ca258d73b6de09c9334c7bc8ce2a3b65. Revert "TINSEL: Implement pointer handling for Notebook" - This reverts commit 195b04c9cf5ba743a371db0c9685b9f96f4950dd. Revert "TINSEL: Implement polygon-handling for Notebook" - This reverts commit 10cce703dcda251eef6af5ca550206a3c4bdff8a. Revert "TINSEL: Add initial event support to Notebook." - This reverts commit 61c94379cda64d3d5119edb905d65b4d92ce1778. Revert "TINSEL: Close Inventories when switching between them." - This reverts commit 337aed1915c84ed7d415a7f325a680c1bdc35ea4. Revert "TINSEL: Implement library function CROSSCLUE" - This reverts commit 9519288acd58adbdc9d5a89ef45294a6500b730f. Revert "TINSEL: Implement Notebook logic for adding clues and showing pages." - This reverts commit 3580c17cc52af43ee95c05b9c98eb49d3750e346. Revert "TINSEL: Implement InventoryOrNotebookActive" - This reverts commit 89aefb77945b21ecb4670c1fb24356a31d08c3af. Revert "TINSEL: Minor style-fixes" - This reverts commit e92fafb9558dfef3adc283a2fff8349d48651b26. Revert "TINSEL: Refactor IsInPolygon to be partially a member-function" - This reverts commit fa7d4480512d4e7af766a6aa433b253d48b2e537. Revert "TINSEL: Replace LockMem with GetFrame for FRAME" - This reverts commit ec9c630fc5b2b0613f5adda182421d501a061ad8. Revert "TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT" - This reverts commit fa8e3c506b93b272271d33663fee85bd86651526. Revert "TINSEL: Further refactor InventoryObjects" - This reverts commit 1a2f18e421efb221832ef8e16463ca9bc1991060.
2022-05-27 19:54:30 +02:00
}
int32 InventoryObject::getUnknown() const {
error("Querying Noir-value from non-Noir game");
}
int32 InventoryObject::getTitle() const {
error("Querying Noir-value from non-Noir game");
}
class InventoryObjectT1 : public InventoryObject {
public:
InventoryObjectT1(Common::MemoryReadStreamEndian &stream) : InventoryObject(stream) {
_attribute = stream.readUint32();
}
Revert TINSEL refactors that happened too close to code freeze. Revert "TINSEL: Fix int32 discrepancy" - This reverts commit a640e6b48991c027c3974607d025b16c054354f1. Revert "TINSEL: Refactor Notebook and System reels to follow naming conventions" - This reverts commit 2cfc3b4ed29f133730a9d54db3b7e45503d55068. Revert "TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove" - This reverts commit 5ba099f408f7a78206a10dc4ee8b52360d208504. Revert "TINSEL: Rename the public methods in Dialogs to follow convention" - This reverts commit 8ef52754a1c0189f68a1ac5d64168b236ca38e69. Revert "TINSEL: Rename the private methods in Dialogs to follow convention" - This reverts commit a3d0b5206b9cacfd36dacf8aca1262c986b3df31. Revert "TINSEL: Add debug commands to add all clues, as well as listing them." - This reverts commit fdfede64ca258d73b6de09c9334c7bc8ce2a3b65. Revert "TINSEL: Implement pointer handling for Notebook" - This reverts commit 195b04c9cf5ba743a371db0c9685b9f96f4950dd. Revert "TINSEL: Implement polygon-handling for Notebook" - This reverts commit 10cce703dcda251eef6af5ca550206a3c4bdff8a. Revert "TINSEL: Add initial event support to Notebook." - This reverts commit 61c94379cda64d3d5119edb905d65b4d92ce1778. Revert "TINSEL: Close Inventories when switching between them." - This reverts commit 337aed1915c84ed7d415a7f325a680c1bdc35ea4. Revert "TINSEL: Implement library function CROSSCLUE" - This reverts commit 9519288acd58adbdc9d5a89ef45294a6500b730f. Revert "TINSEL: Implement Notebook logic for adding clues and showing pages." - This reverts commit 3580c17cc52af43ee95c05b9c98eb49d3750e346. Revert "TINSEL: Implement InventoryOrNotebookActive" - This reverts commit 89aefb77945b21ecb4670c1fb24356a31d08c3af. Revert "TINSEL: Minor style-fixes" - This reverts commit e92fafb9558dfef3adc283a2fff8349d48651b26. Revert "TINSEL: Refactor IsInPolygon to be partially a member-function" - This reverts commit fa7d4480512d4e7af766a6aa433b253d48b2e537. Revert "TINSEL: Replace LockMem with GetFrame for FRAME" - This reverts commit ec9c630fc5b2b0613f5adda182421d501a061ad8. Revert "TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT" - This reverts commit fa8e3c506b93b272271d33663fee85bd86651526. Revert "TINSEL: Further refactor InventoryObjects" - This reverts commit 1a2f18e421efb221832ef8e16463ca9bc1991060.
2022-05-27 19:54:30 +02:00
// Tinsel1+
virtual int32 getAttribute() const {
return _attribute;
};
static const int SIZE = InventoryObject::SIZE + 4;
private:
int32 _attribute;
};
class InventoryObjectT3 : public InventoryObjectT1 {
public:
InventoryObjectT3(Common::MemoryReadStreamEndian &stream) : InventoryObjectT1(stream) {
_unknown = stream.readUint32();
_title = stream.readUint32();
}
// Noir:
virtual int32 getUnknown() const {
return _unknown;
}
virtual int32 getTitle() const {
return _title;
}
static const int SIZE = InventoryObjectT1::SIZE + 8;
private:
int32 _unknown;
int32 _title;
};
template<typename T>
class InventoryObjectsImpl : public InventoryObjects {
public:
InventoryObjectsImpl(const byte *objects, int numObjects) {
bool bigEndian = (TinselV1Mac || TinselV1Saturn);
Revert TINSEL refactors that happened too close to code freeze. Revert "TINSEL: Fix int32 discrepancy" - This reverts commit a640e6b48991c027c3974607d025b16c054354f1. Revert "TINSEL: Refactor Notebook and System reels to follow naming conventions" - This reverts commit 2cfc3b4ed29f133730a9d54db3b7e45503d55068. Revert "TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove" - This reverts commit 5ba099f408f7a78206a10dc4ee8b52360d208504. Revert "TINSEL: Rename the public methods in Dialogs to follow convention" - This reverts commit 8ef52754a1c0189f68a1ac5d64168b236ca38e69. Revert "TINSEL: Rename the private methods in Dialogs to follow convention" - This reverts commit a3d0b5206b9cacfd36dacf8aca1262c986b3df31. Revert "TINSEL: Add debug commands to add all clues, as well as listing them." - This reverts commit fdfede64ca258d73b6de09c9334c7bc8ce2a3b65. Revert "TINSEL: Implement pointer handling for Notebook" - This reverts commit 195b04c9cf5ba743a371db0c9685b9f96f4950dd. Revert "TINSEL: Implement polygon-handling for Notebook" - This reverts commit 10cce703dcda251eef6af5ca550206a3c4bdff8a. Revert "TINSEL: Add initial event support to Notebook." - This reverts commit 61c94379cda64d3d5119edb905d65b4d92ce1778. Revert "TINSEL: Close Inventories when switching between them." - This reverts commit 337aed1915c84ed7d415a7f325a680c1bdc35ea4. Revert "TINSEL: Implement library function CROSSCLUE" - This reverts commit 9519288acd58adbdc9d5a89ef45294a6500b730f. Revert "TINSEL: Implement Notebook logic for adding clues and showing pages." - This reverts commit 3580c17cc52af43ee95c05b9c98eb49d3750e346. Revert "TINSEL: Implement InventoryOrNotebookActive" - This reverts commit 89aefb77945b21ecb4670c1fb24356a31d08c3af. Revert "TINSEL: Minor style-fixes" - This reverts commit e92fafb9558dfef3adc283a2fff8349d48651b26. Revert "TINSEL: Refactor IsInPolygon to be partially a member-function" - This reverts commit fa7d4480512d4e7af766a6aa433b253d48b2e537. Revert "TINSEL: Replace LockMem with GetFrame for FRAME" - This reverts commit ec9c630fc5b2b0613f5adda182421d501a061ad8. Revert "TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT" - This reverts commit fa8e3c506b93b272271d33663fee85bd86651526. Revert "TINSEL: Further refactor InventoryObjects" - This reverts commit 1a2f18e421efb221832ef8e16463ca9bc1991060.
2022-05-27 19:54:30 +02:00
auto stream = new Common::MemoryReadStreamEndian(objects, T::SIZE * numObjects, bigEndian, DisposeAfterUse::NO);
for (int i = 0; i < numObjects; i++) {
_objects.push_back(T(*stream));
}
assert((!stream->eos()) && stream->pos() == stream->size());
delete stream;
}
~InventoryObjectsImpl(){};
Revert TINSEL refactors that happened too close to code freeze. Revert "TINSEL: Fix int32 discrepancy" - This reverts commit a640e6b48991c027c3974607d025b16c054354f1. Revert "TINSEL: Refactor Notebook and System reels to follow naming conventions" - This reverts commit 2cfc3b4ed29f133730a9d54db3b7e45503d55068. Revert "TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove" - This reverts commit 5ba099f408f7a78206a10dc4ee8b52360d208504. Revert "TINSEL: Rename the public methods in Dialogs to follow convention" - This reverts commit 8ef52754a1c0189f68a1ac5d64168b236ca38e69. Revert "TINSEL: Rename the private methods in Dialogs to follow convention" - This reverts commit a3d0b5206b9cacfd36dacf8aca1262c986b3df31. Revert "TINSEL: Add debug commands to add all clues, as well as listing them." - This reverts commit fdfede64ca258d73b6de09c9334c7bc8ce2a3b65. Revert "TINSEL: Implement pointer handling for Notebook" - This reverts commit 195b04c9cf5ba743a371db0c9685b9f96f4950dd. Revert "TINSEL: Implement polygon-handling for Notebook" - This reverts commit 10cce703dcda251eef6af5ca550206a3c4bdff8a. Revert "TINSEL: Add initial event support to Notebook." - This reverts commit 61c94379cda64d3d5119edb905d65b4d92ce1778. Revert "TINSEL: Close Inventories when switching between them." - This reverts commit 337aed1915c84ed7d415a7f325a680c1bdc35ea4. Revert "TINSEL: Implement library function CROSSCLUE" - This reverts commit 9519288acd58adbdc9d5a89ef45294a6500b730f. Revert "TINSEL: Implement Notebook logic for adding clues and showing pages." - This reverts commit 3580c17cc52af43ee95c05b9c98eb49d3750e346. Revert "TINSEL: Implement InventoryOrNotebookActive" - This reverts commit 89aefb77945b21ecb4670c1fb24356a31d08c3af. Revert "TINSEL: Minor style-fixes" - This reverts commit e92fafb9558dfef3adc283a2fff8349d48651b26. Revert "TINSEL: Refactor IsInPolygon to be partially a member-function" - This reverts commit fa7d4480512d4e7af766a6aa433b253d48b2e537. Revert "TINSEL: Replace LockMem with GetFrame for FRAME" - This reverts commit ec9c630fc5b2b0613f5adda182421d501a061ad8. Revert "TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT" - This reverts commit fa8e3c506b93b272271d33663fee85bd86651526. Revert "TINSEL: Further refactor InventoryObjects" - This reverts commit 1a2f18e421efb221832ef8e16463ca9bc1991060.
2022-05-27 19:54:30 +02:00
const InventoryObject *GetInvObject(int id) {
auto index = GetObjectIndexIfExists(id);
if (index != -1) {
return _objects.data() + index;
}
return nullptr;
}
Revert TINSEL refactors that happened too close to code freeze. Revert "TINSEL: Fix int32 discrepancy" - This reverts commit a640e6b48991c027c3974607d025b16c054354f1. Revert "TINSEL: Refactor Notebook and System reels to follow naming conventions" - This reverts commit 2cfc3b4ed29f133730a9d54db3b7e45503d55068. Revert "TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove" - This reverts commit 5ba099f408f7a78206a10dc4ee8b52360d208504. Revert "TINSEL: Rename the public methods in Dialogs to follow convention" - This reverts commit 8ef52754a1c0189f68a1ac5d64168b236ca38e69. Revert "TINSEL: Rename the private methods in Dialogs to follow convention" - This reverts commit a3d0b5206b9cacfd36dacf8aca1262c986b3df31. Revert "TINSEL: Add debug commands to add all clues, as well as listing them." - This reverts commit fdfede64ca258d73b6de09c9334c7bc8ce2a3b65. Revert "TINSEL: Implement pointer handling for Notebook" - This reverts commit 195b04c9cf5ba743a371db0c9685b9f96f4950dd. Revert "TINSEL: Implement polygon-handling for Notebook" - This reverts commit 10cce703dcda251eef6af5ca550206a3c4bdff8a. Revert "TINSEL: Add initial event support to Notebook." - This reverts commit 61c94379cda64d3d5119edb905d65b4d92ce1778. Revert "TINSEL: Close Inventories when switching between them." - This reverts commit 337aed1915c84ed7d415a7f325a680c1bdc35ea4. Revert "TINSEL: Implement library function CROSSCLUE" - This reverts commit 9519288acd58adbdc9d5a89ef45294a6500b730f. Revert "TINSEL: Implement Notebook logic for adding clues and showing pages." - This reverts commit 3580c17cc52af43ee95c05b9c98eb49d3750e346. Revert "TINSEL: Implement InventoryOrNotebookActive" - This reverts commit 89aefb77945b21ecb4670c1fb24356a31d08c3af. Revert "TINSEL: Minor style-fixes" - This reverts commit e92fafb9558dfef3adc283a2fff8349d48651b26. Revert "TINSEL: Refactor IsInPolygon to be partially a member-function" - This reverts commit fa7d4480512d4e7af766a6aa433b253d48b2e537. Revert "TINSEL: Replace LockMem with GetFrame for FRAME" - This reverts commit ec9c630fc5b2b0613f5adda182421d501a061ad8. Revert "TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT" - This reverts commit fa8e3c506b93b272271d33663fee85bd86651526. Revert "TINSEL: Further refactor InventoryObjects" - This reverts commit 1a2f18e421efb221832ef8e16463ca9bc1991060.
2022-05-27 19:54:30 +02:00
const InventoryObject *GetObjectByIndex(int index) const {
assert(index >= 0 && index < numObjects());
return _objects.data() + index;
}
Revert TINSEL refactors that happened too close to code freeze. Revert "TINSEL: Fix int32 discrepancy" - This reverts commit a640e6b48991c027c3974607d025b16c054354f1. Revert "TINSEL: Refactor Notebook and System reels to follow naming conventions" - This reverts commit 2cfc3b4ed29f133730a9d54db3b7e45503d55068. Revert "TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove" - This reverts commit 5ba099f408f7a78206a10dc4ee8b52360d208504. Revert "TINSEL: Rename the public methods in Dialogs to follow convention" - This reverts commit 8ef52754a1c0189f68a1ac5d64168b236ca38e69. Revert "TINSEL: Rename the private methods in Dialogs to follow convention" - This reverts commit a3d0b5206b9cacfd36dacf8aca1262c986b3df31. Revert "TINSEL: Add debug commands to add all clues, as well as listing them." - This reverts commit fdfede64ca258d73b6de09c9334c7bc8ce2a3b65. Revert "TINSEL: Implement pointer handling for Notebook" - This reverts commit 195b04c9cf5ba743a371db0c9685b9f96f4950dd. Revert "TINSEL: Implement polygon-handling for Notebook" - This reverts commit 10cce703dcda251eef6af5ca550206a3c4bdff8a. Revert "TINSEL: Add initial event support to Notebook." - This reverts commit 61c94379cda64d3d5119edb905d65b4d92ce1778. Revert "TINSEL: Close Inventories when switching between them." - This reverts commit 337aed1915c84ed7d415a7f325a680c1bdc35ea4. Revert "TINSEL: Implement library function CROSSCLUE" - This reverts commit 9519288acd58adbdc9d5a89ef45294a6500b730f. Revert "TINSEL: Implement Notebook logic for adding clues and showing pages." - This reverts commit 3580c17cc52af43ee95c05b9c98eb49d3750e346. Revert "TINSEL: Implement InventoryOrNotebookActive" - This reverts commit 89aefb77945b21ecb4670c1fb24356a31d08c3af. Revert "TINSEL: Minor style-fixes" - This reverts commit e92fafb9558dfef3adc283a2fff8349d48651b26. Revert "TINSEL: Refactor IsInPolygon to be partially a member-function" - This reverts commit fa7d4480512d4e7af766a6aa433b253d48b2e537. Revert "TINSEL: Replace LockMem with GetFrame for FRAME" - This reverts commit ec9c630fc5b2b0613f5adda182421d501a061ad8. Revert "TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT" - This reverts commit fa8e3c506b93b272271d33663fee85bd86651526. Revert "TINSEL: Further refactor InventoryObjects" - This reverts commit 1a2f18e421efb221832ef8e16463ca9bc1991060.
2022-05-27 19:54:30 +02:00
void SetObjectFilm(int id, SCNHANDLE hFilm) {
int index = GetObjectIndexIfExists(id);
_objects[index].setIconFilm(hFilm);
}
Revert TINSEL refactors that happened too close to code freeze. Revert "TINSEL: Fix int32 discrepancy" - This reverts commit a640e6b48991c027c3974607d025b16c054354f1. Revert "TINSEL: Refactor Notebook and System reels to follow naming conventions" - This reverts commit 2cfc3b4ed29f133730a9d54db3b7e45503d55068. Revert "TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove" - This reverts commit 5ba099f408f7a78206a10dc4ee8b52360d208504. Revert "TINSEL: Rename the public methods in Dialogs to follow convention" - This reverts commit 8ef52754a1c0189f68a1ac5d64168b236ca38e69. Revert "TINSEL: Rename the private methods in Dialogs to follow convention" - This reverts commit a3d0b5206b9cacfd36dacf8aca1262c986b3df31. Revert "TINSEL: Add debug commands to add all clues, as well as listing them." - This reverts commit fdfede64ca258d73b6de09c9334c7bc8ce2a3b65. Revert "TINSEL: Implement pointer handling for Notebook" - This reverts commit 195b04c9cf5ba743a371db0c9685b9f96f4950dd. Revert "TINSEL: Implement polygon-handling for Notebook" - This reverts commit 10cce703dcda251eef6af5ca550206a3c4bdff8a. Revert "TINSEL: Add initial event support to Notebook." - This reverts commit 61c94379cda64d3d5119edb905d65b4d92ce1778. Revert "TINSEL: Close Inventories when switching between them." - This reverts commit 337aed1915c84ed7d415a7f325a680c1bdc35ea4. Revert "TINSEL: Implement library function CROSSCLUE" - This reverts commit 9519288acd58adbdc9d5a89ef45294a6500b730f. Revert "TINSEL: Implement Notebook logic for adding clues and showing pages." - This reverts commit 3580c17cc52af43ee95c05b9c98eb49d3750e346. Revert "TINSEL: Implement InventoryOrNotebookActive" - This reverts commit 89aefb77945b21ecb4670c1fb24356a31d08c3af. Revert "TINSEL: Minor style-fixes" - This reverts commit e92fafb9558dfef3adc283a2fff8349d48651b26. Revert "TINSEL: Refactor IsInPolygon to be partially a member-function" - This reverts commit fa7d4480512d4e7af766a6aa433b253d48b2e537. Revert "TINSEL: Replace LockMem with GetFrame for FRAME" - This reverts commit ec9c630fc5b2b0613f5adda182421d501a061ad8. Revert "TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT" - This reverts commit fa8e3c506b93b272271d33663fee85bd86651526. Revert "TINSEL: Further refactor InventoryObjects" - This reverts commit 1a2f18e421efb221832ef8e16463ca9bc1991060.
2022-05-27 19:54:30 +02:00
int GetObjectIndexIfExists(int id) const {
2022-05-11 09:01:06 +03:00
for (uint i = 0; i < _objects.size(); i++) {
if (_objects[i].getId() == id) {
return i;
}
}
return -1;
};
Revert TINSEL refactors that happened too close to code freeze. Revert "TINSEL: Fix int32 discrepancy" - This reverts commit a640e6b48991c027c3974607d025b16c054354f1. Revert "TINSEL: Refactor Notebook and System reels to follow naming conventions" - This reverts commit 2cfc3b4ed29f133730a9d54db3b7e45503d55068. Revert "TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove" - This reverts commit 5ba099f408f7a78206a10dc4ee8b52360d208504. Revert "TINSEL: Rename the public methods in Dialogs to follow convention" - This reverts commit 8ef52754a1c0189f68a1ac5d64168b236ca38e69. Revert "TINSEL: Rename the private methods in Dialogs to follow convention" - This reverts commit a3d0b5206b9cacfd36dacf8aca1262c986b3df31. Revert "TINSEL: Add debug commands to add all clues, as well as listing them." - This reverts commit fdfede64ca258d73b6de09c9334c7bc8ce2a3b65. Revert "TINSEL: Implement pointer handling for Notebook" - This reverts commit 195b04c9cf5ba743a371db0c9685b9f96f4950dd. Revert "TINSEL: Implement polygon-handling for Notebook" - This reverts commit 10cce703dcda251eef6af5ca550206a3c4bdff8a. Revert "TINSEL: Add initial event support to Notebook." - This reverts commit 61c94379cda64d3d5119edb905d65b4d92ce1778. Revert "TINSEL: Close Inventories when switching between them." - This reverts commit 337aed1915c84ed7d415a7f325a680c1bdc35ea4. Revert "TINSEL: Implement library function CROSSCLUE" - This reverts commit 9519288acd58adbdc9d5a89ef45294a6500b730f. Revert "TINSEL: Implement Notebook logic for adding clues and showing pages." - This reverts commit 3580c17cc52af43ee95c05b9c98eb49d3750e346. Revert "TINSEL: Implement InventoryOrNotebookActive" - This reverts commit 89aefb77945b21ecb4670c1fb24356a31d08c3af. Revert "TINSEL: Minor style-fixes" - This reverts commit e92fafb9558dfef3adc283a2fff8349d48651b26. Revert "TINSEL: Refactor IsInPolygon to be partially a member-function" - This reverts commit fa7d4480512d4e7af766a6aa433b253d48b2e537. Revert "TINSEL: Replace LockMem with GetFrame for FRAME" - This reverts commit ec9c630fc5b2b0613f5adda182421d501a061ad8. Revert "TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT" - This reverts commit fa8e3c506b93b272271d33663fee85bd86651526. Revert "TINSEL: Further refactor InventoryObjects" - This reverts commit 1a2f18e421efb221832ef8e16463ca9bc1991060.
2022-05-27 19:54:30 +02:00
int numObjects() const {
return _objects.size();
}
private:
Common::Array<T> _objects;
};
InventoryObjects *InstantiateInventoryObjects(const byte *invObjects, int numObjects) {
switch (TinselVersion) {
Revert TINSEL refactors that happened too close to code freeze. Revert "TINSEL: Fix int32 discrepancy" - This reverts commit a640e6b48991c027c3974607d025b16c054354f1. Revert "TINSEL: Refactor Notebook and System reels to follow naming conventions" - This reverts commit 2cfc3b4ed29f133730a9d54db3b7e45503d55068. Revert "TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove" - This reverts commit 5ba099f408f7a78206a10dc4ee8b52360d208504. Revert "TINSEL: Rename the public methods in Dialogs to follow convention" - This reverts commit 8ef52754a1c0189f68a1ac5d64168b236ca38e69. Revert "TINSEL: Rename the private methods in Dialogs to follow convention" - This reverts commit a3d0b5206b9cacfd36dacf8aca1262c986b3df31. Revert "TINSEL: Add debug commands to add all clues, as well as listing them." - This reverts commit fdfede64ca258d73b6de09c9334c7bc8ce2a3b65. Revert "TINSEL: Implement pointer handling for Notebook" - This reverts commit 195b04c9cf5ba743a371db0c9685b9f96f4950dd. Revert "TINSEL: Implement polygon-handling for Notebook" - This reverts commit 10cce703dcda251eef6af5ca550206a3c4bdff8a. Revert "TINSEL: Add initial event support to Notebook." - This reverts commit 61c94379cda64d3d5119edb905d65b4d92ce1778. Revert "TINSEL: Close Inventories when switching between them." - This reverts commit 337aed1915c84ed7d415a7f325a680c1bdc35ea4. Revert "TINSEL: Implement library function CROSSCLUE" - This reverts commit 9519288acd58adbdc9d5a89ef45294a6500b730f. Revert "TINSEL: Implement Notebook logic for adding clues and showing pages." - This reverts commit 3580c17cc52af43ee95c05b9c98eb49d3750e346. Revert "TINSEL: Implement InventoryOrNotebookActive" - This reverts commit 89aefb77945b21ecb4670c1fb24356a31d08c3af. Revert "TINSEL: Minor style-fixes" - This reverts commit e92fafb9558dfef3adc283a2fff8349d48651b26. Revert "TINSEL: Refactor IsInPolygon to be partially a member-function" - This reverts commit fa7d4480512d4e7af766a6aa433b253d48b2e537. Revert "TINSEL: Replace LockMem with GetFrame for FRAME" - This reverts commit ec9c630fc5b2b0613f5adda182421d501a061ad8. Revert "TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT" - This reverts commit fa8e3c506b93b272271d33663fee85bd86651526. Revert "TINSEL: Further refactor InventoryObjects" - This reverts commit 1a2f18e421efb221832ef8e16463ca9bc1991060.
2022-05-27 19:54:30 +02:00
case 0:
return new InventoryObjectsImpl<InventoryObject>(invObjects, numObjects);
case 3:
return new InventoryObjectsImpl<InventoryObjectT3>(invObjects, numObjects);
default:
Revert TINSEL refactors that happened too close to code freeze. Revert "TINSEL: Fix int32 discrepancy" - This reverts commit a640e6b48991c027c3974607d025b16c054354f1. Revert "TINSEL: Refactor Notebook and System reels to follow naming conventions" - This reverts commit 2cfc3b4ed29f133730a9d54db3b7e45503d55068. Revert "TINSEL: Rename IsConvAndNotMove -> isConvAndNotMove" - This reverts commit 5ba099f408f7a78206a10dc4ee8b52360d208504. Revert "TINSEL: Rename the public methods in Dialogs to follow convention" - This reverts commit 8ef52754a1c0189f68a1ac5d64168b236ca38e69. Revert "TINSEL: Rename the private methods in Dialogs to follow convention" - This reverts commit a3d0b5206b9cacfd36dacf8aca1262c986b3df31. Revert "TINSEL: Add debug commands to add all clues, as well as listing them." - This reverts commit fdfede64ca258d73b6de09c9334c7bc8ce2a3b65. Revert "TINSEL: Implement pointer handling for Notebook" - This reverts commit 195b04c9cf5ba743a371db0c9685b9f96f4950dd. Revert "TINSEL: Implement polygon-handling for Notebook" - This reverts commit 10cce703dcda251eef6af5ca550206a3c4bdff8a. Revert "TINSEL: Add initial event support to Notebook." - This reverts commit 61c94379cda64d3d5119edb905d65b4d92ce1778. Revert "TINSEL: Close Inventories when switching between them." - This reverts commit 337aed1915c84ed7d415a7f325a680c1bdc35ea4. Revert "TINSEL: Implement library function CROSSCLUE" - This reverts commit 9519288acd58adbdc9d5a89ef45294a6500b730f. Revert "TINSEL: Implement Notebook logic for adding clues and showing pages." - This reverts commit 3580c17cc52af43ee95c05b9c98eb49d3750e346. Revert "TINSEL: Implement InventoryOrNotebookActive" - This reverts commit 89aefb77945b21ecb4670c1fb24356a31d08c3af. Revert "TINSEL: Minor style-fixes" - This reverts commit e92fafb9558dfef3adc283a2fff8349d48651b26. Revert "TINSEL: Refactor IsInPolygon to be partially a member-function" - This reverts commit fa7d4480512d4e7af766a6aa433b253d48b2e537. Revert "TINSEL: Replace LockMem with GetFrame for FRAME" - This reverts commit ec9c630fc5b2b0613f5adda182421d501a061ad8. Revert "TINSEL: Replace LockMem with GetMultiInit for MULTI_INIT" - This reverts commit fa8e3c506b93b272271d33663fee85bd86651526. Revert "TINSEL: Further refactor InventoryObjects" - This reverts commit 1a2f18e421efb221832ef8e16463ca9bc1991060.
2022-05-27 19:54:30 +02:00
return new InventoryObjectsImpl<InventoryObjectT1>(invObjects, numObjects);
}
}
} // End of namespace Tinsel