o Fix regression with Win32 CD ITE at wyrmkeep logo

o Support for sprites in Mac versions
o Improvements on scene flags
o More code on proper interface modes handling. Just a tiny bit was committed
  as other stuff breaks intro due to incompleteness.

svn-id: r16425
This commit is contained in:
Eugene Sandulenko 2005-01-04 17:15:53 +00:00
parent cceee73b85
commit dee9b3bd87
6 changed files with 58 additions and 57 deletions

View File

@ -139,24 +139,24 @@ enum GAME_IDS {
GID_ITE_DISK_DE,
GID_ITE_AMIGACD_DE, // TODO
GID_ITE_OLDMAC_DE, // TODO
GID_ITE_AMIGA_FL_DE,
GID_ITE_AMIGA_FL_DE,// TODO
GID_ITE_CD_DE, // don't have it
GID_ITE_AMIGA_AGA_DEMO,
GID_ITE_AMIGA_ECS_DEMO,
GID_ITE_AMIGA_AGA_DEMO, // TODO
GID_ITE_AMIGA_ECS_DEMO, // TODO
GID_IHNM_DEMO,
GID_IHNM_CD
};
enum GAME_FILETYPES {
GAME_RESOURCEFILE = 0x01,
GAME_SCRIPTFILE = 0x02,
GAME_SOUNDFILE = 0x04,
GAME_VOICEFILE = 0x08,
GAME_DEMOFILE = 0x10,
GAME_MUSICFILE = 0x20,
GAME_MUSICFILE_GM = 0x40,
GAME_MUSICFILE_FM = 0x80
GAME_RESOURCEFILE = 1 << 0,
GAME_SCRIPTFILE = 1 << 1,
GAME_SOUNDFILE = 1 << 2,
GAME_VOICEFILE = 1 << 3,
GAME_DEMOFILE = 1 << 4,
GAME_MUSICFILE = 1 << 5,
GAME_MUSICFILE_GM = 1 << 6,
GAME_MUSICFILE_FM = 1 << 7
};
enum GAME_SOUNDINFO_TYPES {
@ -177,11 +177,11 @@ enum GAME_FONT_IDS {
};
enum GAME_FEATURES {
GF_VOX_VOICES = 1,
GF_BIG_ENDIAN_DATA = 2,
GF_MAC_RESOURCES = 4,
GF_LANG_DE = 8,
GF_WYRMKEEP = 16
GF_VOX_VOICES = 1 << 0,
GF_BIG_ENDIAN_DATA = 1 << 1,
GF_MAC_RESOURCES = 1 << 2,
GF_LANG_DE = 1 << 3,
GF_WYRMKEEP = 1 << 4
};
struct GAME_DISPLAYINFO {

View File

@ -678,6 +678,9 @@ int Scene::loadScene(int scene_num, int load_flag, SCENE_PROC scene_proc, SCENE_
_vm->_actor->updateActorsScene();
if (_desc.flags & kSceneFlagShowCursor)
_vm->_interface->activate();
return SUCCESS;
}

View File

@ -209,6 +209,11 @@ struct INTRO_CREDIT {
};
enum SceneFlags {
kSceneFlagISO = 1,
kSceneFlagShowCursor = 2
};
class Scene {
public:
Scene(SagaEngine *vm);
@ -228,6 +233,7 @@ class Scene {
int queueScene(SCENE_QUEUE *scene_queue);
int draw(SURFACE *);
int getMode();
int getFlags() { return _desc.flags; }
void getBGMaskInfo(int &width, int &height, byte *&buffer, size_t &bufferLength);
int isBGMaskPresent() {

View File

@ -98,7 +98,10 @@ int Sprite::loadList(int resource_num, SPRITELIST **sprite_list_p) {
for (i = 0; i < sprite_count; i++) {
new_slist->offset_list[i].data_idx = 0;
new_slist->offset_list[i].offset = readS.readUint16();
if (_vm->_features & GF_MAC_RESOURCES)
new_slist->offset_list[i].offset = readS.readUint32();
else
new_slist->offset_list[i].offset = readS.readUint16();
}
new_slist->slist_rn = resource_num;
@ -200,7 +203,7 @@ int Sprite::draw(SURFACE *ds, SPRITELIST *sprite_list, int sprite_num, const Poi
assert(sprite_p);
MemoryReadStreamEndian readS(sprite_p, 8, IS_BIG_ENDIAN);
MemoryReadStream readS(sprite_p, 8);
if (!(_vm->_features & GF_MAC_RESOURCES)) {
x_align = readS.readSByte();
y_align = readS.readSByte();
@ -208,11 +211,11 @@ int Sprite::draw(SURFACE *ds, SPRITELIST *sprite_list, int sprite_num, const Poi
so_width = s_width = readS.readByte();
so_height = s_height = readS.readByte();
} else {
x_align = readS.readSint16();
y_align = readS.readSint16();
x_align = readS.readSint16BE();
y_align = readS.readSint16BE();
so_width = s_width = readS.readUint16();
so_height = s_height = readS.readUint16();
so_width = s_width = readS.readUint16BE();
so_height = s_height = readS.readUint16BE();
}
spr_pt.x = screenCoord.x + x_align;
spr_pt.y = screenCoord.y + y_align;
@ -314,15 +317,23 @@ int Sprite::drawOccluded(SURFACE *ds, SPRITELIST *sprite_list, int sprite_num, c
sprite_p = sprite_list->sprite_data[offset_idx];
sprite_p += offset;
MemoryReadStreamEndian readS(sprite_p, 5, IS_BIG_ENDIAN);
MemoryReadStream readS(sprite_p, 8);
// Read sprite dimensions -- should probably cache this stuff in
// sprite list
x_align = readS.readSByte();
y_align = readS.readSByte();
if (!(_vm->_features & GF_MAC_RESOURCES)) {
x_align = readS.readSByte();
y_align = readS.readSByte();
so_width = s_width = readS.readByte();
so_height = s_height = readS.readByte();
so_width = s_width = readS.readByte();
so_height = s_height = readS.readByte();
} else {
x_align = readS.readSint16BE();
y_align = readS.readSint16BE();
so_width = s_width = readS.readUint16BE();
so_height = s_height = readS.readUint16BE();
}
sprite_data_p = sprite_p + readS.pos();
@ -384,48 +395,29 @@ int Sprite::drawOccluded(SURFACE *ds, SPRITELIST *sprite_list, int sprite_num, c
mask_row_p += maskWidth;
src_row_p += s_width;
}
/*
{
char buf[1024] = { 0 };
sprintf(buf, "dw: %d, dh: %d.", ci.draw_w, ci.draw_h);
_vm->textDraw(2, ds, buf, spr_x - x_align, spr_y - y_align, 255, 0, FONT_OUTLINE);
}
*/
return SUCCESS;
}
int Sprite::decodeRLESprite(const byte *inbuf, size_t inbuf_len, byte *outbuf, size_t outbuf_len) {
int bg_runcount;
int fg_runcount;
const byte *inbuf_ptr;
byte *outbuf_ptr;
const byte *inbuf_end;
byte *outbuf_end;
int c;
inbuf_ptr = inbuf;
outbuf_ptr = outbuf;
inbuf_end = inbuf + (inbuf_len);
inbuf_end--;
outbuf_end = outbuf + outbuf_len;
outbuf_end--;
memset(outbuf, 0, outbuf_len);
while ((inbuf_ptr < inbuf_end) && (outbuf_ptr < outbuf_end)) {
bg_runcount = *inbuf_ptr;
if (inbuf_ptr < inbuf_end)
inbuf_ptr++;
else
return 0;
fg_runcount = *inbuf_ptr;
if (inbuf_ptr < inbuf_end)
inbuf_ptr++;
else
return 0;
MemoryReadStream readS(inbuf, inbuf_len);
while (!readS.eof() && (outbuf_ptr < outbuf_end)) {
bg_runcount = readS.readByte();
fg_runcount = readS.readByte();
for (c = 0; c < bg_runcount; c++) {
*outbuf_ptr = (byte) 0;
@ -436,11 +428,7 @@ int Sprite::decodeRLESprite(const byte *inbuf, size_t inbuf_len, byte *outbuf, s
}
for (c = 0; c < fg_runcount; c++) {
*outbuf_ptr = *inbuf_ptr;
if (inbuf_ptr < inbuf_end)
inbuf_ptr++;
else
return 0;
*outbuf_ptr = readS.readByte();
if (outbuf_ptr < outbuf_end)
outbuf_ptr++;
else

View File

@ -45,7 +45,7 @@ struct SPRITELIST_ENTRY {
struct SPRITELIST_OFFSET {
uint16 data_idx;
size_t offset;
uint32 offset;
};
struct SPRITELIST {

View File

@ -115,3 +115,7 @@ Resource.h
PicHeader.width IMAGE_HEADER.width
PicHeader.height IMAGE_HEADER.height
Process.c
=========
mainPanelMode Interface::_inMainMode