aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Brown2002-05-15 10:25:00 +0000
committerJames Brown2002-05-15 10:25:00 +0000
commit4670fee8218cdc27932f855b3e453c37e4cea586 (patch)
tree82e75de4c322434de36080611ab59fe723b53c22
parentf0999a4838f812bff828534aad64783de69a2171 (diff)
downloadscummvm-rg350-4670fee8218cdc27932f855b3e453c37e4cea586.tar.gz
scummvm-rg350-4670fee8218cdc27932f855b3e453c37e4cea586.tar.bz2
scummvm-rg350-4670fee8218cdc27932f855b3e453c37e4cea586.zip
Misc. fixes
svn-id: r4338
-rw-r--r--actor.h4
-rw-r--r--init.cpp5
-rw-r--r--scummvm.cpp3
-rw-r--r--scummvm.dsp9
-rw-r--r--sound.cpp52
-rw-r--r--verbs.cpp4
6 files changed, 45 insertions, 32 deletions
diff --git a/actor.h b/actor.h
index 8453c0488e..df8b72ef31 100644
--- a/actor.h
+++ b/actor.h
@@ -94,8 +94,8 @@ protected:
public:
// Constructor
- Actor(Scumm *scumm) : _scumm(scumm) {}
-
+ //Actor(Scumm *scumm) : _scumm(scumm) {}
+ void initActorClass(Scumm *scumm) {_scumm = scumm;}
//protected:
void hideActor();
void showActor();
diff --git a/init.cpp b/init.cpp
index ef46026ed2..f0917bab4a 100644
--- a/init.cpp
+++ b/init.cpp
@@ -22,11 +22,8 @@
#include"stdafx.h"
#include"scumm.h"
-#include "actor.h"
-
+#include"actor.h"
Scumm::Scumm (void) {
- /* No need to put anything here yet :) */
- actor = new Actor[MAX_ACTORS](this);
}
Scumm::~Scumm (void) {
diff --git a/scummvm.cpp b/scummvm.cpp
index 66b84d6ed0..08a851d38d 100644
--- a/scummvm.cpp
+++ b/scummvm.cpp
@@ -76,8 +76,11 @@ void Scumm::scummInit()
setShake(0);
setupCursor();
+ /* Allocate and initilise actors */
+ actor = new Actor[MAX_ACTORS];
for (i = 1, a = getFirstActor(); ++a, i < NUM_ACTORS; i++) {
a->number = i;
+ a->initActorClass(this);
a->initActor(1);
}
diff --git a/scummvm.dsp b/scummvm.dsp
index f2b929cf30..67db42827a 100644
--- a/scummvm.dsp
+++ b/scummvm.dsp
@@ -43,7 +43,7 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
-# ADD CPP /nologo /G6 /MD /W3 /O2 /Ob2 /I "." /I "sound" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "USE_ADLIB" /FD /c
+# ADD CPP /nologo /G6 /MD /W3 /O2 /Ob2 /I "." /I "sound" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "USE_ADLIB" /D "COMPRESSED_SOUND_FILE" /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE RSC /l 0x41d /d "NDEBUG"
# ADD RSC /l 0x41d /d "NDEBUG"
@@ -52,7 +52,8 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib sdl.lib winmm.lib wsock32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib sdl.lib winmm.lib wsock32.lib libmad.lib /nologo /subsystem:console /machine:I386
+# SUBTRACT LINK32 /nodefaultlib
!ELSEIF "$(CFG)" == "scummvm - Win32 Debug"
@@ -472,6 +473,10 @@ SOURCE=.\verbs.cpp
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
+SOURCE=.\actor.h
+# End Source File
+# Begin Source File
+
SOURCE=.\akos.h
# End Source File
# Begin Source File
diff --git a/sound.cpp b/sound.cpp
index 46631eb774..e53edc4e29 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -88,8 +88,8 @@ void Scumm::processSoundQues()
data[1], data[2], data[3], data[4], data[5], data[6], data[7]
);
#endif
- if ((_gameId == GID_DIG) && (data[0] == 12)){
- uint32 size, rate, tag, chan;
+ if ((_gameId == GID_DIG) && ((data[0] == 12) || (data[0] == 14))){
+ uint32 size, rate, tag, chan, bits;
uint8 * ptr = getResourceAddress(rtSound, data[1]);
if (ptr != NULL) {
ptr+=16; /* Skip header */
@@ -97,13 +97,15 @@ void Scumm::processSoundQues()
tag = READ_BE_UINT32(ptr); ptr+=4;
switch(tag) {
case MKID_BE('FRMT'):
- size = READ_BE_UINT32(ptr); ptr+=16;
+ size = READ_BE_UINT32(ptr); ptr+=12;
+ bits = READ_BE_UINT32(ptr); ptr+=4;
rate = READ_BE_UINT32(ptr); ptr+=4;
chan = READ_BE_UINT32(ptr); ptr+=4;
break;
case MKID_BE('TEXT'):
case MKID_BE('REGN'):
case MKID_BE('STOP'):
+ case MKID_BE('JUMP'):
size = READ_BE_UINT32(ptr); ptr+=size+4;
break;
case MKID_BE('DATA'):
@@ -116,25 +118,31 @@ void Scumm::processSoundQues()
}
if (chan == 1)
{
- uint32 s_size = (size * 2) / 3;
- byte * buffer = (byte*)malloc (s_size);
- uint32 l = 0, r = 0, tmp;
- memset (buffer, 0, s_size);
- for (; l < size - 1; l += 3)
- {
- tmp = (ptr[l + 1] & 0x0f) << 8;
- tmp = (tmp | ptr[l + 0]) << 4;
- tmp -= 0x8000;
-// buffer[r++] = (uint8)(tmp & 0xff);
- buffer[r++] = (uint8)((tmp >> 8) & 0xff);
-
- tmp = (ptr[l + 1] & 0xf0) << 4;
- tmp = (tmp | ptr[l + 2]) << 4;
- tmp -= 0x8000;
-// buffer[r++] = (uint8)(tmp & 0xff);
- buffer[r++] = (uint8)((tmp >> 8) & 0xff);
- }
- _mixer->play_raw(NULL, buffer, s_size, rate, SoundMixer::FLAG_AUTOFREE);
+ if (bits == 8) {
+ byte * buffer = (byte*)malloc (size);
+ memcpy(buffer, ptr, size);
+ _mixer->play_raw(NULL, buffer, size, rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED);
+ }
+ if (bits == 12) {
+ uint32 s_size = (size * 2) / 3;
+ byte * buffer = (byte*)malloc (s_size);
+ uint32 l = 0, r = 0, tmp;
+ for (; l < size; l += 3)
+ {
+ tmp = (ptr[l + 1] & 0x0f) << 8;
+ tmp = (tmp | ptr[l + 0]) << 4;
+ tmp -= 0x8000;
+// buffer[r++] = (uint8)(tmp & 0xff);
+ buffer[r++] = (uint8)((tmp >> 8) & 0xff);
+
+ tmp = (ptr[l + 1] & 0xf0) << 4;
+ tmp = (tmp | ptr[l + 2]) << 4;
+ tmp -= 0x8000;
+// buffer[r++] = (uint8)(tmp & 0xff);
+ buffer[r++] = (uint8)((tmp >> 8) & 0xff);
+ }
+ _mixer->play_raw(NULL, buffer, s_size, rate, SoundMixer::FLAG_AUTOFREE);
+ }
} else {
warning("DIG: ignoring stereo sample");
}
diff --git a/verbs.cpp b/verbs.cpp
index b4f86960ad..f96d005e7c 100644
--- a/verbs.cpp
+++ b/verbs.cpp
@@ -238,8 +238,8 @@ void Scumm::drawVerbBitmap(int vrb, int x, int y)
}
vst = &_verbs[vrb];
- vst->right = vst->x + imgw * 8;
- vst->bottom = vst->y + imgh * 8;
+ vst->right = vst->x + imgw * 8 - 1;
+ vst->bottom = vst->y + imgh * 8 - 1;
vst->oldleft = vst->x;
vst->oldright = vst->right;
vst->oldtop = vst->y;