aboutsummaryrefslogtreecommitdiff
path: root/engines/made/resource.cpp
diff options
context:
space:
mode:
authorBenjamin Haisch2008-05-05 10:45:11 +0000
committerBenjamin Haisch2008-05-05 10:45:11 +0000
commitb6c7385eb4fea90dd315124fe5bffe874430eb48 (patch)
tree2ac22b5cafe9b9e5bbb7cbf616f0e5c41b34ba64 /engines/made/resource.cpp
parent665caae8b4e06a8a87ab41de0f2361bba4c7cf4f (diff)
downloadscummvm-rg350-b6c7385eb4fea90dd315124fe5bffe874430eb48.tar.gz
scummvm-rg350-b6c7385eb4fea90dd315124fe5bffe874430eb48.tar.bz2
scummvm-rg350-b6c7385eb4fea90dd315124fe5bffe874430eb48.zip
- Renamed XmidiResource to GenericResource
- Added MIDI resource type - Added ScriptFunctionsLgop2 and ScriptFunctionsMhne (for Leather Goddesses of Phobos 2 and The Manhole: New and Enhanced, resp.) - Many changes for LGOP2 and The Manhole: N&E Note about the new ScriptFunctions classes: I copied the ScriptFunctionsRtz class and so duplicated a lot of code. Most of the opcode functions are the same in all games but there might be differences. Once all common opcode functions have been figured out, they'll be moved to a common place (like the ScriptFunctions class). svn-id: r31871
Diffstat (limited to 'engines/made/resource.cpp')
-rw-r--r--engines/made/resource.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp
index 1eb04f6211..7151f2424a 100644
--- a/engines/made/resource.cpp
+++ b/engines/made/resource.cpp
@@ -257,17 +257,17 @@ byte *FontResource::getCharData(uint c) const {
return _data + 1 + (c - 28) * (getHeight() + 1);
}
-/* XmidiResource */
+/* GenericResource */
-XmidiResource::XmidiResource() : _data(NULL), _size(0) {
+GenericResource::GenericResource() : _data(NULL), _size(0) {
}
-XmidiResource::~XmidiResource() {
+GenericResource::~GenericResource() {
if (_data)
delete[] _data;
}
-void XmidiResource::load(byte *source, int size) {
+void GenericResource::load(byte *source, int size) {
_data = new byte[size];
_size = size;
memcpy(_data, source, size);
@@ -341,8 +341,12 @@ FontResource *ProjectReader::getFont(int index) {
return createResource<FontResource>(kResFONT, index);
}
-XmidiResource *ProjectReader::getXmidi(int index) {
- return createResource<XmidiResource>(kResXMID, index);
+GenericResource *ProjectReader::getXmidi(int index) {
+ return createResource<GenericResource>(kResXMID, index);
+}
+
+GenericResource *ProjectReader::getMidi(int index) {
+ return createResource<GenericResource>(kResMIDI, index);
}
void ProjectReader::loadIndex(ResourceSlots *slots) {