|
|
|
@ -177,6 +177,7 @@ int SAVE_FILE_CURSOR=0; |
|
|
|
|
std::string CUTSCENE_DISPLAY_TEXT=""; |
|
|
|
|
int CUTSCENE_DISPLAY_TEXT_DELAY_TIME=0; |
|
|
|
|
int TILEMAP_EDITOR_OFFSET=0; |
|
|
|
|
HWButton TESTKEYS[128]={{false,false,false}}; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
[Choice1,Choice2,Choice3] |
|
|
|
@ -1552,6 +1553,10 @@ void SeasonI::updateGame(){ |
|
|
|
|
|
|
|
|
|
//CAMERA UPDATES MUST BE LAST!!! COLLISIONS RELY ON THE GAME POSITION STATES REMAINING THE SAME!
|
|
|
|
|
cameraUpdate(); |
|
|
|
|
|
|
|
|
|
for (int i=0;i<128;i++) { |
|
|
|
|
TESTKEYS[i].bPressed=TESTKEYS[i].bReleased=false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SeasonI::keyUpdates() { |
|
|
|
@ -4077,52 +4082,68 @@ void SeasonI::HandleCutscenes() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool SeasonI::TabHeld(){ |
|
|
|
|
return GetKey(TAB).bHeld; |
|
|
|
|
return GetKey(TAB).bHeld|| |
|
|
|
|
TESTKEYS[TAB].bHeld; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::UpPressed(){ |
|
|
|
|
return GetKey(W).bPressed||GetKey(UP).bPressed||GetKey(NP8).bPressed||MOUSE_PRESSED_DOWN&&GetMouseY()<=HEIGHT-128+32&&GetMouseY()>=HEIGHT-128&&GetMouseX()<=HEIGHT-128||KeyRepeat(UP); |
|
|
|
|
return GetKey(W).bPressed||GetKey(UP).bPressed||GetKey(NP8).bPressed||MOUSE_PRESSED_DOWN&&GetMouseY()<=HEIGHT-128+32&&GetMouseY()>=HEIGHT-128&&GetMouseX()<=HEIGHT-128||KeyRepeat(UP)|| |
|
|
|
|
TESTKEYS[W].bPressed||TESTKEYS[UP].bPressed||TESTKEYS[NP8].bPressed; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::DownPressed(){ |
|
|
|
|
return GetKey(S).bPressed||GetKey(DOWN).bPressed||GetKey(NP5).bPressed||GetKey(NP2).bPressed||MOUSE_PRESSED_DOWN&&GetMouseY()<=HEIGHT&&GetMouseY()>=HEIGHT-32&&GetMouseX()<=HEIGHT-128||KeyRepeat(DOWN); |
|
|
|
|
return GetKey(S).bPressed||GetKey(DOWN).bPressed||GetKey(NP5).bPressed||GetKey(NP2).bPressed||MOUSE_PRESSED_DOWN&&GetMouseY()<=HEIGHT&&GetMouseY()>=HEIGHT-32&&GetMouseX()<=HEIGHT-128||KeyRepeat(DOWN)||TESTKEYS[DOWN].bPressed|| |
|
|
|
|
TESTKEYS[S].bPressed||TESTKEYS[DOWN].bPressed||TESTKEYS[NP5].bPressed||TESTKEYS[NP2].bPressed; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::LeftPressed(){ |
|
|
|
|
return GetKey(A).bPressed||GetKey(LEFT).bPressed||GetKey(NP4).bPressed||MOUSE_PRESSED_DOWN&&GetMouseX()<=32&&GetMouseX()>=0&&GetMouseY()>=HEIGHT-128||KeyRepeat(LEFT); |
|
|
|
|
return GetKey(A).bPressed||GetKey(LEFT).bPressed||GetKey(NP4).bPressed||MOUSE_PRESSED_DOWN&&GetMouseX()<=32&&GetMouseX()>=0&&GetMouseY()>=HEIGHT-128||KeyRepeat(LEFT)|| |
|
|
|
|
TESTKEYS[A].bPressed||TESTKEYS[LEFT].bPressed||TESTKEYS[NP4].bPressed; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::RightPressed(){ |
|
|
|
|
return GetKey(D).bPressed||GetKey(RIGHT).bPressed||GetKey(NP6).bPressed||MOUSE_PRESSED_DOWN&&GetMouseX()<=128&&GetMouseX()>=96&&GetMouseY()>=HEIGHT-128||KeyRepeat(RIGHT); |
|
|
|
|
return GetKey(D).bPressed||GetKey(RIGHT).bPressed||GetKey(NP6).bPressed||MOUSE_PRESSED_DOWN&&GetMouseX()<=128&&GetMouseX()>=96&&GetMouseY()>=HEIGHT-128||KeyRepeat(RIGHT)|| |
|
|
|
|
TESTKEYS[D].bPressed||TESTKEYS[RIGHT].bPressed||TESTKEYS[NP6].bPressed; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::BackPressed(){ |
|
|
|
|
return GetKey(BACK).bPressed||GetKey(ESCAPE).bPressed||GetKey(X).bPressed||GetKey(CTRL).bPressed||GetKey(DEL).bPressed||GetKey(END).bPressed||GetKey(NP_DECIMAL).bPressed||GetKey(NP_SUB).bPressed||GetKey(MINUS).bPressed||GetKey(PAUSE).bPressed||GetKey(TAB).bPressed; |
|
|
|
|
return GetKey(BACK).bPressed||GetKey(ESCAPE).bPressed||GetKey(X).bPressed||GetKey(CTRL).bPressed||GetKey(DEL).bPressed||GetKey(END).bPressed||GetKey(NP_DECIMAL).bPressed||GetKey(NP_SUB).bPressed||GetKey(MINUS).bPressed||GetKey(PAUSE).bPressed||GetKey(TAB).bPressed|| |
|
|
|
|
TESTKEYS[BACK].bPressed||TESTKEYS[ESCAPE].bPressed||TESTKEYS[X].bPressed||TESTKEYS[CTRL].bPressed||TESTKEYS[DEL].bPressed||TESTKEYS[END].bPressed||TESTKEYS[NP_DECIMAL].bPressed||TESTKEYS[NP_SUB].bPressed||TESTKEYS[MINUS].bPressed||TESTKEYS[PAUSE].bPressed||TESTKEYS[TAB].bPressed; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::UpHeld(){ |
|
|
|
|
return GetKey(W).bHeld||GetKey(UP).bHeld||GetKey(NP8).bHeld||MOUSE_DOWN&&GetMouseY()<=HEIGHT-128+32&&GetMouseY()>=HEIGHT-128&&GetMouseX()<=HEIGHT-128; |
|
|
|
|
return GetKey(W).bHeld||GetKey(UP).bHeld||GetKey(NP8).bHeld||MOUSE_DOWN&&GetMouseY()<=HEIGHT-128+32&&GetMouseY()>=HEIGHT-128&&GetMouseX()<=HEIGHT-128|| |
|
|
|
|
TESTKEYS[W].bHeld||TESTKEYS[UP].bHeld||TESTKEYS[NP8].bHeld; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::DownHeld(){ |
|
|
|
|
return GetKey(S).bHeld||GetKey(DOWN).bHeld||GetKey(NP5).bHeld||GetKey(NP2).bHeld||MOUSE_DOWN&&GetMouseY()<=HEIGHT&&GetMouseY()>=HEIGHT-32&&GetMouseX()<=HEIGHT-128; |
|
|
|
|
return GetKey(S).bHeld||GetKey(DOWN).bHeld||GetKey(NP5).bHeld||GetKey(NP2).bHeld||MOUSE_DOWN&&GetMouseY()<=HEIGHT&&GetMouseY()>=HEIGHT-32&&GetMouseX()<=HEIGHT-128|| |
|
|
|
|
TESTKEYS[S].bHeld||TESTKEYS[DOWN].bHeld||TESTKEYS[NP5].bHeld; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::LeftHeld(){ |
|
|
|
|
return GetKey(A).bHeld||GetKey(LEFT).bHeld||GetKey(NP4).bHeld||MOUSE_DOWN&&GetMouseX()<=32&&GetMouseX()>=0&&GetMouseY()>=HEIGHT-128; |
|
|
|
|
return GetKey(A).bHeld||GetKey(LEFT).bHeld||GetKey(NP4).bHeld||MOUSE_DOWN&&GetMouseX()<=32&&GetMouseX()>=0&&GetMouseY()>=HEIGHT-128|| |
|
|
|
|
TESTKEYS[A].bHeld||TESTKEYS[LEFT].bHeld||TESTKEYS[NP4].bHeld; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::RightHeld(){ |
|
|
|
|
return GetKey(D).bHeld||GetKey(RIGHT).bHeld||GetKey(NP6).bHeld||MOUSE_DOWN&&GetMouseX()<=128&&GetMouseX()>=96&&GetMouseY()>=HEIGHT-128; |
|
|
|
|
return GetKey(D).bHeld||GetKey(RIGHT).bHeld||GetKey(NP6).bHeld||MOUSE_DOWN&&GetMouseX()<=128&&GetMouseX()>=96&&GetMouseY()>=HEIGHT-128|| |
|
|
|
|
TESTKEYS[D].bHeld||TESTKEYS[RIGHT].bHeld||TESTKEYS[NP6].bHeld; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::BackHeld(){ |
|
|
|
|
return GetKey(BACK).bHeld||GetKey(ESCAPE).bHeld||GetKey(X).bHeld||GetKey(CTRL).bHeld||GetKey(DEL).bHeld||GetKey(END).bHeld||GetKey(NP_DECIMAL).bHeld||GetKey(NP_SUB).bHeld||GetKey(MINUS).bHeld||GetKey(PAUSE).bHeld||GetKey(TAB).bHeld; |
|
|
|
|
return GetKey(BACK).bHeld||GetKey(ESCAPE).bHeld||GetKey(X).bHeld||GetKey(CTRL).bHeld||GetKey(DEL).bHeld||GetKey(END).bHeld||GetKey(NP_DECIMAL).bHeld||GetKey(NP_SUB).bHeld||GetKey(MINUS).bHeld||GetKey(PAUSE).bHeld||GetKey(TAB).bHeld|| |
|
|
|
|
TESTKEYS[BACK].bHeld||TESTKEYS[ESCAPE].bHeld||TESTKEYS[X].bHeld||TESTKEYS[CTRL].bHeld||TESTKEYS[DEL].bHeld||TESTKEYS[END].bHeld||TESTKEYS[NP_DECIMAL].bHeld||TESTKEYS[NP_SUB].bHeld||TESTKEYS[MINUS].bHeld||TESTKEYS[PAUSE].bHeld||TESTKEYS[TAB].bHeld; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::UpReleased(){ |
|
|
|
|
return GetKey(W).bReleased||GetKey(UP).bReleased||GetKey(NP8).bReleased||MOUSE_RELEASED&&GetMouseY()<=HEIGHT-128+32&&GetMouseY()>=HEIGHT-128&&GetMouseX()<=HEIGHT-128; |
|
|
|
|
return GetKey(W).bReleased||GetKey(UP).bReleased||GetKey(NP8).bReleased||MOUSE_RELEASED&&GetMouseY()<=HEIGHT-128+32&&GetMouseY()>=HEIGHT-128&&GetMouseX()<=HEIGHT-128|| |
|
|
|
|
TESTKEYS[W].bReleased||TESTKEYS[UP].bReleased||TESTKEYS[NP8].bReleased; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::DownReleased(){ |
|
|
|
|
return GetKey(S).bReleased||GetKey(DOWN).bReleased||GetKey(NP5).bReleased||GetKey(NP2).bReleased||MOUSE_RELEASED&&GetMouseY()<=HEIGHT&&GetMouseY()>=HEIGHT-32&&GetMouseX()<=HEIGHT-128; |
|
|
|
|
return GetKey(S).bReleased||GetKey(DOWN).bReleased||GetKey(NP5).bReleased||GetKey(NP2).bReleased||MOUSE_RELEASED&&GetMouseY()<=HEIGHT&&GetMouseY()>=HEIGHT-32&&GetMouseX()<=HEIGHT-128|| |
|
|
|
|
TESTKEYS[S].bReleased||TESTKEYS[DOWN].bReleased||TESTKEYS[NP5].bReleased||TESTKEYS[NP2].bReleased; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::LeftReleased(){ |
|
|
|
|
return GetKey(A).bReleased||GetKey(LEFT).bReleased||GetKey(NP4).bReleased||MOUSE_RELEASED&&GetMouseX()<=32&&GetMouseX()>=0&&GetMouseY()>=HEIGHT-128; |
|
|
|
|
return GetKey(A).bReleased||GetKey(LEFT).bReleased||GetKey(NP4).bReleased||MOUSE_RELEASED&&GetMouseX()<=32&&GetMouseX()>=0&&GetMouseY()>=HEIGHT-128|| |
|
|
|
|
TESTKEYS[A].bReleased||TESTKEYS[LEFT].bReleased||TESTKEYS[NP4].bReleased; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::RightReleased(){ |
|
|
|
|
return GetKey(D).bReleased||GetKey(RIGHT).bReleased||GetKey(NP6).bReleased||MOUSE_RELEASED&&GetMouseX()<=128&&GetMouseX()>=96&&GetMouseY()>=HEIGHT-128; |
|
|
|
|
return GetKey(D).bReleased||GetKey(RIGHT).bReleased||GetKey(NP6).bReleased||MOUSE_RELEASED&&GetMouseX()<=128&&GetMouseX()>=96&&GetMouseY()>=HEIGHT-128|| |
|
|
|
|
TESTKEYS[D].bReleased||TESTKEYS[RIGHT].bReleased||TESTKEYS[NP6].bReleased; |
|
|
|
|
} |
|
|
|
|
bool SeasonI::BackReleased(){ |
|
|
|
|
return GetKey(BACK).bReleased||GetKey(ESCAPE).bReleased||GetKey(X).bReleased||GetKey(CTRL).bReleased||GetKey(DEL).bReleased||GetKey(END).bReleased||GetKey(NP_DECIMAL).bReleased||GetKey(NP_SUB).bReleased||GetKey(MINUS).bReleased||GetKey(PAUSE).bReleased||GetKey(TAB).bReleased; |
|
|
|
|
return GetKey(BACK).bReleased||GetKey(ESCAPE).bReleased||GetKey(X).bReleased||GetKey(CTRL).bReleased||GetKey(DEL).bReleased||GetKey(END).bReleased||GetKey(NP_DECIMAL).bReleased||GetKey(NP_SUB).bReleased||GetKey(MINUS).bReleased||GetKey(PAUSE).bReleased||GetKey(TAB).bReleased|| |
|
|
|
|
TESTKEYS[BACK].bReleased||TESTKEYS[ESCAPE].bReleased||TESTKEYS[X].bReleased||TESTKEYS[CTRL].bReleased||TESTKEYS[DEL].bReleased||TESTKEYS[END].bReleased||TESTKEYS[NP_DECIMAL].bReleased||TESTKEYS[NP_SUB].bReleased||TESTKEYS[MINUS].bReleased||TESTKEYS[PAUSE].bReleased||TESTKEYS[TAB].bReleased; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool SeasonI::PlayerCanMove(){ |
|
|
|
@ -5578,6 +5599,27 @@ char SeasonI::GetTileDegreeSafely(std::vector<std::vector<TILE*>>&data){ |
|
|
|
|
return GetSafeTileData(data).tileDegree; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SeasonI::PressTestKey(Key k) { |
|
|
|
|
TESTKEYS[k].bPressed=true; |
|
|
|
|
TESTKEYS[k].bReleased=false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SeasonI::HoldTestKey(Key k) { |
|
|
|
|
TESTKEYS[k].bHeld=true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SeasonI::ReleaseTestKey(Key k) { |
|
|
|
|
TESTKEYS[k].bPressed=false; |
|
|
|
|
TESTKEYS[k].bReleased=true; |
|
|
|
|
TESTKEYS[k].bHeld=false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void SeasonI::ResetTestKeys() { |
|
|
|
|
for (int i=0;i<128;i++) { |
|
|
|
|
TESTKEYS[i].bPressed=TESTKEYS[i].bHeld=TESTKEYS[i].bReleased=false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef TEST_SUITE |
|
|
|
|
int main() |
|
|
|
|
{ |
|
|
|
|