mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-05-10 19:13:44 +00:00
Build fixes for Linux, some warnings and compatibility fixes for C++17 and up
This commit is contained in:
parent
924bc058b4
commit
74ad8f7804
36 changed files with 126 additions and 225 deletions
|
@ -137,8 +137,8 @@ class Avatar : public Entity, public ActionMapper
|
||||||
public:
|
public:
|
||||||
Avatar();
|
Avatar();
|
||||||
virtual ~Avatar();
|
virtual ~Avatar();
|
||||||
void destroy();
|
void destroy() OVERRIDE;
|
||||||
void action(int actionID, int state, int source, InputDevice device);
|
void action(int actionID, int state, int source, InputDevice device) OVERRIDE;
|
||||||
AvatarState state;
|
AvatarState state;
|
||||||
float burst, burstTimer;
|
float burst, burstTimer;
|
||||||
float burstDelay;
|
float burstDelay;
|
||||||
|
@ -151,8 +151,7 @@ public:
|
||||||
void revive();
|
void revive();
|
||||||
|
|
||||||
bool canWarp;
|
bool canWarp;
|
||||||
void entityDied(Entity *e);
|
void entityDied(Entity *e) OVERRIDE;
|
||||||
void onCollide(Entity *e);
|
|
||||||
bool zoomOverriden;
|
bool zoomOverriden;
|
||||||
void clampPosition();
|
void clampPosition();
|
||||||
|
|
||||||
|
@ -170,8 +169,8 @@ public:
|
||||||
void refreshDualFormModel();
|
void refreshDualFormModel();
|
||||||
void switchDualFormMode();
|
void switchDualFormMode();
|
||||||
|
|
||||||
void enableInput();
|
void enableInput() OVERRIDE;
|
||||||
void disableInput();
|
void disableInput() OVERRIDE;
|
||||||
void clearTargets();
|
void clearTargets();
|
||||||
bool singing;
|
bool singing;
|
||||||
|
|
||||||
|
@ -226,7 +225,7 @@ public:
|
||||||
int getBurstDistance();
|
int getBurstDistance();
|
||||||
int getStopDistance();
|
int getStopDistance();
|
||||||
int looking;
|
int looking;
|
||||||
std::string getIdleAnimName();
|
std::string getIdleAnimName() OVERRIDE;
|
||||||
bool isRolling() { return rolling; }
|
bool isRolling() { return rolling; }
|
||||||
int rollDir;
|
int rollDir;
|
||||||
std::string getBurstAnimName();
|
std::string getBurstAnimName();
|
||||||
|
@ -253,7 +252,7 @@ public:
|
||||||
Vector headPosition;
|
Vector headPosition;
|
||||||
void updatePosition();
|
void updatePosition();
|
||||||
float quickSongCastDelay;
|
float quickSongCastDelay;
|
||||||
void onAnimationKeyPassed(int key);
|
void onAnimationKeyPassed(int key) OVERRIDE;
|
||||||
|
|
||||||
bool isSwimming();
|
bool isSwimming();
|
||||||
|
|
||||||
|
@ -301,7 +300,7 @@ public:
|
||||||
Web *web;
|
Web *web;
|
||||||
float rollDelay;
|
float rollDelay;
|
||||||
|
|
||||||
bool canSetBoneLock();
|
bool canSetBoneLock() OVERRIDE;
|
||||||
|
|
||||||
void revert();
|
void revert();
|
||||||
void doBindSong();
|
void doBindSong();
|
||||||
|
@ -341,8 +340,8 @@ protected:
|
||||||
void checkUpgradeForShot(Shot *s);
|
void checkUpgradeForShot(Shot *s);
|
||||||
size_t getNumShots();
|
size_t getNumShots();
|
||||||
void lockToWallCommon();
|
void lockToWallCommon();
|
||||||
void onSetBoneLock();
|
void onSetBoneLock() OVERRIDE;
|
||||||
void onUpdateBoneLock();
|
void onUpdateBoneLock() OVERRIDE;
|
||||||
|
|
||||||
void adjustHeadRot();
|
void adjustHeadRot();
|
||||||
std::string lastHeadTexture;
|
std::string lastHeadTexture;
|
||||||
|
@ -375,8 +374,8 @@ protected:
|
||||||
Vector fallGravity;
|
Vector fallGravity;
|
||||||
int lastOutOfWaterMaxSpeed;
|
int lastOutOfWaterMaxSpeed;
|
||||||
|
|
||||||
void onIdle();
|
void onIdle() OVERRIDE;
|
||||||
void onHeal(int type);
|
void onHeal(int type) OVERRIDE;
|
||||||
ParticleEffect biteLeftEmitter, biteRightEmitter, swimEmitter, auraHitEmitter;
|
ParticleEffect biteLeftEmitter, biteRightEmitter, swimEmitter, auraHitEmitter;
|
||||||
ParticleEffect auraEmitter, auraLowEmitter, wakeEmitter, healEmitter, hitEmitter, rollLeftEmitter, rollRightEmitter, spiritBeaconEmitter, plungeEmitter;
|
ParticleEffect auraEmitter, auraLowEmitter, wakeEmitter, healEmitter, hitEmitter, rollLeftEmitter, rollRightEmitter, spiritBeaconEmitter, plungeEmitter;
|
||||||
ParticleEffect speedEmitter, defenseEmitter, invincibleEmitter, regenEmitter;
|
ParticleEffect speedEmitter, defenseEmitter, invincibleEmitter, regenEmitter;
|
||||||
|
@ -391,7 +390,7 @@ protected:
|
||||||
int getQuadrantDirection(int lastQuad, int quad);
|
int getQuadrantDirection(int lastQuad, int quad);
|
||||||
void updateRoll(float dt);
|
void updateRoll(float dt);
|
||||||
int lastQuad, lastQuadDir;
|
int lastQuad, lastQuadDir;
|
||||||
void onDamage(DamageData &d);
|
void onDamage(DamageData &d) OVERRIDE;
|
||||||
void updateHair(float dt);
|
void updateHair(float dt);
|
||||||
|
|
||||||
void lostTarget(int i, Entity *e);
|
void lostTarget(int i, Entity *e);
|
||||||
|
@ -400,7 +399,7 @@ protected:
|
||||||
void updateAura(float dt);
|
void updateAura(float dt);
|
||||||
|
|
||||||
|
|
||||||
void onHealthChange(float change);
|
void onHealthChange(float change) OVERRIDE;
|
||||||
void startWallBurst(bool useCursor=true);
|
void startWallBurst(bool useCursor=true);
|
||||||
void startBurst();
|
void startBurst();
|
||||||
|
|
||||||
|
@ -417,8 +416,8 @@ protected:
|
||||||
void endCharge();
|
void endCharge();
|
||||||
bool canMove;
|
bool canMove;
|
||||||
|
|
||||||
void onEnterState(int action);
|
void onEnterState(int action) OVERRIDE;
|
||||||
void onExitState(int action);
|
void onExitState(int action) OVERRIDE;
|
||||||
std::vector<ParticleEffect*>targetQuads;
|
std::vector<ParticleEffect*>targetQuads;
|
||||||
Quad *blinder, *fader, *tripper;
|
Quad *blinder, *fader, *tripper;
|
||||||
void applyBlindEffects();
|
void applyBlindEffects();
|
||||||
|
@ -432,7 +431,7 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
|
|
||||||
Quad *glow;
|
Quad *glow;
|
||||||
bool swimming;
|
bool swimming;
|
||||||
|
|
|
@ -28,8 +28,8 @@ public:
|
||||||
protected:
|
protected:
|
||||||
float beamWidth;
|
float beamWidth;
|
||||||
void onRender(const RenderState& rs) const OVERRIDE;
|
void onRender(const RenderState& rs) const OVERRIDE;
|
||||||
void onEndOfLife();
|
void onEndOfLife() OVERRIDE;
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -48,8 +48,6 @@ SET(AQUARIA_SRCS
|
||||||
Ingredient.h
|
Ingredient.h
|
||||||
Intro.cpp
|
Intro.cpp
|
||||||
Intro.h
|
Intro.h
|
||||||
Logo.cpp
|
|
||||||
Logo.h
|
|
||||||
Main.cpp
|
Main.cpp
|
||||||
ManaBall.cpp
|
ManaBall.cpp
|
||||||
ManaBall.h
|
ManaBall.h
|
||||||
|
@ -113,12 +111,13 @@ SET(AQUARIA_SRCS
|
||||||
|
|
||||||
set(EXETYPE)
|
set(EXETYPE)
|
||||||
|
|
||||||
|
option(AQUARIA_CONSOLE_WINDOW "Enable console output (always on in debug builds)" TRUE)
|
||||||
IF(WIN32)
|
|
||||||
option(AQUARIA_CONSOLE_WINDOW "Enable the console window (always on in debug builds)" FALSE)
|
|
||||||
if(AQUARIA_CONSOLE_WINDOW OR (CMAKE_BUILD_TYPE STREQUAL "Debug"))
|
if(AQUARIA_CONSOLE_WINDOW OR (CMAKE_BUILD_TYPE STREQUAL "Debug"))
|
||||||
add_definitions(-DAQUARIA_ENABLE_CONSOLE_LOG)
|
add_definitions(-DAQUARIA_ENABLE_CONSOLE_LOG)
|
||||||
else()
|
endif()
|
||||||
|
|
||||||
|
IF(WIN32)
|
||||||
|
if(NOT AQUARIA_CONSOLE_WINDOW)
|
||||||
SET(EXETYPE WIN32)
|
SET(EXETYPE WIN32)
|
||||||
endif()
|
endif()
|
||||||
SET(AQUARIA_SRCS ${AQUARIA_SRCS} aquaria.rc)
|
SET(AQUARIA_SRCS ${AQUARIA_SRCS} aquaria.rc)
|
||||||
|
|
|
@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "DSQ.h"
|
#include "DSQ.h"
|
||||||
#include "States.h"
|
#include "States.h"
|
||||||
#include "Game.h"
|
#include "Game.h"
|
||||||
#include "Logo.h"
|
|
||||||
#include "Avatar.h"
|
#include "Avatar.h"
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
#include "Avatar.h"
|
#include "Avatar.h"
|
||||||
|
|
|
@ -61,8 +61,8 @@ class Element : public Quad
|
||||||
public:
|
public:
|
||||||
Element();
|
Element();
|
||||||
~Element();
|
~Element();
|
||||||
void destroy();
|
void destroy() OVERRIDE;
|
||||||
void update(float dt);
|
void update(float dt) OVERRIDE;
|
||||||
size_t templateIdx;
|
size_t templateIdx;
|
||||||
int bgLayer;
|
int bgLayer;
|
||||||
int tag;
|
int tag;
|
||||||
|
|
|
@ -76,7 +76,7 @@ public:
|
||||||
ACT_CLICK = 0,
|
ACT_CLICK = 0,
|
||||||
ACT_RANGE = 1
|
ACT_RANGE = 1
|
||||||
};
|
};
|
||||||
void destroy();
|
void destroy() OVERRIDE;
|
||||||
|
|
||||||
bool isEntityDead() const {return entityDead;}
|
bool isEntityDead() const {return entityDead;}
|
||||||
std::string name;
|
std::string name;
|
||||||
|
@ -84,7 +84,7 @@ public:
|
||||||
InterpolatedVector vel2;
|
InterpolatedVector vel2;
|
||||||
float activationRadius;
|
float activationRadius;
|
||||||
void render(const RenderState& rs) const OVERRIDE;
|
void render(const RenderState& rs) const OVERRIDE;
|
||||||
void update(float dt);
|
void update(float dt) OVERRIDE;
|
||||||
|
|
||||||
void spawnParticlesFromCollisionMask(const char *p, unsigned intv=1, int layer = LR_PARTICLES, float rotz = 0);
|
void spawnParticlesFromCollisionMask(const char *p, unsigned intv=1, int layer = LR_PARTICLES, float rotz = 0);
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ public:
|
||||||
|
|
||||||
void push(const Vector &vec, float time, float maxSpeed, float dmg);
|
void push(const Vector &vec, float time, float maxSpeed, float dmg);
|
||||||
|
|
||||||
bool canSetState(int state);
|
bool canSetState(int state) OVERRIDE;
|
||||||
|
|
||||||
virtual void message(const std::string &msg, int v) {}
|
virtual void message(const std::string &msg, int v) {}
|
||||||
virtual int messageVariadic(lua_State *L, int nparams) { return 0; }
|
virtual int messageVariadic(lua_State *L, int nparams) { return 0; }
|
||||||
|
@ -361,12 +361,12 @@ protected:
|
||||||
virtual void onDieEaten() {}
|
virtual void onDieEaten() {}
|
||||||
IngredientData *ingredientData;
|
IngredientData *ingredientData;
|
||||||
int vs[EV_MAX];
|
int vs[EV_MAX];
|
||||||
void onEndOfLife();
|
void onEndOfLife() OVERRIDE;
|
||||||
|
|
||||||
void updateLance(float dt);
|
void updateLance(float dt);
|
||||||
|
|
||||||
void onFHScale();
|
void onFHScale();
|
||||||
void onFH();
|
void onFH() OVERRIDE;
|
||||||
float dieTimer;
|
float dieTimer;
|
||||||
BounceType bounceType;
|
BounceType bounceType;
|
||||||
Entity* riding;
|
Entity* riding;
|
||||||
|
@ -402,11 +402,11 @@ protected:
|
||||||
|
|
||||||
void doDeathEffects(float manaBallEnergy=0, bool die=true);
|
void doDeathEffects(float manaBallEnergy=0, bool die=true);
|
||||||
|
|
||||||
void onEnterState(int action);
|
void onEnterState(int action) OVERRIDE;
|
||||||
void onExitState(int action);
|
void onExitState(int action) OVERRIDE;
|
||||||
|
|
||||||
|
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
|
|
||||||
Vector pushVec;
|
Vector pushVec;
|
||||||
float pushDamage;
|
float pushDamage;
|
||||||
|
|
|
@ -910,8 +910,6 @@ void Game::ensureLimit(Entity *me, int num, int state)
|
||||||
|
|
||||||
void Game::establishEntity(Entity *e, int id, Vector startPos)
|
void Game::establishEntity(Entity *e, int id, Vector startPos)
|
||||||
{
|
{
|
||||||
// e->layer must be set BEFORE calling this function!
|
|
||||||
|
|
||||||
assert(id); // 0 is invalid/reserved
|
assert(id); // 0 is invalid/reserved
|
||||||
assert(!getEntityByID(id)); // must not already exist
|
assert(!getEntityByID(id)); // must not already exist
|
||||||
|
|
||||||
|
@ -923,7 +921,9 @@ void Game::establishEntity(Entity *e, int id, Vector startPos)
|
||||||
// otherwise the script is expected to set the render layer here if not using the default.
|
// otherwise the script is expected to set the render layer here if not using the default.
|
||||||
e->init();
|
e->init();
|
||||||
|
|
||||||
addRenderObject(e, e->layer); // layer was just set in init()
|
unsigned layer = e->layer; // layer was either set in ctor, or in init()
|
||||||
|
e->layer = LR_NONE; // addRenderObject wants this to be not set
|
||||||
|
addRenderObject(e, layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity* Game::getEntityByID(int id) const
|
Entity* Game::getEntityByID(int id) const
|
||||||
|
@ -1005,9 +1005,9 @@ Entity* Game::createEntityOnMap(const EntitySaveData& sav)
|
||||||
ScriptedEntity *e = new ScriptedEntity(type, pos, ET_ENEMY);
|
ScriptedEntity *e = new ScriptedEntity(type, pos, ET_ENEMY);
|
||||||
e->rotation.z = sav.rot;
|
e->rotation.z = sav.rot;
|
||||||
|
|
||||||
int idx = getIdxForEntityType(type);
|
|
||||||
EntitySaveData copy = sav;
|
EntitySaveData copy = sav;
|
||||||
copy.name = type;
|
copy.name = type;
|
||||||
|
copy.idx = getIdxForEntityType(type);
|
||||||
entitySaveData.push_back(copy);
|
entitySaveData.push_back(copy);
|
||||||
|
|
||||||
establishEntity(e, sav.id, pos);
|
establishEntity(e, sav.id, pos);
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
GridRender(ObsType obsType);
|
GridRender(ObsType obsType);
|
||||||
protected:
|
protected:
|
||||||
ObsType obsType;
|
ObsType obsType;
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
void onRender(const RenderState& rs) const OVERRIDE;
|
void onRender(const RenderState& rs) const OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ class MiniMapRender : public RenderObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MiniMapRender();
|
MiniMapRender();
|
||||||
void destroy();
|
void destroy() OVERRIDE;
|
||||||
|
|
||||||
bool isCursorIn();
|
bool isCursorIn();
|
||||||
void slide(int slid);
|
void slide(int slid);
|
||||||
|
@ -66,7 +66,7 @@ protected:
|
||||||
bool mouseDown;
|
bool mouseDown;
|
||||||
bool doRender;
|
bool doRender;
|
||||||
float lightLevel;
|
float lightLevel;
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
void onRender(const RenderState& rs) const OVERRIDE;
|
void onRender(const RenderState& rs) const OVERRIDE;
|
||||||
void renderIcon(const MinimapIcon *ico, const Vector& pos) const;
|
void renderIcon(const MinimapIcon *ico, const Vector& pos) const;
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ public:
|
||||||
HairNode *getHairNode(int idx);
|
HairNode *getHairNode(int idx);
|
||||||
protected:
|
protected:
|
||||||
float segmentLength;
|
float segmentLength;
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
void onRender(const RenderState& rs) const OVERRIDE;
|
void onRender(const RenderState& rs) const OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright (C) 2007, 2010 - Bit-Blot
|
|
||||||
|
|
||||||
This file is part of Aquaria.
|
|
||||||
|
|
||||||
Aquaria is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU General Public License
|
|
||||||
as published by the Free Software Foundation; either version 2
|
|
||||||
of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
See the GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
|
||||||
#include "Logo.h"
|
|
||||||
|
|
||||||
void Logo::JumpTitle::act()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Logo::Logo() : StateObject()
|
|
||||||
{
|
|
||||||
registerState(this, "Logo");
|
|
||||||
}
|
|
||||||
|
|
||||||
void Logo::applyState()
|
|
||||||
{
|
|
||||||
StateObject::applyState();
|
|
||||||
|
|
||||||
|
|
||||||
core->setClearColor(Vector(1,1,1));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Quad *q = new Quad;
|
|
||||||
{
|
|
||||||
q->setTexture("sky");
|
|
||||||
q->setWidthHeight(800, 600);
|
|
||||||
q->position = Vector(400,300);
|
|
||||||
q->alpha = 0;
|
|
||||||
q->alpha.interpolateTo(1, 3, 0);
|
|
||||||
}
|
|
||||||
addRenderObject(q);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Logo::removeState()
|
|
||||||
{
|
|
||||||
StateObject::removeState();
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright (C) 2007, 2010 - Bit-Blot
|
|
||||||
|
|
||||||
This file is part of Aquaria.
|
|
||||||
|
|
||||||
Aquaria is free software; you can redistribute it and/or
|
|
||||||
modify it under the terms of the GNU General Public License
|
|
||||||
as published by the Free Software Foundation; either version 2
|
|
||||||
of the License, or (at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
See the GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program; if not, write to the Free Software
|
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
|
||||||
#ifndef __logo__
|
|
||||||
#define __logo__
|
|
||||||
|
|
||||||
#include "DSQ.h"
|
|
||||||
|
|
||||||
class Logo : public StateObject
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Logo();
|
|
||||||
EVENT(JumpTitle, jumpTitle)
|
|
||||||
void applyState();
|
|
||||||
void removeState();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -496,7 +496,6 @@ void SceneEditor::init()
|
||||||
|
|
||||||
dsq->game->addRenderObject(text, LR_HUD);
|
dsq->game->addRenderObject(text, LR_HUD);
|
||||||
text->alpha = 0;
|
text->alpha = 0;
|
||||||
selectedVariation = -1;
|
|
||||||
on = false;
|
on = false;
|
||||||
|
|
||||||
addAction(MakeFunctionEvent(SceneEditor, loadScene), KEY_F1, 0);
|
addAction(MakeFunctionEvent(SceneEditor, loadScene), KEY_F1, 0);
|
||||||
|
|
|
@ -236,7 +236,7 @@ protected:
|
||||||
void mouseButtonLeft();
|
void mouseButtonLeft();
|
||||||
void mouseButtonRight();
|
void mouseButtonRight();
|
||||||
|
|
||||||
size_t curElement, selectedVariation, possibleSelectedIdx;
|
size_t curElement;
|
||||||
|
|
||||||
Quad *placer;
|
Quad *placer;
|
||||||
DebugFont *text;
|
DebugFont *text;
|
||||||
|
|
|
@ -48,9 +48,9 @@ class Strand : public RenderObject, public Segmented
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Strand(const Vector &position, size_t segs, size_t dist=32);
|
Strand(const Vector &position, size_t segs, size_t dist=32);
|
||||||
void destroy();
|
void destroy() OVERRIDE;
|
||||||
protected:
|
protected:
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
void onRender(const RenderState& rs) const OVERRIDE;
|
void onRender(const RenderState& rs) const OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -151,7 +151,7 @@ void GameOver::applyState()
|
||||||
q->setWidthHeight(800, 600);
|
q->setWidthHeight(800, 600);
|
||||||
q->position = Vector(400,300,-0.1f);
|
q->position = Vector(400,300,-0.1f);
|
||||||
}
|
}
|
||||||
addRenderObject(q);
|
addRenderObject(q, LR_ZERO);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -41,9 +41,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
float existence;
|
float existence;
|
||||||
Entity *parentEntity;
|
Entity *parentEntity;
|
||||||
void onEndOfLife();
|
void onEndOfLife() OVERRIDE;
|
||||||
std::vector<Vector> points;
|
std::vector<Vector> points;
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
void onRender(const RenderState& rs) const OVERRIDE;
|
void onRender(const RenderState& rs) const OVERRIDE;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -13,11 +13,11 @@ public:
|
||||||
virtual void setWidth(float width) = 0;
|
virtual void setWidth(float width) = 0;
|
||||||
virtual void setFontSize(float sz) = 0;
|
virtual void setFontSize(float sz) = 0;
|
||||||
virtual void setAlign(Align a) = 0;
|
virtual void setAlign(Align a) = 0;
|
||||||
virtual float getLineHeight() = 0;
|
virtual float getLineHeight() const = 0;
|
||||||
virtual size_t getNumLines() = 0;
|
virtual size_t getNumLines() const = 0;
|
||||||
virtual float getHeight() = 0; // total height
|
virtual float getHeight() const = 0; // total height
|
||||||
virtual float getStringWidth(const std::string& text) = 0; // width of string when not auto-wrapped
|
virtual float getStringWidth(const std::string& text) const = 0; // width of string when not auto-wrapped
|
||||||
virtual float getActualWidth() = 0; // width of text after wrapping
|
virtual float getActualWidth() const = 0; // width of text after wrapping
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -124,13 +124,13 @@ float BitmapText::getSetWidth()
|
||||||
return textWidth;
|
return textWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
float BitmapText::getHeight()
|
float BitmapText::getHeight() const
|
||||||
{
|
{
|
||||||
float sz = bmpFont->font->GetCharHeight('A') * bmpFont->scale;
|
float sz = bmpFont->font->GetCharHeight('A') * bmpFont->scale;
|
||||||
return lines.size()*sz;
|
return lines.size()*sz;
|
||||||
}
|
}
|
||||||
|
|
||||||
float BitmapText::getLineHeight()
|
float BitmapText::getLineHeight() const
|
||||||
{
|
{
|
||||||
return bmpFont->font->GetCharHeight('A') * bmpFont->scale;
|
return bmpFont->font->GetCharHeight('A') * bmpFont->scale;
|
||||||
}
|
}
|
||||||
|
@ -349,12 +349,12 @@ bool BitmapText::isScrollingText()
|
||||||
return scrolling;
|
return scrolling;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t BitmapText::getNumLines()
|
size_t BitmapText::getNumLines() const
|
||||||
{
|
{
|
||||||
return lines.size();
|
return lines.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
float BitmapText::getStringWidth(const std::string& text)
|
float BitmapText::getStringWidth(const std::string& text) const
|
||||||
{
|
{
|
||||||
std::string tmp;
|
std::string tmp;
|
||||||
int maxsize = 0;
|
int maxsize = 0;
|
||||||
|
|
|
@ -48,32 +48,32 @@ class BitmapText : public BaseText
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
BitmapText(BmpFont *bmpFont);
|
BitmapText(BmpFont *bmpFont);
|
||||||
void setText(const std::string &text);
|
void setText(const std::string &text) OVERRIDE;
|
||||||
void setWidth(float width);
|
void setWidth(float width) OVERRIDE;
|
||||||
float getSetWidth(); // get the width that was set
|
float getSetWidth(); // get the width that was set
|
||||||
void scrollText(const std::string &text, float scrollSpeed);
|
void scrollText(const std::string &text, float scrollSpeed);
|
||||||
void setFontSize(float sz);
|
void setFontSize(float sz) OVERRIDE;
|
||||||
bool isScrollingText();
|
bool isScrollingText();
|
||||||
void stopScrollingText();
|
void stopScrollingText();
|
||||||
bool isEmpty();
|
bool isEmpty();
|
||||||
virtual void setAlign(Align align);
|
virtual void setAlign(Align align) OVERRIDE;
|
||||||
std::string getText();
|
std::string getText();
|
||||||
int getWidthOnScreen();
|
int getWidthOnScreen();
|
||||||
Vector getColorIndex(size_t i, size_t j);
|
Vector getColorIndex(size_t i, size_t j);
|
||||||
void updateWordColoring();
|
void updateWordColoring();
|
||||||
void autoKern();
|
void autoKern();
|
||||||
virtual float getHeight();
|
virtual float getHeight() const OVERRIDE;
|
||||||
void unloadDevice();
|
void unloadDevice() OVERRIDE;
|
||||||
void reloadDevice();
|
void reloadDevice() OVERRIDE;
|
||||||
float getStringWidth(const std::string& text);
|
float getStringWidth(const std::string& text) const OVERRIDE;
|
||||||
float getActualWidth() { return maxW; }
|
float getActualWidth() const OVERRIDE { return maxW; }
|
||||||
float getLineHeight();
|
float getLineHeight() const OVERRIDE;
|
||||||
size_t getNumLines();
|
size_t getNumLines() const OVERRIDE;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
float scrollSpeed;
|
float scrollSpeed;
|
||||||
BmpFont *bmpFont;
|
BmpFont *bmpFont;
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
float scrollDelay;
|
float scrollDelay;
|
||||||
bool scrolling;
|
bool scrolling;
|
||||||
size_t currentScrollLine;
|
size_t currentScrollLine;
|
||||||
|
|
|
@ -2070,22 +2070,18 @@ CountedPtr<Texture> Core::addTexture(const std::string &textureName)
|
||||||
return ptex;
|
return ptex;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Core::addRenderObject(RenderObject *o, size_t layer)
|
void Core::addRenderObject(RenderObject *o, unsigned layer)
|
||||||
{
|
{
|
||||||
if (!o) return;
|
assert(o->layer == LR_NONE);
|
||||||
|
assert(layer < renderObjectLayers.size());
|
||||||
o->layer = layer;
|
o->layer = layer;
|
||||||
if (layer >= renderObjectLayers.size())
|
|
||||||
{
|
|
||||||
std::ostringstream os;
|
|
||||||
os << "attempted to add render object to invalid layer [" << layer << "]";
|
|
||||||
errorLog(os.str());
|
|
||||||
}
|
|
||||||
renderObjectLayers[layer].add(o);
|
renderObjectLayers[layer].add(o);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Core::switchRenderObjectLayer(RenderObject *o, int toLayer)
|
void Core::switchRenderObjectLayer(RenderObject *o, unsigned toLayer)
|
||||||
{
|
{
|
||||||
if (!o) return;
|
assert(o->layer != LR_NONE);
|
||||||
|
assert(toLayer < renderObjectLayers.size());
|
||||||
renderObjectLayers[o->layer].remove(o);
|
renderObjectLayers[o->layer].remove(o);
|
||||||
renderObjectLayers[toLayer].add(o);
|
renderObjectLayers[toLayer].add(o);
|
||||||
o->layer = toLayer;
|
o->layer = toLayer;
|
||||||
|
|
|
@ -238,8 +238,8 @@ public:
|
||||||
void setFullscreen(bool full);
|
void setFullscreen(bool full);
|
||||||
|
|
||||||
void enable2D(int pixelScaleX, int pixelScaleY);
|
void enable2D(int pixelScaleX, int pixelScaleY);
|
||||||
void addRenderObject(RenderObject *o, size_t layer=0);
|
void addRenderObject(RenderObject *o, unsigned layer);
|
||||||
void switchRenderObjectLayer(RenderObject *o, int toLayer);
|
void switchRenderObjectLayer(RenderObject *o, unsigned toLayer);
|
||||||
void addTexture(Texture *r);
|
void addTexture(Texture *r);
|
||||||
CountedPtr<Texture> findTexture(const std::string &name);
|
CountedPtr<Texture> findTexture(const std::string &name);
|
||||||
void removeTexture(Texture *res);
|
void removeTexture(Texture *res);
|
||||||
|
@ -523,7 +523,7 @@ public:
|
||||||
Joystick *getJoystickForSourceID(int sourceID);
|
Joystick *getJoystickForSourceID(int sourceID);
|
||||||
private:
|
private:
|
||||||
std::vector<Joystick*> joysticks;
|
std::vector<Joystick*> joysticks;
|
||||||
int sdlUserMouseEventID;
|
unsigned sdlUserMouseEventID;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Core *core;
|
extern Core *core;
|
||||||
|
|
|
@ -50,17 +50,17 @@ void DebugFont::setFontSize(float sz)
|
||||||
fontDrawSize = sz;
|
fontDrawSize = sz;
|
||||||
}
|
}
|
||||||
|
|
||||||
float DebugFont::getHeight()
|
float DebugFont::getHeight() const
|
||||||
{
|
{
|
||||||
return fontDrawSize * lines.size() * 1.5f; // vspc in render()
|
return fontDrawSize * lines.size() * 1.5f; // vspc in render()
|
||||||
}
|
}
|
||||||
|
|
||||||
float DebugFont::getLineHeight()
|
float DebugFont::getLineHeight() const
|
||||||
{
|
{
|
||||||
return fontDrawSize * 1.5f; // vspc in render()
|
return fontDrawSize * 1.5f; // vspc in render()
|
||||||
}
|
}
|
||||||
|
|
||||||
float DebugFont::getStringWidth(const std::string& text)
|
float DebugFont::getStringWidth(const std::string& text) const
|
||||||
{
|
{
|
||||||
int maxchars = 0;
|
int maxchars = 0;
|
||||||
int c = 0;
|
int c = 0;
|
||||||
|
@ -78,7 +78,7 @@ float DebugFont::getStringWidth(const std::string& text)
|
||||||
return fontDrawSize * maxchars * (1.4f * 0.75f);
|
return fontDrawSize * maxchars * (1.4f * 0.75f);
|
||||||
}
|
}
|
||||||
|
|
||||||
float DebugFont::getActualWidth()
|
float DebugFont::getActualWidth() const
|
||||||
{
|
{
|
||||||
return maxW * (1.4f * 0.75f); // numbers taken from onRender()
|
return maxW * (1.4f * 0.75f); // numbers taken from onRender()
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,15 +28,15 @@ class DebugFont : public BaseText
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
DebugFont(int initFontSize=0, const std::string &initText="");
|
DebugFont(int initFontSize=0, const std::string &initText="");
|
||||||
void setText(const std::string &text);
|
void setText(const std::string &text) OVERRIDE;
|
||||||
void setWidth(float width);
|
void setWidth(float width) OVERRIDE;
|
||||||
void setFontSize(float sz);
|
void setFontSize(float sz) OVERRIDE;
|
||||||
size_t getNumLines() { return lines.size(); }
|
size_t getNumLines() const OVERRIDE { return lines.size(); }
|
||||||
virtual void setAlign(Align align);
|
virtual void setAlign(Align align) OVERRIDE;
|
||||||
virtual float getHeight();
|
virtual float getHeight() const OVERRIDE;
|
||||||
virtual float getLineHeight();
|
virtual float getLineHeight() const OVERRIDE;
|
||||||
virtual float getStringWidth(const std::string& text);
|
virtual float getStringWidth(const std::string& text) const OVERRIDE;
|
||||||
virtual float getActualWidth();
|
virtual float getActualWidth() const OVERRIDE;
|
||||||
protected:
|
protected:
|
||||||
float fontDrawSize, textWidth;
|
float fontDrawSize, textWidth;
|
||||||
void formatText();
|
void formatText();
|
||||||
|
|
|
@ -31,7 +31,7 @@ public:
|
||||||
void makeVertical(Vector c1, Vector c2);
|
void makeVertical(Vector c1, Vector c2);
|
||||||
void makeHorizontal(Vector c1, Vector c2);
|
void makeHorizontal(Vector c1, Vector c2);
|
||||||
|
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
|
|
||||||
int autoWidth, autoHeight;
|
int autoWidth, autoHeight;
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -119,7 +119,7 @@ class Emitter : public Quad
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Emitter(ParticleEffect *pe);
|
Emitter(ParticleEffect *pe);
|
||||||
void destroy();
|
void destroy() OVERRIDE;
|
||||||
void addParticle(Particle *p);
|
void addParticle(Particle *p);
|
||||||
void removeParticle(Particle *p);
|
void removeParticle(Particle *p);
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ protected:
|
||||||
Vector currentSpawn, lastSpawn;
|
Vector currentSpawn, lastSpawn;
|
||||||
void onRender(const RenderState& rs) const OVERRIDE;
|
void onRender(const RenderState& rs) const OVERRIDE;
|
||||||
void spawnParticle(float perc=1);
|
void spawnParticle(float perc=1);
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
|
|
||||||
ParticleEffect *pe;
|
ParticleEffect *pe;
|
||||||
|
|
||||||
|
|
12
BBGE/Quad.h
12
BBGE/Quad.h
|
@ -45,13 +45,13 @@ public:
|
||||||
Quad(const std::string &tex, const Vector &pos);
|
Quad(const std::string &tex, const Vector &pos);
|
||||||
Quad();
|
Quad();
|
||||||
void createGrid(int x, int y);
|
void createGrid(int x, int y);
|
||||||
void destroy();
|
void destroy() OVERRIDE;
|
||||||
bool isCoordinateInside(Vector coord, int minSize=0) const;
|
bool isCoordinateInside(Vector coord, int minSize=0) const;
|
||||||
bool isCoordinateInsideWorld(const Vector &coord, int minSize=0) const;
|
bool isCoordinateInsideWorld(const Vector &coord, int minSize=0) const;
|
||||||
bool isCoordinateInsideWorldRect(const Vector &coord, int w, int h) const;
|
bool isCoordinateInsideWorldRect(const Vector &coord, int w, int h) const;
|
||||||
|
|
||||||
void flipVertical();
|
void flipVertical() OVERRIDE;
|
||||||
void flipHorizontal();
|
void flipHorizontal() OVERRIDE;
|
||||||
void setWidthHeight(float w, float h=-1);
|
void setWidthHeight(float w, float h=-1);
|
||||||
void setWidth(float w);
|
void setWidth(float w);
|
||||||
void setHeight(float h);
|
void setHeight(float h);
|
||||||
|
@ -67,7 +67,7 @@ public:
|
||||||
Array2d<Vector>& getDrawGrid() { return drawGrid; }
|
Array2d<Vector>& getDrawGrid() { return drawGrid; }
|
||||||
const Array2d<Vector>& getDrawGrid() const { return drawGrid; }
|
const Array2d<Vector>& getDrawGrid() const { return drawGrid; }
|
||||||
|
|
||||||
void reloadDevice();
|
void reloadDevice() OVERRIDE;
|
||||||
|
|
||||||
void deleteGrid();
|
void deleteGrid();
|
||||||
|
|
||||||
|
@ -122,9 +122,9 @@ protected:
|
||||||
float drawGridTimeMultiplier;
|
float drawGridTimeMultiplier;
|
||||||
bool drawGridOut;
|
bool drawGridOut;
|
||||||
|
|
||||||
void onSetTexture();
|
void onSetTexture() OVERRIDE;
|
||||||
void onRender(const RenderState& rs) const OVERRIDE;
|
void onRender(const RenderState& rs) const OVERRIDE;
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GridDrawOrder drawOrder;
|
GridDrawOrder drawOrder;
|
||||||
|
|
|
@ -43,8 +43,8 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void onRender(const RenderState& rs) const OVERRIDE;
|
virtual void onRender(const RenderState& rs) const OVERRIDE;
|
||||||
virtual void onUpdate(float dt);
|
virtual void onUpdate(float dt) OVERRIDE;
|
||||||
virtual void onSetTexture();
|
virtual void onSetTexture() OVERRIDE;
|
||||||
|
|
||||||
void resetUV(float xmul = 1, float ymul = 1);
|
void resetUV(float xmul = 1, float ymul = 1);
|
||||||
void resetPos(float w, float h, float xoffs = 0, float yoffs = 0);
|
void resetPos(float w, float h, float xoffs = 0, float yoffs = 0);
|
||||||
|
|
|
@ -391,7 +391,7 @@ bool RenderObject::isVisibleInPass(int pass) const
|
||||||
|
|
||||||
void RenderObject::render(const RenderState& rs) const
|
void RenderObject::render(const RenderState& rs) const
|
||||||
{
|
{
|
||||||
assert(layer != LR_NONE);
|
assert(parent || layer != LR_NONE);
|
||||||
if (isHidden()) return;
|
if (isHidden()) return;
|
||||||
|
|
||||||
/// new (breaks anything?)
|
/// new (breaks anything?)
|
||||||
|
|
|
@ -42,7 +42,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
void onRender(const RenderState& rs) const OVERRIDE;
|
void onRender(const RenderState& rs) const OVERRIDE;
|
||||||
|
|
||||||
bool canMove;
|
bool canMove;
|
||||||
|
@ -60,7 +60,7 @@ public:
|
||||||
|
|
||||||
EventPtr event;
|
EventPtr event;
|
||||||
protected:
|
protected:
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt) OVERRIDE;
|
||||||
void onRender(const RenderState& rs) const OVERRIDE;
|
void onRender(const RenderState& rs) const OVERRIDE;
|
||||||
|
|
||||||
TTFText *label;
|
TTFText *label;
|
||||||
|
|
|
@ -30,8 +30,8 @@ public:
|
||||||
void go(float time);
|
void go(float time);
|
||||||
virtual void capture();
|
virtual void capture();
|
||||||
void transition(float time);
|
void transition(float time);
|
||||||
void reloadDevice();
|
void reloadDevice() OVERRIDE;
|
||||||
void unloadDevice();
|
void unloadDevice() OVERRIDE;
|
||||||
bool isGoing();
|
bool isGoing();
|
||||||
protected:
|
protected:
|
||||||
void createTexture();
|
void createTexture();
|
||||||
|
|
|
@ -741,6 +741,7 @@ BoneGridInterpolator * Animation::getBoneGridInterpolator(size_t boneIdx)
|
||||||
return &bgip;
|
return &bgip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ public:
|
||||||
void createStrip(bool vert, int num);
|
void createStrip(bool vert, int num);
|
||||||
Quad* addFrame(const std::string &gfx);
|
Quad* addFrame(const std::string &gfx);
|
||||||
void showFrame(int i);
|
void showFrame(int i);
|
||||||
void destroy();
|
void destroy() OVERRIDE;
|
||||||
std::string gfx;
|
std::string gfx;
|
||||||
std::string name;
|
std::string name;
|
||||||
size_t boneIdx;
|
size_t boneIdx;
|
||||||
|
|
|
@ -44,7 +44,7 @@ void StateObject::removeState()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StateObject::addRenderObject(RenderObject *renderObject, int layer)
|
void StateObject::addRenderObject(RenderObject *renderObject, unsigned layer)
|
||||||
{
|
{
|
||||||
stateManager->getState(name)->addRenderObject(renderObject, layer);
|
stateManager->getState(name)->addRenderObject(renderObject, layer);
|
||||||
}
|
}
|
||||||
|
@ -75,12 +75,11 @@ StateData::~StateData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void StateData::addRenderObject(RenderObject *renderObject, int layer)
|
void StateData::addRenderObject(RenderObject* renderObject, unsigned layer)
|
||||||
{
|
{
|
||||||
core->addRenderObject(renderObject, layer);
|
core->addRenderObject(renderObject, layer);
|
||||||
renderObjects.push_back (renderObject);
|
renderObjects.push_back (renderObject);
|
||||||
renderObject->setStateDataObject(this);
|
renderObject->setStateDataObject(this);
|
||||||
renderObject->layer = layer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StateData::removeRenderObject(RenderObject *renderObject)
|
void StateData::removeRenderObject(RenderObject *renderObject)
|
||||||
|
|
|
@ -43,7 +43,7 @@ public:
|
||||||
StateObject *stateObject;
|
StateObject *stateObject;
|
||||||
|
|
||||||
void clearGarbage();
|
void clearGarbage();
|
||||||
void addRenderObject(RenderObject *renderObject, int layer);
|
void addRenderObject(RenderObject *renderObject, unsigned layer);
|
||||||
void eraseRenderObjects();
|
void eraseRenderObjects();
|
||||||
void removeRenderObject(RenderObject *renderObject);
|
void removeRenderObject(RenderObject *renderObject);
|
||||||
void removeRenderObjectFromList(RenderObject *renderObject);
|
void removeRenderObjectFromList(RenderObject *renderObject);
|
||||||
|
@ -61,7 +61,7 @@ public:
|
||||||
virtual void removeState();
|
virtual void removeState();
|
||||||
virtual void update(float dt);
|
virtual void update(float dt);
|
||||||
|
|
||||||
void addRenderObject(RenderObject *renderObject, int layer=0);
|
void addRenderObject(RenderObject *renderObject, unsigned layer);
|
||||||
void removeRenderObject(RenderObject *renderObject);
|
void removeRenderObject(RenderObject *renderObject);
|
||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
|
|
|
@ -110,17 +110,17 @@ void TTFText::updateAlign()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t TTFText::getNumLines()
|
size_t TTFText::getNumLines() const
|
||||||
{
|
{
|
||||||
return (int)text.size();
|
return (int)text.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
float TTFText::getHeight()
|
float TTFText::getHeight() const
|
||||||
{
|
{
|
||||||
return text.size()*lineHeight;
|
return text.size()*lineHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
float TTFText::getStringWidth(const std::string& s)
|
float TTFText::getStringWidth(const std::string& s) const
|
||||||
{
|
{
|
||||||
float w = 0;
|
float w = 0;
|
||||||
std::string cp = s;
|
std::string cp = s;
|
||||||
|
@ -223,7 +223,7 @@ void TTFText::updateFormatting()
|
||||||
lineHeight = font->font->LineHeight();
|
lineHeight = font->font->LineHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
float TTFText::getLineHeight()
|
float TTFText::getLineHeight() const
|
||||||
{
|
{
|
||||||
return lineHeight;
|
return lineHeight;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,17 +42,17 @@ class TTFText : public BaseText
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
TTFText(TTFFont *font);
|
TTFText(TTFFont *font);
|
||||||
void setText(const std::string &txt);
|
void setText(const std::string &txt) OVERRIDE;
|
||||||
void setAlign(Align align);
|
void setAlign(Align align) OVERRIDE;
|
||||||
void setWidth(float width);
|
void setWidth(float width) OVERRIDE;
|
||||||
float getHeight();
|
float getHeight() const OVERRIDE;
|
||||||
float getActualWidth() { return maxW; }
|
float getActualWidth() const OVERRIDE { return maxW; }
|
||||||
void setFontSize(float); // dummy
|
void setFontSize(float) OVERRIDE; // dummy
|
||||||
float getStringWidth(const std::string& s);
|
float getStringWidth(const std::string& s) const OVERRIDE;
|
||||||
bool shadow;
|
bool shadow;
|
||||||
int findLine(const std::string &label);
|
int findLine(const std::string &label);
|
||||||
float getLineHeight();
|
float getLineHeight() const OVERRIDE;
|
||||||
size_t getNumLines();
|
size_t getNumLines() const OVERRIDE;
|
||||||
protected:
|
protected:
|
||||||
float width;
|
float width;
|
||||||
float lineHeight;
|
float lineHeight;
|
||||||
|
|
Loading…
Add table
Reference in a new issue