aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorEugene Sandulenko2004-08-11 18:02:03 +0000
committerEugene Sandulenko2004-08-11 18:02:03 +0000
commit39137da10d4c8c18c0c0a6b30351459d1654a6c2 (patch)
tree6793ad218d6b01a4634abf0154bd6972001bbf0a /saga
parent23d5d1fb8235ced4e29bb0b771ba6aa972a46ad1 (diff)
downloadscummvm-rg350-39137da10d4c8c18c0c0a6b30351459d1654a6c2.tar.gz
scummvm-rg350-39137da10d4c8c18c0c0a6b30351459d1654a6c2.tar.bz2
scummvm-rg350-39137da10d4c8c18c0c0a6b30351459d1654a6c2.zip
Fix scene description structure data types and rename it.
svn-id: r14556
Diffstat (limited to 'saga')
-rw-r--r--saga/scene.cpp50
-rw-r--r--saga/scene.h25
-rw-r--r--saga/sprite.cpp2
-rw-r--r--saga/xref.txt8
4 files changed, 46 insertions, 39 deletions
diff --git a/saga/scene.cpp b/saga/scene.cpp
index 2e62875afa..0218a2fb01 100644
--- a/saga/scene.cpp
+++ b/saga/scene.cpp
@@ -335,8 +335,8 @@ int Scene::getMode() {
int Scene::getZInfo(SCENE_ZINFO *zinfo) {
assert(_initialized);
- zinfo->begin_slope = _desc.begin_slope;
- zinfo->end_slope = _desc.end_slope;
+ zinfo->beginSlope = _desc.beginSlope;
+ zinfo->endSlope = _desc.endSlope;
return R_SUCCESS;
}
@@ -436,11 +436,11 @@ int Scene::loadScene(int scene_num, int load_flag, R_SCENE_PROC scene_proc, R_SC
break;
case BY_DESC:
assert(scene_desc_param != NULL);
- assert(scene_desc_param->res_list != NULL);
+ assert(scene_desc_param->resList != NULL);
_loadDesc = false;
_desc = *scene_desc_param;
- _resList = scene_desc_param->res_list;
- _resListEntries = scene_desc_param->res_list_ct;
+ _resList = scene_desc_param->resList;
+ _resListEntries = scene_desc_param->resListCnt;
break;
default:
warning("Scene::loadScene(): Error: Invalid scene load flag");
@@ -460,7 +460,7 @@ int Scene::loadScene(int scene_num, int load_flag, R_SCENE_PROC scene_proc, R_SC
return R_FAILURE;
}
- if (loadSceneResourceList(_desc.res_list_rn) != R_SUCCESS) {
+ if (loadSceneResourceList(_desc.resListRN) != R_SUCCESS) {
warning("Scene::loadScene(): Error reading scene resource list");
return R_FAILURE;
}
@@ -485,8 +485,8 @@ int Scene::loadScene(int scene_num, int load_flag, R_SCENE_PROC scene_proc, R_SC
}
// Load scene script data
- if (_desc.script_num > 0) {
- if (_vm->_script->loadScript(_desc.script_num) != R_SUCCESS) {
+ if (_desc.scriptNum > 0) {
+ if (_vm->_script->loadScript(_desc.scriptNum) != R_SUCCESS) {
warning("Scene::loadScene(): Error loading scene script");
return R_FAILURE;
}
@@ -525,14 +525,14 @@ int Scene::loadSceneDescriptor(uint32 res_number) {
MemoryReadStream readS(scene_desc_data, scene_desc_len);
- _desc.unknown0 = readS.readUint16LE();
- _desc.res_list_rn = readS.readUint16LE();
- _desc.end_slope = readS.readUint16LE();
- _desc.begin_slope = readS.readUint16LE();
- _desc.script_num = readS.readUint16LE();
- _desc.scene_scriptnum = readS.readUint16LE();
- _desc.start_scriptnum = readS.readUint16LE();
- _desc.music_rn = readS.readSint16LE();
+ _desc.flags = readS.readSint16LE();
+ _desc.resListRN = readS.readSint16LE();
+ _desc.endSlope = readS.readSint16LE();
+ _desc.beginSlope = readS.readSint16LE();
+ _desc.scriptNum = readS.readUint16LE();
+ _desc.sceneScriptNum = readS.readUint16LE();
+ _desc.startScriptNum = readS.readUint16LE();
+ _desc.musicRN = readS.readSint16LE();
RSC_FreeResource(scene_desc_data);
@@ -779,7 +779,7 @@ int Scene::endScene() {
_sceneProc(SCENE_END, &scene_info);
- if (_desc.script_num > 0) {
+ if (_desc.scriptNum > 0) {
_vm->_script->freeScript();
}
@@ -853,14 +853,14 @@ void Scene::sceneInfoCmd(int argc, char *argv[]) {
_vm->_console->print(fmt, "Scene number:", _sceneNumber);
_vm->_console->print(fmt, "Descriptor R#:", _sceneResNum);
_vm->_console->print("-------------------------");
- _vm->_console->print(fmt, "Unknown:", _desc.unknown0);
- _vm->_console->print(fmt, "Resource list R#:", _desc.res_list_rn);
- _vm->_console->print(fmt, "End slope:", _desc.end_slope);
- _vm->_console->print(fmt, "Begin slope:", _desc.begin_slope);
- _vm->_console->print(fmt, "Script resource:", _desc.script_num);
- _vm->_console->print(fmt, "Scene script:", _desc.scene_scriptnum);
- _vm->_console->print(fmt, "Start script:", _desc.start_scriptnum);
- _vm->_console->print(fmt, "Music R#", _desc.music_rn);
+ _vm->_console->print(fmt, "Flags:", _desc.flags);
+ _vm->_console->print(fmt, "Resource list R#:", _desc.resListRN);
+ _vm->_console->print(fmt, "End slope:", _desc.endSlope);
+ _vm->_console->print(fmt, "Begin slope:", _desc.beginSlope);
+ _vm->_console->print(fmt, "Script resource:", _desc.scriptNum);
+ _vm->_console->print(fmt, "Scene script:", _desc.sceneScriptNum);
+ _vm->_console->print(fmt, "Start script:", _desc.startScriptNum);
+ _vm->_console->print(fmt, "Music R#", _desc.musicRN);
}
static void CF_sceneinfo(int argc, char *argv[], void *refCon) {
diff --git a/saga/scene.h b/saga/scene.h
index acf7515fca..895ee88206 100644
--- a/saga/scene.h
+++ b/saga/scene.h
@@ -37,9 +37,8 @@ enum R_SCENE_MODES {
};
struct SCENE_ZINFO {
- int begin_slope;
- int end_slope;
-
+ int beginSlope;
+ int endSlope;
};
struct SCENE_BGINFO {
@@ -105,16 +104,16 @@ struct R_SCENE_RESLIST {
#define SAGA_SCENE_DESC_LEN 16
struct R_SCENE_DESC {
- int unknown0;
- int res_list_rn;
- int end_slope;
- int begin_slope;
- int script_num;
- int scene_scriptnum;
- int start_scriptnum;
- int music_rn;
- R_SCENE_RESLIST *res_list;
- size_t res_list_ct;
+ int16 flags;
+ int16 resListRN;
+ int16 endSlope;
+ int16 beginSlope;
+ uint16 scriptNum;
+ uint16 sceneScriptNum;
+ uint16 startScriptNum;
+ int16 musicRN;
+ R_SCENE_RESLIST *resList;
+ size_t resListCnt;
};
struct SCENE_IMAGE {
diff --git a/saga/sprite.cpp b/saga/sprite.cpp
index 0db7a62a21..3ded76cd57 100644
--- a/saga/sprite.cpp
+++ b/saga/sprite.cpp
@@ -319,7 +319,7 @@ int Sprite::drawOccluded(R_SURFACE *ds, R_SPRITELIST *sprite_list, int sprite_nu
// Create actor Z occlusion LUT
_vm->_scene->getZInfo(&zinfo);
- e_slope = zinfo.end_slope;
+ e_slope = zinfo.endSlope;
for (i = 0; i < R_SPRITE_ZMAX; i++) {
z_lut[i] = (int)(e_slope + ((137.0 - e_slope) / 14.0) * (15.0 - i));
diff --git a/saga/xref.txt b/saga/xref.txt
index be00667c3e..eb81a22904 100644
--- a/saga/xref.txt
+++ b/saga/xref.txt
@@ -38,3 +38,11 @@ Sceneres.h
Scene.c
=======
ResToImage() _vm->decodeBGImage()
+ resInfo->sceneFlags _desc.flags
+ resInfo->loadList _desc.resListRN
+ resInfo->horizon _desc.endSlope
+ resInfo->nearFigureLimit _desc.beginSlope
+ resInfo->scriptModule _desc.scriptNum
+ resInfo->entryScript _desc.sceneScriptNum
+ resInfo->preScript _desc.startScriptNum
+ resInfo->backgroundMusic _desc.musicRN