mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-11-29 03:33:48 +00:00
Preliminary support for vertial orientation:
- remove top & bottom black bars - fix minimap position to take virtual y offset into account - same for editor bar, and version label - fix grid render errorneously assuming that core->cameraPos.y was always 0 - fix typo in gradient height adjustment - don't slide minimap when there's enough virtual space so that it's not in the way
This commit is contained in:
parent
b8dee723a2
commit
2cf5932eb3
8 changed files with 33 additions and 45 deletions
|
@ -171,7 +171,7 @@ DSQ::DSQ(const std::string& fileSystem, const std::string& extraDataDir)
|
|||
_canSkipCutscene = false;
|
||||
skippingCutscene = false;
|
||||
|
||||
bar_left = bar_right = bar_up = bar_down = barFade_left = barFade_right = 0;
|
||||
bar_left = bar_right = barFade_left = barFade_right = 0;
|
||||
|
||||
watchQuitFlag = false;
|
||||
watchForQuit = false;
|
||||
|
@ -1382,12 +1382,8 @@ void DSQ::recreateBlackBars()
|
|||
abarFade_right = barFade_right->alpha;
|
||||
removeRenderObject(barFade_right);
|
||||
}
|
||||
if (bar_up)
|
||||
removeRenderObject(bar_up);
|
||||
if (bar_down)
|
||||
removeRenderObject(bar_down);
|
||||
|
||||
bar_left = bar_right = bar_up = bar_down = barFade_left = barFade_right = 0;
|
||||
bar_left = bar_right = barFade_left = barFade_right = 0;
|
||||
|
||||
if (getVirtualWidth() > 800)
|
||||
{
|
||||
|
@ -1451,31 +1447,6 @@ void DSQ::recreateBlackBars()
|
|||
barFade_left->alpha = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// top and bottom bars are not toggle-able, they will always be on if they are needed
|
||||
if (getVirtualHeight() > 600)
|
||||
{
|
||||
int sz2 = (getVirtualHeight() - baseVirtualHeight)/2.0f;
|
||||
bar_up = new Quad;
|
||||
{
|
||||
bar_up->position = Vector(400, -sz2);
|
||||
bar_up->setWidthHeight(800, sz2*2);
|
||||
bar_up->color = 0;
|
||||
bar_up->followCamera = 1;
|
||||
bar_up->cull = 0;
|
||||
}
|
||||
addRenderObject(bar_up, LR_BLACKBARS);
|
||||
|
||||
bar_down = new Quad;
|
||||
{
|
||||
bar_down->position = Vector(400, 600 + sz2);
|
||||
bar_down->setWidthHeight(800, sz2*2);
|
||||
bar_down->color = 0;
|
||||
bar_down->followCamera = 1;
|
||||
bar_down->cull = 0;
|
||||
}
|
||||
addRenderObject(bar_down, LR_BLACKBARS);
|
||||
}
|
||||
}
|
||||
|
||||
void DSQ::setBlackBarsColor(Vector color)
|
||||
|
@ -2011,10 +1982,6 @@ void DSQ::shutdown()
|
|||
removeRenderObject(barFade_left);
|
||||
if (barFade_right)
|
||||
removeRenderObject(barFade_right);
|
||||
if (bar_up)
|
||||
removeRenderObject(bar_up);
|
||||
if (bar_down)
|
||||
removeRenderObject(bar_down);
|
||||
|
||||
if (cutscene_bg)
|
||||
removeRenderObject(cutscene_bg);
|
||||
|
@ -3746,7 +3713,7 @@ void DSQ::onUpdate(float dt)
|
|||
// messy
|
||||
if (versionLabel && versionLabel->alpha.x > 0)
|
||||
{
|
||||
versionLabel->position = Vector(10 - getVirtualOffX(), 575);
|
||||
versionLabel->position = Vector(10 - getVirtualOffX(), 575 + getVirtualOffY());
|
||||
}
|
||||
|
||||
if (noEffectTimer > 0)
|
||||
|
|
|
@ -148,7 +148,7 @@ public:
|
|||
Quad *cursor, *cursorGlow, *cursorBlinker;
|
||||
PauseQuad *overlay, *tfader, *overlay2, *overlay3, *overlayRed;
|
||||
PauseQuad *sceneColorOverlay;
|
||||
Quad *bar_left, *bar_right, *bar_up, *bar_down;
|
||||
Quad *bar_left, *bar_right;
|
||||
Quad *barFade_left, *barFade_right;
|
||||
|
||||
CountedPtr<Texture> texCursor, texCursorSwim, texCursorBurst, texCursorSing, texCursorLook;
|
||||
|
|
|
@ -183,13 +183,19 @@ void GridRender::onRender(const RenderState& rs) const
|
|||
if(!primsToDraw)
|
||||
return;
|
||||
|
||||
const TileVector ct(core->cameraPos);
|
||||
const int H = primIndexInLine.size();
|
||||
const float vh = core->getVirtualHeight();
|
||||
const float voy = core->getVirtualOffY();
|
||||
const float vox = core->getVirtualOffX();
|
||||
|
||||
const Vector topleft = core->getTopLeftCornerInWorldCoords();
|
||||
const TileVector ct(topleft);
|
||||
const int H = (int)primIndexInLine.size();
|
||||
int startY = ct.y;
|
||||
|
||||
// Note that it's possible that the scale factor is negative (mods can use this),
|
||||
// so this might end up upside down. Still needs to render correctly.
|
||||
const int height = int((600 * (core->invGlobalScale))/TILE_SIZE) + 1;
|
||||
|
||||
const int height = int((vh * (core->invGlobalScale))/TILE_SIZE) + 1;
|
||||
int endY = ct.y+height;
|
||||
if(endY < startY)
|
||||
std::swap(startY, endY);
|
||||
|
|
|
@ -249,7 +249,8 @@ void MiniMapRender::slide(int slide)
|
|||
offset.interpolateTo(Vector(0, 0), 0.28f, 0, 0, 1);
|
||||
break;
|
||||
case 1:
|
||||
offset.interpolateTo(Vector(0, getMiniMapHeight()+5-600), 0.28f, 0, 0, 1);
|
||||
if(core->getVirtualOffX() < getMiniMapWidth() && core->getVirtualOffY() < getMiniMapHeight())
|
||||
offset.interpolateTo(Vector(0, getMiniMapHeight()+5-600), 0.28f, 0, 0, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -294,7 +295,7 @@ void MiniMapRender::onUpdate(float dt)
|
|||
RenderObject::onUpdate(dt);
|
||||
|
||||
position.x = core->getVirtualWidth() - core->getVirtualOffX() - getMiniMapWidth()*0.5f;
|
||||
position.y = 600 - getMiniMapHeight()*0.5f;
|
||||
position.y = 600 - getMiniMapHeight()*0.5f + core->getVirtualOffY();
|
||||
position.z = 2.9f;
|
||||
|
||||
waterSin += dt * (bitSizeLookupPeriod / (2*PI));
|
||||
|
|
|
@ -667,9 +667,9 @@ void SceneEditor::init()
|
|||
text->setFontSize(6);
|
||||
|
||||
text->followCamera = 1;
|
||||
text->position = Vector(125,20,4.5);
|
||||
text->position = Vector(100,0);
|
||||
btnMenu->addChild(text, PM_POINTER);
|
||||
|
||||
game->addRenderObject(text, LR_HUD);
|
||||
text->alpha = 0;
|
||||
on = false;
|
||||
|
||||
|
@ -2396,6 +2396,8 @@ void SceneEditor::updateText()
|
|||
{
|
||||
// FIXME: make sure this isn't called while the editor isn't active
|
||||
|
||||
btnMenu->position = Vector(20, 20 - core->getVirtualOffY());
|
||||
|
||||
const Vector cursor = dsq->getGameCursorPosition();
|
||||
TileVector tv(cursor);
|
||||
|
||||
|
|
|
@ -625,6 +625,16 @@ Vector Core::getGameCursorPosition() const
|
|||
return getGamePosition(mouse.position);
|
||||
}
|
||||
|
||||
Vector Core::getTopLeftCornerInWorldCoords() const
|
||||
{
|
||||
return getGamePosition(Vector(-virtualOffX, -virtualOffY));
|
||||
}
|
||||
|
||||
Vector Core::getBottomRightCornerInWorldCoords() const
|
||||
{
|
||||
return getGamePosition(Vector(virtualOffX, virtualOffY));
|
||||
}
|
||||
|
||||
Vector Core::getGamePosition(const Vector &winpos) const
|
||||
{
|
||||
return cameraPos + (winpos * invGlobalScale);
|
||||
|
|
|
@ -274,6 +274,8 @@ public:
|
|||
void updateWindowDrawSize(int w, int h);
|
||||
|
||||
Vector getGameCursorPosition() const;
|
||||
Vector getTopLeftCornerInWorldCoords() const;
|
||||
Vector getBottomRightCornerInWorldCoords() const;
|
||||
Vector getGamePosition(const Vector &winpos) const;
|
||||
Vector getWindowPosition(const Vector& worldpos) const;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ void Gradient::onUpdate(float dt)
|
|||
|
||||
if (autoHeight == AUTO_VIRTUALHEIGHT)
|
||||
{
|
||||
scale.y = core->getVirtualWidth();
|
||||
scale.y = core->getVirtualHeight();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue