aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-11-27 07:34:19 +0000
committerTorbjörn Andersson2003-11-27 07:34:19 +0000
commit6f23e2c2117925aa743155c3fd515144177efbbf (patch)
tree1e52b4cd7bf97e608fc029b4f26577c8cce2c8a1 /sword2
parente72a17c67823d088a6bf139e49f25db745f005de (diff)
downloadscummvm-rg350-6f23e2c2117925aa743155c3fd515144177efbbf.tar.gz
scummvm-rg350-6f23e2c2117925aa743155c3fd515144177efbbf.tar.bz2
scummvm-rg350-6f23e2c2117925aa743155c3fd515144177efbbf.zip
Mostly whitespace changes, but also a few modifications to the still
experimental resource dumping code. svn-id: r11382
Diffstat (limited to 'sword2')
-rw-r--r--sword2/build_display.cpp2
-rw-r--r--sword2/console.cpp2
-rw-r--r--sword2/defs.h2
-rw-r--r--sword2/icons.cpp2
-rw-r--r--sword2/interpreter.cpp2
-rw-r--r--sword2/logic.cpp2
-rw-r--r--sword2/maketext.cpp2
-rw-r--r--sword2/mem_view.cpp2
-rw-r--r--sword2/memory.cpp4
-rw-r--r--sword2/protocol.cpp4
-rw-r--r--sword2/resman.cpp18
-rw-r--r--sword2/save_rest.cpp4
12 files changed, 26 insertions, 20 deletions
diff --git a/sword2/build_display.cpp b/sword2/build_display.cpp
index 25de2b0a14..fe611781cd 100644
--- a/sword2/build_display.cpp
+++ b/sword2/build_display.cpp
@@ -431,7 +431,7 @@ void Sword2Engine::processImage(buildit *build_unit) {
spriteType |= RDSPR_RLE16;
// points to just after last cdt_entry, ie.
// start of colour table
- colTablePtr = (uint8*) (anim_head + 1) + anim_head->noAnimFrames * sizeof(_cdtEntry);
+ colTablePtr = (uint8 *) (anim_head + 1) + anim_head->noAnimFrames * sizeof(_cdtEntry);
break;
}
}
diff --git a/sword2/console.cpp b/sword2/console.cpp
index 2648099bb0..a7461107b7 100644
--- a/sword2/console.cpp
+++ b/sword2/console.cpp
@@ -562,7 +562,7 @@ bool Debugger::Cmd_Version(int argc, const char **argv) {
char dateStamp[255];
char version[6];
- strcpy(version, (char*) version_string + HEAD_LEN);
+ strcpy(version, (char *) version_string + HEAD_LEN);
*(((unsigned char *) &t)) = *(version_string + 14);
*(((unsigned char *) &t) + 1) = *(version_string + 15);
*(((unsigned char *) &t) + 2) = *(version_string + 16);
diff --git a/sword2/defs.h b/sword2/defs.h
index 2275a02901..29f7022d20 100644
--- a/sword2/defs.h
+++ b/sword2/defs.h
@@ -100,7 +100,7 @@
// for the poor PSX so it knows what language is running.
// #define GAME_LANGUAGE VAR(111)
-//resource id's of pouse mointers. It's pretty much safe to do it like this
+// resource id's of pouse mointers. It's pretty much safe to do it like this
#define NORMAL_MOUSE_ID 17
#define SCROLL_LEFT_MOUSE_ID 1440
diff --git a/sword2/icons.cpp b/sword2/icons.cpp
index 34cf0280a1..9502f88082 100644
--- a/sword2/icons.cpp
+++ b/sword2/icons.cpp
@@ -84,7 +84,7 @@ void Sword2Engine::buildMenu(void) {
// objects. Run the 'build_menu' script in the 'menu_master' object
head = _resman->openResource(MENU_MASTER_OBJECT);
- _logic->runScript((char*) head, (char*) head, &null_pc);
+ _logic->runScript((char *) head, (char *) head, &null_pc);
_resman->closeResource(MENU_MASTER_OBJECT);
// Compare new with old. Anything in master thats not in new gets
diff --git a/sword2/interpreter.cpp b/sword2/interpreter.cpp
index dd42a07290..105b847c49 100644
--- a/sword2/interpreter.cpp
+++ b/sword2/interpreter.cpp
@@ -519,7 +519,7 @@ int Logic::runScript(char *scriptData, char *objectData, uint32 *offset) {
break;
case OP_ANDAND:
// '&&'
- debug(5, "%d != %d -> %d",
+ debug(5, "%d && %d -> %d",
stack2[stackPointer2 - 2],
stack2[stackPointer2 - 1],
stack2[stackPointer2 - 2] && stack2[stackPointer2 - 1]);
diff --git a/sword2/logic.cpp b/sword2/logic.cpp
index 5a85ad7698..f82f6d02e9 100644
--- a/sword2/logic.cpp
+++ b/sword2/logic.cpp
@@ -123,7 +123,7 @@ int Logic::processSession(void) {
raw_data_ad = (char *) head;
- far_head = (_standardHeader*) _vm->_resman->openResource(script / SIZE);
+ far_head = (_standardHeader *) _vm->_resman->openResource(script / SIZE);
if (far_head->fileType != GAME_OBJECT && far_head->fileType != SCREEN_MANAGER)
error("Logic_engine %d not a far object (its a %d)", script / SIZE, far_head->fileType);
diff --git a/sword2/maketext.cpp b/sword2/maketext.cpp
index 65c0eddd2b..4918b7a523 100644
--- a/sword2/maketext.cpp
+++ b/sword2/maketext.cpp
@@ -497,7 +497,7 @@ void FontRenderer::printTextBlocs(void) {
for (j = 0; j < MAX_text_blocs; j++) {
if (_blocList[j].text_mem) {
- frame = (_frameHeader*) _blocList[j].text_mem->ad;
+ frame = (_frameHeader *) _blocList[j].text_mem->ad;
spriteInfo.x = _blocList[j].x;
spriteInfo.y = _blocList[j].y;
diff --git a/sword2/mem_view.cpp b/sword2/mem_view.cpp
index 3a1bf166c0..25162c1cd6 100644
--- a/sword2/mem_view.cpp
+++ b/sword2/mem_view.cpp
@@ -38,7 +38,7 @@ void MemoryManager::displayMemory(void) {
j = _baseMemBlock;
do {
if (_memList[j].uid < 65536) {
- file_header = (_standardHeader*) _vm->_resman->openResource(_memList[j].uid);
+ file_header = (_standardHeader *) _vm->_resman->openResource(_memList[j].uid);
// close immediately so give a true count
_vm->_resman->closeResource(_memList[j].uid);
diff --git a/sword2/memory.cpp b/sword2/memory.cpp
index e23f8eb402..626764857a 100644
--- a/sword2/memory.cpp
+++ b/sword2/memory.cpp
@@ -372,8 +372,8 @@ int32 MemoryManager::defragMemory(uint32 req_size) {
// block
// memcpy(_memList[cur_block].ad, _memList[child].ad, _memList[child].size);
- a = (uint32*) _memList[cur_block].ad;
- b = (uint32*) _memList[child].ad;
+ a = (uint32 *) _memList[cur_block].ad;
+ b = (uint32 *) _memList[child].ad;
for (j = 0; j < _memList[child].size / 4; j++)
*(a++) = *(b++);
diff --git a/sword2/protocol.cpp b/sword2/protocol.cpp
index e8b43b5eca..1c21a6632c 100644
--- a/sword2/protocol.cpp
+++ b/sword2/protocol.cpp
@@ -64,7 +64,7 @@ uint8 *Sword2Engine::fetchPaletteMatchTable(uint8 *screenFile) {
_screenHeader *Sword2Engine::fetchScreenHeader(uint8 *screenFile) {
_multiScreenHeader *mscreenHeader = (_multiScreenHeader *) (screenFile + sizeof(_standardHeader));
- _screenHeader *screenHeader = (_screenHeader*) ((uint8 *) mscreenHeader + mscreenHeader->screen);
+ _screenHeader *screenHeader = (_screenHeader *) ((uint8 *) mscreenHeader + mscreenHeader->screen);
return screenHeader;
}
@@ -184,7 +184,7 @@ uint8 *Sword2Engine::fetchTextLine(uint8 *file, uint32 text_line) {
_textHeader *text_header = (_textHeader *) (file + sizeof(_standardHeader));
if (text_line >= text_header->noOfLines) {
- fileHeader = (_standardHeader*)file;
+ fileHeader = (_standardHeader *) file;
sprintf((char *) errorLine, "xxMissing line %d of %s (only 0..%d)", text_line, fileHeader->name, text_header->noOfLines - 1);
diff --git a/sword2/resman.cpp b/sword2/resman.cpp
index 3b7a05f383..e1d49c9472 100644
--- a/sword2/resman.cpp
+++ b/sword2/resman.cpp
@@ -253,7 +253,7 @@ void convertEndian(uint8 *file, uint32 len) {
SWAP32(mscreenHeader->maskOffset);
// screenHeader
- _screenHeader *screenHeader = (_screenHeader*) (file + mscreenHeader->screen);
+ _screenHeader *screenHeader = (_screenHeader *) (file + mscreenHeader->screen);
SWAP16(screenHeader->width);
SWAP16(screenHeader->height);
@@ -312,7 +312,7 @@ void convertEndian(uint8 *file, uint32 len) {
break;
}
case GAME_OBJECT: {
- _object_hub *objectHub = (_object_hub *)file;
+ _object_hub *objectHub = (_object_hub *) file;
objectHub->type = (int)SWAP_BYTES_32(objectHub->type);
SWAP32(objectHub->logic_level);
@@ -325,7 +325,7 @@ void convertEndian(uint8 *file, uint32 len) {
break;
}
case WALK_GRID_FILE: {
- _walkGridHeader *walkGridHeader = (_walkGridHeader *)file;
+ _walkGridHeader *walkGridHeader = (_walkGridHeader *) file;
SWAP32(walkGridHeader->numBars);
SWAP32(walkGridHeader->numNodes);
@@ -499,18 +499,24 @@ uint8 *ResourceManager::openResource(uint32 res, bool dump) {
case MOUSE_FILE:
strcpy(tag, "mouse");
break;
+ case WAV_FILE:
+ strcpy(tag, "wav");
+ break;
case ICON_FILE:
strcpy(tag, "icon");
break;
+ case PALETTE_FILE:
+ strcpy(tag, "palette");
+ break;
default:
strcpy(tag, "unknown");
break;
}
#if defined(MACOS_CARBON)
- sprintf(buf, ":dumps:%s-%d", tag, res);
+ sprintf(buf, ":dumps:%s-%d.dmp", tag, res);
#else
- sprintf(buf, "dumps/%s-%d", tag, res);
+ sprintf(buf, "dumps/%s-%d.dmp", tag, res);
#endif
out.open(buf, "");
@@ -909,7 +915,7 @@ void ResourceManager::killAllObjects(bool wantInfo) {
//not the global vars which are assumed to be open in
// memory & not the player object!
if (res != 1 && res != CUR_PLAYER_ID) {
- header = (_standardHeader*) openResource(res);
+ header = (_standardHeader *) openResource(res);
closeResource(res);
if (header->fileType == GAME_OBJECT) {
diff --git a/sword2/save_rest.cpp b/sword2/save_rest.cpp
index 218ed27d9e..ad24b215f4 100644
--- a/sword2/save_rest.cpp
+++ b/sword2/save_rest.cpp
@@ -464,7 +464,7 @@ void Sword2Engine::getPlayerStructures(void) {
char *raw_script_ad;
_standardHeader *head;
- head = (_standardHeader*) _resman->openResource(CUR_PLAYER_ID);
+ head = (_standardHeader *) _resman->openResource(CUR_PLAYER_ID);
if (head->fileType != GAME_OBJECT)
error("incorrect CUR_PLAYER_ID=%d", CUR_PLAYER_ID);
@@ -483,7 +483,7 @@ void Sword2Engine::putPlayerStructures(void) {
char *raw_script_ad;
_standardHeader *head;
- head = (_standardHeader*) _resman->openResource(CUR_PLAYER_ID);
+ head = (_standardHeader *) _resman->openResource(CUR_PLAYER_ID);
if (head->fileType != GAME_OBJECT)
error("incorrect CUR_PLAYER_ID=%d", CUR_PLAYER_ID);