mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-07-04 15:04:36 +00:00
update texcoords of quads which have AUTO_VIRTUAL* set properly
move auto size vars & handling to PauseQuad, since not every quad needs this.
This commit is contained in:
parent
0391052e51
commit
4852eb533b
10 changed files with 98 additions and 99 deletions
|
@ -419,7 +419,8 @@ protected:
|
||||||
void onEnterState(int action) OVERRIDE;
|
void onEnterState(int action) OVERRIDE;
|
||||||
void onExitState(int action) OVERRIDE;
|
void onExitState(int action) OVERRIDE;
|
||||||
std::vector<ParticleEffect*>targetQuads;
|
std::vector<ParticleEffect*>targetQuads;
|
||||||
Quad *blinder, *fader, *tripper;
|
PauseQuad *blinder, *tripper;
|
||||||
|
Quad *fader;
|
||||||
void applyBlindEffects();
|
void applyBlindEffects();
|
||||||
void removeBlindEffects();
|
void removeBlindEffects();
|
||||||
|
|
||||||
|
|
|
@ -861,7 +861,8 @@ void DSQ::init()
|
||||||
precacher.setBaseDir(this->getBaseTexturePath());
|
precacher.setBaseDir(this->getBaseTexturePath());
|
||||||
precacher.precacheTex("loading/*.png");
|
precacher.precacheTex("loading/*.png");
|
||||||
|
|
||||||
Quad *loadbg = new Quad;
|
PauseQuad *loadbg = new PauseQuad;
|
||||||
|
loadbg->pauseLevel = 99;
|
||||||
loadbg->position = Vector(400,300);
|
loadbg->position = Vector(400,300);
|
||||||
loadbg->color = Vector(0.06f, 0.06f, 0.08f);
|
loadbg->color = Vector(0.06f, 0.06f, 0.08f);
|
||||||
loadbg->followCamera = 1;
|
loadbg->followCamera = 1;
|
||||||
|
@ -1012,7 +1013,8 @@ void DSQ::init()
|
||||||
addRenderObject(versionLabel, LR_REGISTER_TEXT);
|
addRenderObject(versionLabel, LR_REGISTER_TEXT);
|
||||||
|
|
||||||
|
|
||||||
subbox = new Quad();
|
subbox = new PauseQuad();
|
||||||
|
subbox->pauseLevel = 99;
|
||||||
subbox->position = Vector(400,580);
|
subbox->position = Vector(400,580);
|
||||||
subbox->alpha = 0;
|
subbox->alpha = 0;
|
||||||
subbox->alphaMod = 0.7f;
|
subbox->alphaMod = 0.7f;
|
||||||
|
@ -1051,7 +1053,8 @@ void DSQ::init()
|
||||||
achievement_text->setAlign(ALIGN_LEFT);
|
achievement_text->setAlign(ALIGN_LEFT);
|
||||||
addRenderObject(achievement_text, LR_SUBTITLES);
|
addRenderObject(achievement_text, LR_SUBTITLES);
|
||||||
|
|
||||||
cutscene_bg = new Quad();
|
cutscene_bg = new PauseQuad();
|
||||||
|
cutscene_bg->pauseLevel = 99;
|
||||||
cutscene_bg->autoWidth = AUTO_VIRTUALWIDTH;
|
cutscene_bg->autoWidth = AUTO_VIRTUALWIDTH;
|
||||||
cutscene_bg->color = 0;
|
cutscene_bg->color = 0;
|
||||||
cutscene_bg->alphaMod = 0.75;
|
cutscene_bg->alphaMod = 0.75;
|
||||||
|
@ -1108,8 +1111,9 @@ void DSQ::init()
|
||||||
|
|
||||||
debugLog("6");
|
debugLog("6");
|
||||||
|
|
||||||
overlay = new Quad;
|
overlay = new PauseQuad;
|
||||||
{
|
{
|
||||||
|
overlay->pauseLevel = 99;
|
||||||
overlay->position = Vector(400,300,3);
|
overlay->position = Vector(400,300,3);
|
||||||
overlay->color = 0;
|
overlay->color = 0;
|
||||||
overlay->autoWidth = AUTO_VIRTUALWIDTH;
|
overlay->autoWidth = AUTO_VIRTUALWIDTH;
|
||||||
|
@ -1119,8 +1123,9 @@ void DSQ::init()
|
||||||
}
|
}
|
||||||
addRenderObject(overlay, LR_OVERLAY);
|
addRenderObject(overlay, LR_OVERLAY);
|
||||||
|
|
||||||
overlay2 = new Quad;
|
overlay2 = new PauseQuad;
|
||||||
{
|
{
|
||||||
|
overlay2->pauseLevel = 99;
|
||||||
overlay2->position = Vector(400,300);
|
overlay2->position = Vector(400,300);
|
||||||
overlay2->color = 0;
|
overlay2->color = 0;
|
||||||
overlay2->autoWidth = AUTO_VIRTUALWIDTH;
|
overlay2->autoWidth = AUTO_VIRTUALWIDTH;
|
||||||
|
@ -1130,8 +1135,9 @@ void DSQ::init()
|
||||||
}
|
}
|
||||||
addRenderObject(overlay2, LR_OVERLAY);
|
addRenderObject(overlay2, LR_OVERLAY);
|
||||||
|
|
||||||
overlay3 = new Quad;
|
overlay3 = new PauseQuad;
|
||||||
{
|
{
|
||||||
|
overlay3->pauseLevel = 99;
|
||||||
overlay3->position = Vector(400,300);
|
overlay3->position = Vector(400,300);
|
||||||
overlay3->color = 0;
|
overlay3->color = 0;
|
||||||
overlay3->autoWidth = AUTO_VIRTUALWIDTH;
|
overlay3->autoWidth = AUTO_VIRTUALWIDTH;
|
||||||
|
@ -1141,8 +1147,9 @@ void DSQ::init()
|
||||||
}
|
}
|
||||||
addRenderObject(overlay3, LR_OVERLAY);
|
addRenderObject(overlay3, LR_OVERLAY);
|
||||||
|
|
||||||
overlayRed = new Quad;
|
overlayRed = new PauseQuad;
|
||||||
{
|
{
|
||||||
|
overlayRed->pauseLevel = 99;
|
||||||
overlayRed->position = Vector(400,300);
|
overlayRed->position = Vector(400,300);
|
||||||
overlayRed->color = Vector(1,0,0);
|
overlayRed->color = Vector(1,0,0);
|
||||||
overlayRed->alphaMod = 0.5;
|
overlayRed->alphaMod = 0.5;
|
||||||
|
@ -1153,8 +1160,9 @@ void DSQ::init()
|
||||||
}
|
}
|
||||||
addRenderObject(overlayRed, LR_OVERLAY);
|
addRenderObject(overlayRed, LR_OVERLAY);
|
||||||
|
|
||||||
sceneColorOverlay = new Quad;
|
sceneColorOverlay = new PauseQuad;
|
||||||
{
|
{
|
||||||
|
sceneColorOverlay->pauseLevel = 99;
|
||||||
sceneColorOverlay->position = Vector(400,300);
|
sceneColorOverlay->position = Vector(400,300);
|
||||||
sceneColorOverlay->color = Vector(1,1,1);
|
sceneColorOverlay->color = Vector(1,1,1);
|
||||||
sceneColorOverlay->alpha = 1;
|
sceneColorOverlay->alpha = 1;
|
||||||
|
@ -1165,8 +1173,9 @@ void DSQ::init()
|
||||||
}
|
}
|
||||||
addRenderObject(sceneColorOverlay, LR_SCENE_COLOR);
|
addRenderObject(sceneColorOverlay, LR_SCENE_COLOR);
|
||||||
|
|
||||||
tfader = new Quad;
|
tfader = new PauseQuad;
|
||||||
{
|
{
|
||||||
|
tfader->pauseLevel = 99;
|
||||||
tfader->position = Vector(400,300,3);
|
tfader->position = Vector(400,300,3);
|
||||||
tfader->color = 0;
|
tfader->color = 0;
|
||||||
tfader->autoWidth = AUTO_VIRTUALWIDTH;
|
tfader->autoWidth = AUTO_VIRTUALWIDTH;
|
||||||
|
@ -1176,6 +1185,19 @@ void DSQ::init()
|
||||||
}
|
}
|
||||||
addRenderObject(tfader, LR_TRANSITION);
|
addRenderObject(tfader, LR_TRANSITION);
|
||||||
|
|
||||||
|
blackout = new PauseQuad;
|
||||||
|
{
|
||||||
|
blackout->pauseLevel = 99;
|
||||||
|
blackout->color = 0;
|
||||||
|
blackout->autoWidth = AUTO_VIRTUALWIDTH;
|
||||||
|
blackout->autoHeight = AUTO_VIRTUALHEIGHT;
|
||||||
|
blackout->followCamera = 1;
|
||||||
|
blackout->position = Vector(400,300);
|
||||||
|
blackout->alphaMod = 0.75f;
|
||||||
|
blackout->alpha = 0;
|
||||||
|
}
|
||||||
|
addRenderObject(blackout, LR_MENU);
|
||||||
|
|
||||||
screenTransition = new AquariaScreenTransition();
|
screenTransition = new AquariaScreenTransition();
|
||||||
{
|
{
|
||||||
screenTransition->position = Vector(400,300);
|
screenTransition->position = Vector(400,300);
|
||||||
|
@ -2356,16 +2378,7 @@ void DSQ::doModSelect()
|
||||||
|
|
||||||
void DSQ::createModSelector()
|
void DSQ::createModSelector()
|
||||||
{
|
{
|
||||||
blackout = new Quad;
|
|
||||||
blackout->color = 0;
|
|
||||||
blackout->autoWidth = AUTO_VIRTUALWIDTH;
|
|
||||||
blackout->autoHeight = AUTO_VIRTUALHEIGHT;
|
|
||||||
blackout->followCamera = 1;
|
|
||||||
blackout->position = Vector(400,300);
|
|
||||||
blackout->alphaMod = 0.75f;
|
|
||||||
blackout->alpha = 0;
|
|
||||||
blackout->alpha.interpolateTo(1, 0.2f);
|
blackout->alpha.interpolateTo(1, 0.2f);
|
||||||
addRenderObject(blackout, LR_MENU);
|
|
||||||
|
|
||||||
modSelectorScr = new ModSelectorScreen();
|
modSelectorScr = new ModSelectorScreen();
|
||||||
modSelectorScr->position = Vector(400,300);
|
modSelectorScr->position = Vector(400,300);
|
||||||
|
@ -2434,13 +2447,7 @@ void DSQ::unloadMods()
|
||||||
|
|
||||||
void DSQ::clearModSelector()
|
void DSQ::clearModSelector()
|
||||||
{
|
{
|
||||||
if (blackout)
|
blackout->alpha.interpolateTo(0, 0.5f);
|
||||||
{
|
|
||||||
blackout->setLife(1);
|
|
||||||
blackout->setDecayRate(2);
|
|
||||||
blackout->fadeAlphaWithLife = 1;
|
|
||||||
blackout = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(modSelectorScr)
|
if(modSelectorScr)
|
||||||
{
|
{
|
||||||
|
@ -2481,18 +2488,7 @@ void DSQ::createSaveSlots(SaveSlotMode ssm)
|
||||||
|
|
||||||
float t = 0.3f;
|
float t = 0.3f;
|
||||||
|
|
||||||
|
|
||||||
blackout = new Quad;
|
|
||||||
blackout->color = 0;
|
|
||||||
blackout->autoWidth = AUTO_VIRTUALWIDTH;
|
|
||||||
blackout->autoHeight = AUTO_VIRTUALHEIGHT;
|
|
||||||
blackout->followCamera = 1;
|
|
||||||
blackout->position = Vector(400,300);
|
|
||||||
blackout->alphaMod = 0.75f;
|
|
||||||
blackout->alpha = 0;
|
|
||||||
blackout->alpha.interpolateTo(1, 0.5f);
|
blackout->alpha.interpolateTo(1, 0.5f);
|
||||||
addRenderObject(blackout, LR_MENU);
|
|
||||||
|
|
||||||
|
|
||||||
menu[1] = new Quad("gui/save-menu", Vector(400,300));
|
menu[1] = new Quad("gui/save-menu", Vector(400,300));
|
||||||
menu[1]->alpha = 0;
|
menu[1]->alpha = 0;
|
||||||
|
@ -2659,7 +2655,6 @@ void DSQ::hideSaveSlotCrap()
|
||||||
{
|
{
|
||||||
clearMenu();
|
clearMenu();
|
||||||
|
|
||||||
if (blackout)
|
|
||||||
blackout->alpha = 0;
|
blackout->alpha = 0;
|
||||||
|
|
||||||
if (saveSlotPageCount)
|
if (saveSlotPageCount)
|
||||||
|
@ -2673,23 +2668,8 @@ void DSQ::clearSaveSlots(bool trans)
|
||||||
sound->playSfx("menu-close");
|
sound->playSfx("menu-close");
|
||||||
}
|
}
|
||||||
float t = 0.3f;
|
float t = 0.3f;
|
||||||
if (blackout)
|
blackout->alpha.interpolateTo(0, trans ? 1.0f : 0.1f);
|
||||||
{
|
|
||||||
if (!trans)
|
|
||||||
{
|
|
||||||
blackout->setLife(1);
|
|
||||||
blackout->setDecayRate(10);
|
|
||||||
if (blackout->alpha.x > 0)
|
|
||||||
blackout->fadeAlphaWithLife = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
blackout->setLife(1);
|
|
||||||
blackout->setDecayRate(1);
|
|
||||||
if (blackout->alpha.x > 0)
|
|
||||||
blackout->fadeAlphaWithLife = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (saveSlotPageCount)
|
if (saveSlotPageCount)
|
||||||
{
|
{
|
||||||
saveSlotPageCount->setLife(1);
|
saveSlotPageCount->setLife(1);
|
||||||
|
|
|
@ -146,8 +146,8 @@ public:
|
||||||
void setCursor(CursorType type);
|
void setCursor(CursorType type);
|
||||||
|
|
||||||
Quad *cursor, *cursorGlow, *cursorBlinker;
|
Quad *cursor, *cursorGlow, *cursorBlinker;
|
||||||
Quad *overlay, *tfader, *overlay2, *overlay3, *overlayRed;
|
PauseQuad *overlay, *tfader, *overlay2, *overlay3, *overlayRed;
|
||||||
Quad *sceneColorOverlay;
|
PauseQuad *sceneColorOverlay;
|
||||||
Quad *bar_left, *bar_right, *bar_up, *bar_down;
|
Quad *bar_left, *bar_right, *bar_up, *bar_down;
|
||||||
Quad *barFade_left, *barFade_right;
|
Quad *barFade_left, *barFade_right;
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ public:
|
||||||
Quad *achievement_box;
|
Quad *achievement_box;
|
||||||
|
|
||||||
BitmapText *subtext;
|
BitmapText *subtext;
|
||||||
Quad *subbox;
|
PauseQuad *subbox;
|
||||||
|
|
||||||
BmpFont font, smallFont, subsFont, goldFont, smallFontRed;
|
BmpFont font, smallFont, subsFont, goldFont, smallFontRed;
|
||||||
TTFFont fontArialSmall, fontArialBig, fontArialSmallest;
|
TTFFont fontArialSmall, fontArialBig, fontArialSmallest;
|
||||||
|
@ -390,7 +390,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
Quad *cutscene_bg;
|
PauseQuad *cutscene_bg;
|
||||||
BitmapText *cutscene_text;
|
BitmapText *cutscene_text;
|
||||||
BitmapText *cutscene_text2;
|
BitmapText *cutscene_text2;
|
||||||
|
|
||||||
|
@ -424,7 +424,7 @@ protected:
|
||||||
void onStopVoice();
|
void onStopVoice();
|
||||||
|
|
||||||
Entity **iter;
|
Entity **iter;
|
||||||
Quad *blackout;
|
PauseQuad *blackout;
|
||||||
void updatepecue(float dt);
|
void updatepecue(float dt);
|
||||||
std::vector<PECue> pecue;
|
std::vector<PECue> pecue;
|
||||||
|
|
||||||
|
|
|
@ -2546,8 +2546,9 @@ void Game::applyState()
|
||||||
dsq->clearEntities();
|
dsq->clearEntities();
|
||||||
dsq->tilemgr.clearTiles();
|
dsq->tilemgr.clearTiles();
|
||||||
|
|
||||||
damageSprite = new Quad;
|
damageSprite = new PauseQuad;
|
||||||
{
|
{
|
||||||
|
damageSprite->pauseLevel = 99;
|
||||||
damageSprite->setTexture("damage");
|
damageSprite->setTexture("damage");
|
||||||
damageSprite->alpha = 0;
|
damageSprite->alpha = 0;
|
||||||
damageSprite->autoWidth = AUTO_VIRTUALWIDTH;
|
damageSprite->autoWidth = AUTO_VIRTUALWIDTH;
|
||||||
|
@ -2560,8 +2561,9 @@ void Game::applyState()
|
||||||
|
|
||||||
Vector mousePos(400,490);
|
Vector mousePos(400,490);
|
||||||
|
|
||||||
controlHint_bg = new Quad;
|
controlHint_bg = new PauseQuad;
|
||||||
{
|
{
|
||||||
|
controlHint_bg->pauseLevel = 99;
|
||||||
controlHint_bg->followCamera = 1;
|
controlHint_bg->followCamera = 1;
|
||||||
controlHint_bg->position = Vector(400,500);
|
controlHint_bg->position = Vector(400,500);
|
||||||
controlHint_bg->color = 0;
|
controlHint_bg->color = 0;
|
||||||
|
@ -3416,7 +3418,8 @@ void Game::toggleHelpScreen(bool on, const std::string &label)
|
||||||
data += "\n\n" + stringbank.get(2032) + "\n\n";
|
data += "\n\n" + stringbank.get(2032) + "\n\n";
|
||||||
dsq->continuity.statsAndAchievements->appendStringData(data);
|
dsq->continuity.statsAndAchievements->appendStringData(data);
|
||||||
|
|
||||||
helpBG = new Quad;
|
helpBG = new PauseQuad;
|
||||||
|
helpBG->pauseLevel = 99;
|
||||||
//helpBG->color = 0;
|
//helpBG->color = 0;
|
||||||
helpBG->setTexture("brick");
|
helpBG->setTexture("brick");
|
||||||
helpBG->setRepeatScale(Vector(2, 2));
|
helpBG->setRepeatScale(Vector(2, 2));
|
||||||
|
@ -3428,7 +3431,8 @@ void Game::toggleHelpScreen(bool on, const std::string &label)
|
||||||
helpBG->followCamera = 1;
|
helpBG->followCamera = 1;
|
||||||
addRenderObject(helpBG, LR_HELP);
|
addRenderObject(helpBG, LR_HELP);
|
||||||
|
|
||||||
helpBG2 = new Quad;
|
helpBG2 = new PauseQuad;
|
||||||
|
helpBG2->pauseLevel = 99;
|
||||||
helpBG2->color = 0;
|
helpBG2->color = 0;
|
||||||
helpBG2->alphaMod = 0.5;
|
helpBG2->alphaMod = 0.5;
|
||||||
helpBG2->setWidth(620);
|
helpBG2->setWidth(620);
|
||||||
|
@ -4710,7 +4714,8 @@ void Game::removeState()
|
||||||
core->cameraPos = Vector(0,0);
|
core->cameraPos = Vector(0,0);
|
||||||
sceneColor.stop();
|
sceneColor.stop();
|
||||||
|
|
||||||
controlHint_mouseLeft = controlHint_mouseRight = controlHint_mouseMiddle = controlHint_mouseBody = controlHint_bg = controlHint_image = 0;
|
controlHint_mouseLeft = controlHint_mouseRight = controlHint_mouseMiddle = controlHint_mouseBody = controlHint_image = 0;
|
||||||
|
controlHint_bg = 0;
|
||||||
controlHint_text = 0;
|
controlHint_text = 0;
|
||||||
|
|
||||||
miniMapRender = 0;
|
miniMapRender = 0;
|
||||||
|
|
|
@ -293,7 +293,7 @@ public:
|
||||||
void warpToSceneFromNode(Path *p);
|
void warpToSceneFromNode(Path *p);
|
||||||
Vector fromPosition;
|
Vector fromPosition;
|
||||||
|
|
||||||
Quad *damageSprite;
|
PauseQuad *damageSprite;
|
||||||
|
|
||||||
void toggleDamageSprite(bool on);
|
void toggleDamageSprite(bool on);
|
||||||
|
|
||||||
|
@ -419,7 +419,7 @@ protected:
|
||||||
void onHelpUp();
|
void onHelpUp();
|
||||||
void onHelpDown();
|
void onHelpDown();
|
||||||
bool helpWasPaused;
|
bool helpWasPaused;
|
||||||
Quad *helpBG, *helpBG2;
|
PauseQuad *helpBG, *helpBG2;
|
||||||
AquariaMenuItem *helpUp, *helpDown, *helpCancel;
|
AquariaMenuItem *helpUp, *helpDown, *helpCancel;
|
||||||
TTFText *helpText;
|
TTFText *helpText;
|
||||||
bool inHelpScreen;
|
bool inHelpScreen;
|
||||||
|
@ -445,8 +445,9 @@ protected:
|
||||||
|
|
||||||
void updateCursor(float dt);
|
void updateCursor(float dt);
|
||||||
|
|
||||||
Quad *controlHint_mouseLeft, *controlHint_mouseRight, *controlHint_mouseBody, *controlHint_mouseMiddle, *controlHint_bg, *controlHint_image;
|
Quad *controlHint_mouseLeft, *controlHint_mouseRight, *controlHint_mouseBody, *controlHint_mouseMiddle, *controlHint_image;
|
||||||
Quad *controlHint_shine;
|
Quad *controlHint_shine;
|
||||||
|
PauseQuad *controlHint_bg;
|
||||||
bool controlHint_ignoreClear;
|
bool controlHint_ignoreClear;
|
||||||
BitmapText *controlHint_text;
|
BitmapText *controlHint_text;
|
||||||
|
|
||||||
|
|
|
@ -1214,16 +1214,18 @@ void InGameMenu::show(bool ignoreInput, bool optionsOnly, MenuPage menuPage)
|
||||||
|
|
||||||
if (optionsOnly)
|
if (optionsOnly)
|
||||||
{
|
{
|
||||||
menu_blackout = new Quad;
|
PauseQuad *q = new PauseQuad;
|
||||||
menu_blackout->color = 0;
|
q->color = 0;
|
||||||
menu_blackout->autoWidth = AUTO_VIRTUALWIDTH;
|
q->pauseLevel = 99;
|
||||||
menu_blackout->autoHeight = AUTO_VIRTUALHEIGHT;
|
q->autoWidth = AUTO_VIRTUALWIDTH;
|
||||||
menu_blackout->followCamera = 1;
|
q->autoHeight = AUTO_VIRTUALHEIGHT;
|
||||||
menu_blackout->position = Vector(400,300);
|
q->followCamera = 1;
|
||||||
menu_blackout->alphaMod = 0.75;
|
q->position = Vector(400,300);
|
||||||
menu_blackout->alpha = 0;
|
q->alphaMod = 0.75;
|
||||||
menu_blackout->alpha.interpolateTo(1, 0.5);
|
q->alpha = 0;
|
||||||
game->addRenderObject(menu_blackout, LR_AFTER_EFFECTS);
|
q->alpha.interpolateTo(1, 0.5);
|
||||||
|
game->addRenderObject(q, LR_AFTER_EFFECTS);
|
||||||
|
menu_blackout = q;
|
||||||
|
|
||||||
menuBg2->alpha = 0;
|
menuBg2->alpha = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,13 +41,14 @@ static bool _modname_cmp(const ModIcon *a, const ModIcon *b)
|
||||||
}
|
}
|
||||||
|
|
||||||
ModSelectorScreen::ModSelectorScreen()
|
ModSelectorScreen::ModSelectorScreen()
|
||||||
: Quad()
|
: PauseQuad()
|
||||||
, ActionMapper()
|
, ActionMapper()
|
||||||
, dlText(dsq->smallFont)
|
, dlText(dsq->smallFont)
|
||||||
, gotServerList(false)
|
, gotServerList(false)
|
||||||
, currentPanel(-1)
|
, currentPanel(-1)
|
||||||
, subtext(dsq->subsFont)
|
, subtext(dsq->subsFont)
|
||||||
{
|
{
|
||||||
|
pauseLevel = 99;
|
||||||
followCamera = 1;
|
followCamera = 1;
|
||||||
shareAlphaWithChildren = false;
|
shareAlphaWithChildren = false;
|
||||||
alpha = 1;
|
alpha = 1;
|
||||||
|
@ -260,6 +261,7 @@ void ModSelectorScreen::init()
|
||||||
|
|
||||||
showPanel(0);
|
showPanel(0);
|
||||||
|
|
||||||
|
subbox.pauseLevel = 99;
|
||||||
subbox.position = Vector(0,260);
|
subbox.position = Vector(0,260);
|
||||||
subbox.alpha = 0;
|
subbox.alpha = 0;
|
||||||
subbox.alphaMod = 0.7f;
|
subbox.alphaMod = 0.7f;
|
||||||
|
|
|
@ -141,7 +141,7 @@ protected:
|
||||||
int x, y;
|
int x, y;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ModSelectorScreen : public Quad, public ActionMapper
|
class ModSelectorScreen : public PauseQuad, public ActionMapper
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ModSelectorScreen();
|
ModSelectorScreen();
|
||||||
|
@ -175,7 +175,7 @@ protected:
|
||||||
MenuBasicBar rightbar;
|
MenuBasicBar rightbar;
|
||||||
size_t currentPanel;
|
size_t currentPanel;
|
||||||
BitmapText subtext;
|
BitmapText subtext;
|
||||||
Quad subbox;
|
PauseQuad subbox;
|
||||||
float subFadeT;
|
float subFadeT;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,6 @@ void Quad::initQuad()
|
||||||
borderAlpha = 0.5;
|
borderAlpha = 0.5;
|
||||||
repeatToFillScale = Vector(1,1);
|
repeatToFillScale = Vector(1,1);
|
||||||
|
|
||||||
autoWidth = autoHeight = 0;
|
|
||||||
|
|
||||||
renderBorder = false;
|
renderBorder = false;
|
||||||
renderCenter = true;
|
renderCenter = true;
|
||||||
width = 2; height = 2;
|
width = 2; height = 2;
|
||||||
|
@ -292,16 +290,6 @@ void Quad::onUpdate(float dt)
|
||||||
{
|
{
|
||||||
RenderObject::onUpdate(dt);
|
RenderObject::onUpdate(dt);
|
||||||
|
|
||||||
if (autoWidth == AUTO_VIRTUALWIDTH)
|
|
||||||
width = core->getVirtualWidth();
|
|
||||||
else if (autoWidth == AUTO_VIRTUALHEIGHT)
|
|
||||||
width = core->getVirtualHeight();
|
|
||||||
|
|
||||||
if (autoHeight == AUTO_VIRTUALWIDTH)
|
|
||||||
height = core->getVirtualWidth();
|
|
||||||
else if (autoHeight == AUTO_VIRTUALHEIGHT)
|
|
||||||
height = core->getVirtualHeight();
|
|
||||||
|
|
||||||
if (grid && alpha.x > 0 && alphaMod > 0)
|
if (grid && alpha.x > 0 && alphaMod > 0)
|
||||||
{
|
{
|
||||||
grid->update(dt);
|
grid->update(dt);
|
||||||
|
@ -341,7 +329,7 @@ void Quad::onSetTexture()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PauseQuad::PauseQuad() : Quad(), pauseLevel(0), positionSnapTo(0)
|
PauseQuad::PauseQuad() : Quad(), pauseLevel(0), positionSnapTo(0), autoWidth(0), autoHeight(0)
|
||||||
{
|
{
|
||||||
addType(SCO_PAUSEQUAD);
|
addType(SCO_PAUSEQUAD);
|
||||||
}
|
}
|
||||||
|
@ -352,6 +340,27 @@ PauseQuad::~PauseQuad()
|
||||||
|
|
||||||
void PauseQuad::onUpdate(float dt)
|
void PauseQuad::onUpdate(float dt)
|
||||||
{
|
{
|
||||||
|
if(autoWidth || autoHeight)
|
||||||
|
{
|
||||||
|
float w = width, h = height;
|
||||||
|
if (autoWidth == AUTO_VIRTUALWIDTH)
|
||||||
|
w = core->getVirtualWidth();
|
||||||
|
else if (autoWidth == AUTO_VIRTUALHEIGHT)
|
||||||
|
w = core->getVirtualHeight();
|
||||||
|
|
||||||
|
if (autoHeight == AUTO_VIRTUALWIDTH)
|
||||||
|
h = core->getVirtualWidth();
|
||||||
|
else if (autoHeight == AUTO_VIRTUALHEIGHT)
|
||||||
|
h = core->getVirtualHeight();
|
||||||
|
|
||||||
|
if(w != width || h != height)
|
||||||
|
{
|
||||||
|
width = w;
|
||||||
|
height = h;
|
||||||
|
updateTexCoords();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (positionSnapTo)
|
if (positionSnapTo)
|
||||||
this->position = *positionSnapTo;
|
this->position = *positionSnapTo;
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ public:
|
||||||
TexCoordBox texcoords;
|
TexCoordBox texcoords;
|
||||||
|
|
||||||
// TODO: this should be a bitmask
|
// TODO: this should be a bitmask
|
||||||
char autoWidth, autoHeight;
|
|
||||||
bool renderQuad, renderCenter, renderBorder;
|
bool renderQuad, renderCenter, renderBorder;
|
||||||
|
|
||||||
float borderAlpha;
|
float borderAlpha;
|
||||||
|
@ -119,6 +119,7 @@ public:
|
||||||
PauseQuad();
|
PauseQuad();
|
||||||
virtual ~PauseQuad();
|
virtual ~PauseQuad();
|
||||||
int pauseLevel;
|
int pauseLevel;
|
||||||
|
char autoWidth, autoHeight;
|
||||||
|
|
||||||
void setPositionSnapTo(InterpolatedVector *positionSnapTo);
|
void setPositionSnapTo(InterpolatedVector *positionSnapTo);
|
||||||
protected:
|
protected:
|
||||||
|
@ -137,7 +138,5 @@ public:
|
||||||
float collideRadius;
|
float collideRadius;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define QUAD(x) Quad *x = new Quad; addRenderObject(x);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue