aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudvig Strigeus2002-01-02 11:50:28 +0000
committerLudvig Strigeus2002-01-02 11:50:28 +0000
commit46dd55cf2a3697bb4ad710a71e5108e07c19a07d (patch)
treea9326aedd056195da520684befb04bb23be3a45f
parent03abddf888ccbf422b356d2cb62bf81318e2bc04 (diff)
downloadscummvm-rg350-46dd55cf2a3697bb4ad710a71e5108e07c19a07d.tar.gz
scummvm-rg350-46dd55cf2a3697bb4ad710a71e5108e07c19a07d.tar.bz2
scummvm-rg350-46dd55cf2a3697bb4ad710a71e5108e07c19a07d.zip
full throttle speech,
fixed two bugs appearing in DOTT svn-id: r3541
-rw-r--r--saveload.cpp1
-rw-r--r--script_v2.cpp4
-rw-r--r--scumm.h2
-rw-r--r--sound.cpp24
4 files changed, 17 insertions, 14 deletions
diff --git a/saveload.cpp b/saveload.cpp
index 94d0aac77a..7b3cbaedf2 100644
--- a/saveload.cpp
+++ b/saveload.cpp
@@ -352,6 +352,7 @@ void Scumm::saveOrLoad(Serializer *s) {
#endif
MKLINE(Scumm,_actorToPrintStrFor,sleByte),
MKLINE(Scumm,_charsetColor,sleByte),
+ /* XXX Convert into word next time format changes */
MKLINE(Scumm,charset._bufPos,sleByte),
MKLINE(Scumm,_haveMsg,sleByte),
MKLINE(Scumm,_useTalkAnims,sleByte),
diff --git a/script_v2.cpp b/script_v2.cpp
index 09140c17d2..2621d2a00b 100644
--- a/script_v2.cpp
+++ b/script_v2.cpp
@@ -1319,9 +1319,9 @@ void Scumm::o6_roomOps() {
b = pop();
a = pop();
if (a < 160) a=160;
- if (a > _scrWidth) a=_scrWidth;
if (b < 160) b=160;
- if (b > _scrHeight) b=_scrHeight;
+ if (a > _scrWidth-160) a=_scrWidth-160;
+ if (b > _scrWidth-160) b=_scrWidth-160;
_vars[VAR_CAMERA_MIN_X] = a;
_vars[VAR_CAMERA_MAX_X] = b;
break;
diff --git a/scumm.h b/scumm.h
index 1a5636f734..74fdf7bd30 100644
--- a/scumm.h
+++ b/scumm.h
@@ -558,7 +558,7 @@ struct CharsetRenderer {
int _xpos2, _ypos2;
- byte _bufPos;
+ int _bufPos;
byte _unk12,_disableOffsX;
byte *_ptr;
byte _unk2, _bpp;
diff --git a/sound.cpp b/sound.cpp
index 73c7ff235a..ffcb6e6518 100644
--- a/sound.cpp
+++ b/sound.cpp
@@ -303,27 +303,29 @@ void Scumm::pauseSounds(bool pause) {
_soundsPaused = pause;
}
-#pragma START_PACK_STRUCTS
-struct VOCHeader {
- byte id[19];
- byte extra[7];
-} GCC_PACK;
-#pragma END_PACK_STRUCTS
+enum {
+ SOUND_HEADER_SIZE = 26,
+ SOUND_HEADER_BIG_SIZE = 26+8,
-static const char VALID_VOC_ID[] = "Creative Voice File";
+};
void Scumm::startSfxSound(void *file) {
- VOCHeader hdr;
+ char ident[8];
int block_type;
byte work[8];
uint size,i;
int rate,comp;
byte *data;
- /* Full throttle audio fix HERE */
+ if ( fread(ident, 8, 1, (FILE*)file) != 1)
+ goto invalid;
- if (fread(&hdr, sizeof(hdr), 1, (FILE*)file) != 1 ||
- memcmp(hdr.id, VALID_VOC_ID, sizeof(hdr.id)) != 0) {
+ if (!memcmp(ident, "VTLK", 4)) {
+ fseek((FILE*)file, SOUND_HEADER_BIG_SIZE - 8, SEEK_CUR);
+ } else if (!memcmp(ident, "Creative", 8)) {
+ fseek((FILE*)file, SOUND_HEADER_SIZE - 8, SEEK_CUR);
+ } else {
+invalid:;
warning("startSfxSound: invalid header");
return;
}