Add centreScroll() for FF and hyperbox code differences in FF.
svn-id: r21712
This commit is contained in:
parent
a74fcf7cee
commit
202406e31b
7 changed files with 69 additions and 14 deletions
|
@ -183,7 +183,7 @@ void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint
|
||||||
VgaPointersEntry *vpe = &_vgaBufferPointers[2];
|
VgaPointersEntry *vpe = &_vgaBufferPointers[2];
|
||||||
byte *src, *dst, *p, *dst_org, chr;
|
byte *src, *dst, *p, *dst_org, chr;
|
||||||
const int textHeight = (getGameType() == GType_FF) ? 15: 10;
|
const int textHeight = (getGameType() == GType_FF) ? 15: 10;
|
||||||
uint count;
|
uint count = 0;
|
||||||
|
|
||||||
if (vga_sprite_id >= 100) {
|
if (vga_sprite_id >= 100) {
|
||||||
vga_sprite_id -= 100;
|
vga_sprite_id -= 100;
|
||||||
|
@ -192,9 +192,14 @@ void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint
|
||||||
|
|
||||||
src = dst = vpe->vgaFile2;
|
src = dst = vpe->vgaFile2;
|
||||||
|
|
||||||
|
if (getGameType() == GType_FF) {
|
||||||
|
if (vga_sprite_id == 1)
|
||||||
|
count = 11025;
|
||||||
|
} else {
|
||||||
count = 4000;
|
count = 4000;
|
||||||
if (vga_sprite_id == 1)
|
if (vga_sprite_id == 1)
|
||||||
count *= 2;
|
count *= 2;
|
||||||
|
}
|
||||||
|
|
||||||
p = dst + vga_sprite_id * 8;
|
p = dst + vga_sprite_id * 8;
|
||||||
|
|
||||||
|
@ -207,7 +212,9 @@ void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint
|
||||||
}
|
}
|
||||||
dst += readUint32Wrapper(p);
|
dst += readUint32Wrapper(p);
|
||||||
|
|
||||||
|
if (count != 0)
|
||||||
memset(dst, 0, count);
|
memset(dst, 0, count);
|
||||||
|
|
||||||
if (_language == Common::HB_ISR)
|
if (_language == Common::HB_ISR)
|
||||||
dst += width - 1; // For Hebrew, start at the right edge, not the left.
|
dst += width - 1; // For Hebrew, start at the right edge, not the left.
|
||||||
|
|
||||||
|
|
|
@ -1512,7 +1512,7 @@ void SimonEngine::o3_playSmack() {
|
||||||
|
|
||||||
void SimonEngine::o3_centreScroll() {
|
void SimonEngine::o3_centreScroll() {
|
||||||
// 187
|
// 187
|
||||||
warning("STUB: script opcode 187");
|
centreScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimonEngine::o3_resetPVCount() {
|
void SimonEngine::o3_resetPVCount() {
|
||||||
|
|
|
@ -1554,6 +1554,7 @@ void SimonEngine::o_setup_cond_c() {
|
||||||
|
|
||||||
void SimonEngine::setup_cond_c_helper() {
|
void SimonEngine::setup_cond_c_helper() {
|
||||||
HitArea *last;
|
HitArea *last;
|
||||||
|
uint id;
|
||||||
|
|
||||||
_noRightClick = 1;
|
_noRightClick = 1;
|
||||||
|
|
||||||
|
@ -1644,7 +1645,14 @@ void SimonEngine::setup_cond_c_helper() {
|
||||||
inventoryDown(_lastHitArea->window);
|
inventoryDown(_lastHitArea->window);
|
||||||
} else if (_lastHitArea->item_ptr != NULL) {
|
} else if (_lastHitArea->item_ptr != NULL) {
|
||||||
_hitAreaObjectItem = _lastHitArea->item_ptr;
|
_hitAreaObjectItem = _lastHitArea->item_ptr;
|
||||||
_variableArray[60] = (_lastHitArea->flags & kBFTextBox) ? (_lastHitArea->flags / 256) : 0xFFFF;
|
id = 0xFFFF;
|
||||||
|
if (_lastHitArea->flags & kBFTextBox) {
|
||||||
|
if (getGameType() == GType_FF && (_lastHitArea->flags & kBFHyperBox))
|
||||||
|
id = _lastHitArea->data;
|
||||||
|
else
|
||||||
|
id = _lastHitArea->flags / 256;
|
||||||
|
}
|
||||||
|
_variableArray[60] = id;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1950,8 +1958,12 @@ startOver:
|
||||||
if_1:;
|
if_1:;
|
||||||
_hitAreaSubjectItem = ha->item_ptr;
|
_hitAreaSubjectItem = ha->item_ptr;
|
||||||
id = 0xFFFF;
|
id = 0xFFFF;
|
||||||
if (ha->flags & kBFTextBox)
|
if (ha->flags & kBFTextBox) {
|
||||||
|
if (getGameType() == GType_FF && (ha->flags & kBFHyperBox))
|
||||||
|
id = ha->data;
|
||||||
|
else
|
||||||
id = ha->flags / 256;
|
id = ha->flags / 256;
|
||||||
|
}
|
||||||
_variableArray[60] = id;
|
_variableArray[60] = id;
|
||||||
displayName(ha);
|
displayName(ha);
|
||||||
if (_verbHitArea != 0)
|
if (_verbHitArea != 0)
|
||||||
|
|
|
@ -67,6 +67,7 @@ struct HitArea {
|
||||||
uint16 width, height;
|
uint16 width, height;
|
||||||
uint16 flags;
|
uint16 flags;
|
||||||
uint16 id;
|
uint16 id;
|
||||||
|
uint16 data;
|
||||||
WindowBlock *window;
|
WindowBlock *window;
|
||||||
Item *item_ptr;
|
Item *item_ptr;
|
||||||
uint16 verb;
|
uint16 verb;
|
||||||
|
@ -1015,6 +1016,7 @@ protected:
|
||||||
int getScale(int y, int x);
|
int getScale(int y, int x);
|
||||||
void checkScrollX(int x, int xpos);
|
void checkScrollX(int x, int xpos);
|
||||||
void checkScrollY(int y, int ypos);
|
void checkScrollY(int y, int ypos);
|
||||||
|
void centreScroll();
|
||||||
|
|
||||||
bool itemIsSiblingOf(uint16 val);
|
bool itemIsSiblingOf(uint16 val);
|
||||||
bool itemIsParentOf(uint16 a, uint16 b);
|
bool itemIsParentOf(uint16 a, uint16 b);
|
||||||
|
|
|
@ -125,8 +125,6 @@ bool SimonEngine::printNameOf(Item *item, uint x, uint y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimonEngine::printInteractText(uint16 num, const char *string) {
|
void SimonEngine::printInteractText(uint16 num, const char *string) {
|
||||||
printf("printInteractText: num %d, string %s\n", num, string);
|
|
||||||
|
|
||||||
char convertedString[320];
|
char convertedString[320];
|
||||||
char *convertedString2 = convertedString;
|
char *convertedString2 = convertedString;
|
||||||
const char *string2 = string;
|
const char *string2 = string;
|
||||||
|
|
|
@ -396,7 +396,7 @@ void SimonEngine::defineBox(int id, int x, int y, int width, int height, int fla
|
||||||
ha->item_ptr = item_ptr;
|
ha->item_ptr = item_ptr;
|
||||||
|
|
||||||
if (getGameType() == GType_FF && (ha->flags & kBFHyperBox)) {
|
if (getGameType() == GType_FF && (ha->flags & kBFHyperBox)) {
|
||||||
// TODO
|
ha->data = _hyperLink;
|
||||||
ha->priority = 50;
|
ha->priority = 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2424,8 +2424,8 @@ void SimonEngine::vc78_computeXY() {
|
||||||
vsp->y = posy;
|
vsp->y = posy;
|
||||||
|
|
||||||
setBitFlag(85, false);
|
setBitFlag(85, false);
|
||||||
if (getBitFlag(74) == true) {
|
if (getBitFlag(74)) {
|
||||||
//centreScroll();
|
centreScroll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2569,4 +2569,40 @@ void SimonEngine::checkScrollY(int y, int ypos) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SimonEngine::centreScroll() {
|
||||||
|
int16 x, y, tmp;
|
||||||
|
|
||||||
|
if (_scrollXMax != 0) {
|
||||||
|
_scrollCount = 0;
|
||||||
|
x = _variableArray[15] - _scrollX;
|
||||||
|
if (getBitFlag(85) || x >= 624) {
|
||||||
|
x -= 320;
|
||||||
|
tmp = _scrollXMax - _scrollX;
|
||||||
|
if (tmp < x)
|
||||||
|
x = tmp;
|
||||||
|
_scrollCount = x;
|
||||||
|
} else if (x < 17) {
|
||||||
|
x -= 320;
|
||||||
|
if (_scrollX < -x)
|
||||||
|
x = -_scrollX;
|
||||||
|
_scrollCount = x;
|
||||||
|
}
|
||||||
|
} else if (_scrollYMax != 0) {
|
||||||
|
_scrollCount = 0;
|
||||||
|
y = _variableArray[16] - _scrollY;
|
||||||
|
if (y >= 460) {
|
||||||
|
y -= 240;
|
||||||
|
tmp = _scrollYMax - _scrollY;
|
||||||
|
if (tmp < y)
|
||||||
|
y = tmp;
|
||||||
|
_scrollCount = y;
|
||||||
|
} else if (y < 30) {
|
||||||
|
y -= 240;
|
||||||
|
if (_scrollY < -y)
|
||||||
|
y = -_scrollY;
|
||||||
|
_scrollCount = y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // End of namespace Simon
|
} // End of namespace Simon
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue