Minor cleanup

svn-id: r21671
This commit is contained in:
Travis Howell 2006-04-07 14:40:33 +00:00
parent 0c496f92a9
commit 65a3f88454
5 changed files with 17 additions and 21 deletions

View File

@ -202,12 +202,11 @@ void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint
if (getGameType() == GType_FF) {
WRITE_LE_UINT16(p + 4, height);
WRITE_LE_UINT16(p + 6, width);
dst += READ_LE_UINT32(p);
} else {
WRITE_BE_UINT16(p + 4, height);
WRITE_BE_UINT16(p + 6, width);
dst += READ_BE_UINT32(p);
}
dst += readUint32Wrapper(p);
memset(dst, 0, count);
if (_language == Common::HB_ISR)

View File

@ -595,7 +595,7 @@ void SimonEngine::o1_oset() {
SubObject *subObject = (SubObject *)findChildOfType(getNextItemPtr(), 2);
int value = getVarOrByte();
if (subObject != NULL && value >= 0x10)
subObject->objectFlags |= 1 << value;
subObject->objectFlags |= (1 << value);
}
void SimonEngine::o1_oclear() {
@ -881,13 +881,13 @@ void SimonEngine::o1_addBox() {
id = id % 1000;
if (params & 1)
flags |= 8;
flags |= kBFInvertTouch;
if (params & 2)
flags |= 4;
flags |= kBFNoTouchName;
if (params & 4)
flags |= 0x80;
flags |= kBFBoxItem;
if (params & 8)
flags |= 1;
flags |= kBFTextBox;
if (params & 16)
flags |= 0x10;

View File

@ -468,7 +468,7 @@ void SimonEngine::o_fileError(WindowBlock *window, bool save_error) {
ha->y = (window->height << 3) + window->y - 8;
ha->width = 48;
ha->height = 8;
ha->flags = 0x20;
ha->flags = kBFBoxInUse;
ha->id = 0x7FFF;
ha->priority = 0x3EF;
@ -541,7 +541,7 @@ bool SimonEngine::saveGame(uint slot, char *caption) {
i = subObject->objectFlags & 1;
for (j = 1; j < 16; j++) {
if ((1 << j) & subObject->objectFlags) {
if (subObject->objectFlags & (1 << j)) {
f->writeUint16BE(subObject->objectFlagValue[i++]);
}
}
@ -670,7 +670,7 @@ bool SimonEngine::loadGame(uint slot) {
i = subObject->objectFlags & 1;
for (j = 1; j < 16; j++) {
if ((1 << j) & subObject->objectFlags) {
if (subObject->objectFlags & (1 << j)) {
subObject->objectFlagValue[i++] = f->readUint16BE();
}
}

View File

@ -1642,7 +1642,7 @@ void SimonEngine::setup_cond_c_helper() {
inventoryDown(_lastHitArea->window);
} else if (_lastHitArea->item_ptr != NULL) {
_hitAreaObjectItem = _lastHitArea->item_ptr;
_variableArray[60] = (_lastHitArea->flags & 1) ? (_lastHitArea->flags / 256) : 0xFFFF;
_variableArray[60] = (_lastHitArea->flags & kBFTextBox) ? (_lastHitArea->flags / 256) : 0xFFFF;
break;
}
}
@ -1790,14 +1790,14 @@ get_out:
bool SimonEngine::has_item_childflag_0x10(Item *item) {
SubObject *child = (SubObject *)findChildOfType(item, 2);
return child && (child->objectFlags & 0x10) != 0;
return child && (child->objectFlags & kOFIcon) != 0;
}
uint SimonEngine::itemGetIconNumber(Item *item) {
SubObject *child = (SubObject *)findChildOfType(item, 2);
uint offs;
if (child == NULL || !(child->objectFlags & 0x10))
if (child == NULL || !(child->objectFlags & kOFIcon))
return 0;
offs = getOffsetOfChild2Param(child, 0x10);
@ -2705,13 +2705,11 @@ void SimonEngine::scrollEvent() {
x += (getGameType() == GType_FF) ? 648 : 41;
}
if (getGameType() == GType_FF) {
if (getGameType() == GType_FF)
src = _scrollImage + x / 2;
decodeStripA(dst, src + READ_LE_UINT32(src), _scrollHeight);
} else {
else
src = _scrollImage + x * 4;
decodeStripA(dst, src + READ_BE_UINT32(src), _scrollHeight);
}
decodeStripA(dst, src + readUint32Wrapper(src), _scrollHeight);
memcpy(_sdl_buf_attached, _sdl_buf, _screenWidth * _screenHeight);
dx_copy_from_attached_to_3(_scrollHeight);

View File

@ -684,13 +684,12 @@ void SimonEngine::vc10_draw() {
state.image = vcReadVar(-state.image);
p2 = _curVgaFile2 + state.image * 8;
state.depack_src = _curVgaFile2 + readUint32Wrapper(p2);
if (getGameType() == GType_FF) {
state.depack_src = _curVgaFile2 + READ_LE_UINT32(p2);
width = READ_LE_UINT16(p2 + 6);
height = READ_LE_UINT16(p2 + 4) & 0x7FFF;
flags = p2[5];
} else {
state.depack_src = _curVgaFile2 + READ_BE_UINT32(p2);
width = READ_BE_UINT16(p2 + 6) / 16;
height = p2[5];
flags = p2[4];
@ -1310,7 +1309,7 @@ void SimonEngine::verticalScroll(VC10_state *state) {
src = state->depack_src + _scrollY / 2;
for (h = 0; h < _screenHeight; h += 8) {
//decodeRow(dst, src + READ_BE_UINT32(src), state->width);
//decodeRow(dst, src + READ_LE_UINT32(src), state->width);
dst += 8;
src += 4;
}