and more cleanup ....
svn-id: r6720
This commit is contained in:
parent
a8c3057875
commit
4fe8dcd671
12 changed files with 427 additions and 866 deletions
|
@ -77,8 +77,7 @@ static const char *const english_verb_prep_names[] = {
|
|||
"", "", "", "to whom ?"
|
||||
};
|
||||
|
||||
void SimonState::defocusHitarea()
|
||||
{
|
||||
void SimonState::defocusHitarea() {
|
||||
HitArea *last;
|
||||
HitArea *ha;
|
||||
|
||||
|
@ -103,8 +102,7 @@ void SimonState::defocusHitarea()
|
|||
focusVerb(last->id);
|
||||
}
|
||||
|
||||
void SimonState::focusVerb(uint hitarea_id)
|
||||
{
|
||||
void SimonState::focusVerb(uint hitarea_id) {
|
||||
uint x;
|
||||
const char *txt;
|
||||
const char * const *verb_prep_names;
|
||||
|
@ -128,11 +126,9 @@ void SimonState::focusVerb(uint hitarea_id)
|
|||
}
|
||||
x = (53 - strlen(txt)) * 3;
|
||||
showActionString(x, (const byte *)txt);
|
||||
|
||||
}
|
||||
|
||||
void SimonState::showActionString(uint x, const byte *string)
|
||||
{
|
||||
void SimonState::showActionString(uint x, const byte *string) {
|
||||
FillOrCopyStruct *fcs;
|
||||
|
||||
fcs = _fcs_ptr_array_3[1];
|
||||
|
@ -146,9 +142,7 @@ void SimonState::showActionString(uint x, const byte *string)
|
|||
video_putchar(fcs, *string);
|
||||
}
|
||||
|
||||
|
||||
void SimonState::hitareaChangedHelper()
|
||||
{
|
||||
void SimonState::hitareaChangedHelper() {
|
||||
FillOrCopyStruct *fcs;
|
||||
|
||||
if (_game & GF_SIMON2) {
|
||||
|
@ -164,8 +158,7 @@ void SimonState::hitareaChangedHelper()
|
|||
_hitarea_ptr_7 = NULL;
|
||||
}
|
||||
|
||||
HitArea *SimonState::findHitAreaByID(uint hitarea_id)
|
||||
{
|
||||
HitArea *SimonState::findHitAreaByID(uint hitarea_id) {
|
||||
HitArea *ha = _hit_areas;
|
||||
uint count = ARRAYSIZE(_hit_areas);
|
||||
|
||||
|
@ -176,8 +169,7 @@ HitArea *SimonState::findHitAreaByID(uint hitarea_id)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
HitArea *SimonState::findEmptyHitArea()
|
||||
{
|
||||
HitArea *SimonState::findEmptyHitArea() {
|
||||
HitArea *ha = _hit_areas;
|
||||
uint count = ARRAYSIZE(_hit_areas);
|
||||
|
||||
|
@ -188,15 +180,13 @@ HitArea *SimonState::findEmptyHitArea()
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void SimonState::clear_hitarea_bit_0x40(uint hitarea)
|
||||
{
|
||||
void SimonState::clear_hitarea_bit_0x40(uint hitarea) {
|
||||
HitArea *ha = findHitAreaByID(hitarea);
|
||||
if (ha != NULL)
|
||||
ha->flags &= ~0x40;
|
||||
}
|
||||
|
||||
void SimonState::set_hitarea_bit_0x40(uint hitarea)
|
||||
{
|
||||
void SimonState::set_hitarea_bit_0x40(uint hitarea) {
|
||||
HitArea *ha = findHitAreaByID(hitarea);
|
||||
if (ha != NULL) {
|
||||
ha->flags |= 0x40;
|
||||
|
@ -206,8 +196,7 @@ void SimonState::set_hitarea_bit_0x40(uint hitarea)
|
|||
}
|
||||
}
|
||||
|
||||
void SimonState::set_hitarea_x_y(uint hitarea, int x, int y)
|
||||
{
|
||||
void SimonState::set_hitarea_x_y(uint hitarea, int x, int y) {
|
||||
HitArea *ha = findHitAreaByID(hitarea);
|
||||
if (ha != NULL) {
|
||||
ha->x = x;
|
||||
|
@ -215,8 +204,7 @@ void SimonState::set_hitarea_x_y(uint hitarea, int x, int y)
|
|||
}
|
||||
}
|
||||
|
||||
void SimonState::delete_hitarea(uint hitarea)
|
||||
{
|
||||
void SimonState::delete_hitarea(uint hitarea) {
|
||||
HitArea *ha = findHitAreaByID(hitarea);
|
||||
if (ha != NULL) {
|
||||
ha->flags = 0;
|
||||
|
@ -226,17 +214,14 @@ void SimonState::delete_hitarea(uint hitarea)
|
|||
}
|
||||
}
|
||||
|
||||
bool SimonState::is_hitarea_0x40_clear(uint hitarea)
|
||||
{
|
||||
bool SimonState::is_hitarea_0x40_clear(uint hitarea) {
|
||||
HitArea *ha = findHitAreaByID(hitarea);
|
||||
if (ha == NULL)
|
||||
return false;
|
||||
return (ha->flags & 0x40) == 0;
|
||||
}
|
||||
|
||||
void SimonState::addNewHitArea(int id, int x, int y, int width, int height, int flags, int unk3, Item *item_ptr)
|
||||
{
|
||||
|
||||
void SimonState::addNewHitArea(int id, int x, int y, int width, int height, int flags, int unk3, Item *item_ptr) {
|
||||
HitArea *ha;
|
||||
delete_hitarea(id);
|
||||
|
||||
|
@ -253,8 +238,7 @@ void SimonState::addNewHitArea(int id, int x, int y, int width, int height, int
|
|||
_need_hitarea_recalc++;
|
||||
}
|
||||
|
||||
void SimonState::hitarea_proc_1()
|
||||
{
|
||||
void SimonState::hitarea_proc_1() {
|
||||
uint id;
|
||||
HitArea *ha;
|
||||
|
||||
|
@ -264,7 +248,6 @@ void SimonState::hitarea_proc_1()
|
|||
id = (_mouse_y >= 136) ? 102 : 101;
|
||||
} else {
|
||||
id = (_mouse_y >= 136) ? 102 : 101;
|
||||
|
||||
}
|
||||
|
||||
_hitarea_unk_4 = id;
|
||||
|
@ -282,8 +265,7 @@ void SimonState::hitarea_proc_1()
|
|||
}
|
||||
}
|
||||
|
||||
void SimonState::handle_verb_hitarea(HitArea * ha)
|
||||
{
|
||||
void SimonState::handle_verb_hitarea(HitArea *ha) {
|
||||
HitArea *tmp = _hitarea_ptr_5;
|
||||
|
||||
if (ha == tmp)
|
||||
|
@ -307,14 +289,11 @@ void SimonState::handle_verb_hitarea(HitArea * ha)
|
|||
return;
|
||||
_mouse_cursor = ha->id - 101;
|
||||
_need_hitarea_recalc++;
|
||||
|
||||
}
|
||||
|
||||
_hitarea_ptr_5 = ha;
|
||||
}
|
||||
|
||||
void SimonState::hitarea_leave(HitArea * ha)
|
||||
{
|
||||
void SimonState::hitarea_leave(HitArea *ha) {
|
||||
if (!(_game & GF_SIMON2)) {
|
||||
video_toggle_colors(ha, 0xdf, 0xd5, 0xda, 5);
|
||||
} else {
|
||||
|
@ -322,15 +301,13 @@ void SimonState::hitarea_leave(HitArea * ha)
|
|||
}
|
||||
}
|
||||
|
||||
void SimonState::leaveHitAreaById(uint hitarea_id)
|
||||
{
|
||||
void SimonState::leaveHitAreaById(uint hitarea_id) {
|
||||
HitArea *ha = findHitAreaByID(hitarea_id);
|
||||
if (ha)
|
||||
hitarea_leave(ha);
|
||||
}
|
||||
|
||||
void SimonState::handle_unk2_hitarea(FillOrCopyStruct *fcs)
|
||||
{
|
||||
void SimonState::handle_unk2_hitarea(FillOrCopyStruct *fcs) {
|
||||
uint index;
|
||||
|
||||
index = get_fcs_ptr_3_index(fcs);
|
||||
|
@ -343,8 +320,7 @@ void SimonState::handle_unk2_hitarea(FillOrCopyStruct *fcs)
|
|||
unlock();
|
||||
}
|
||||
|
||||
void SimonState::handle_unk_hitarea(FillOrCopyStruct *fcs)
|
||||
{
|
||||
void SimonState::handle_unk_hitarea(FillOrCopyStruct *fcs) {
|
||||
uint index;
|
||||
|
||||
index = get_fcs_ptr_3_index(fcs);
|
||||
|
@ -354,8 +330,7 @@ void SimonState::handle_unk_hitarea(FillOrCopyStruct *fcs)
|
|||
unlock();
|
||||
}
|
||||
|
||||
void SimonState::setup_hitarea_from_pos(uint x, uint y, uint mode)
|
||||
{
|
||||
void SimonState::setup_hitarea_from_pos(uint x, uint y, uint mode) {
|
||||
HitArea *best_ha;
|
||||
HitArea *ha = _hit_areas;
|
||||
uint count = ARRAYSIZE(_hit_areas);
|
||||
|
@ -415,8 +390,7 @@ void SimonState::setup_hitarea_from_pos(uint x, uint y, uint mode)
|
|||
return;
|
||||
}
|
||||
|
||||
void SimonState::new_current_hitarea(HitArea * ha)
|
||||
{
|
||||
void SimonState::new_current_hitarea(HitArea *ha) {
|
||||
bool result;
|
||||
|
||||
hitareaChangedHelper();
|
||||
|
@ -430,8 +404,7 @@ void SimonState::new_current_hitarea(HitArea * ha)
|
|||
_last_hitarea_2_ptr = ha;
|
||||
}
|
||||
|
||||
bool SimonState::hitarea_proc_2(uint a)
|
||||
{
|
||||
bool SimonState::hitarea_proc_2(uint a) {
|
||||
uint x;
|
||||
const byte *string_ptr;
|
||||
|
||||
|
@ -460,8 +433,7 @@ bool SimonState::hitarea_proc_2(uint a)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool SimonState::hitarea_proc_3(Item *item)
|
||||
{
|
||||
bool SimonState::hitarea_proc_3(Item *item) {
|
||||
Child2 *child2;
|
||||
uint x;
|
||||
const byte *string_ptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue