1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-02-10 22:26:22 +00:00

Merge branch 'experimental' of file:///Users/User/code/coding/Aquaria_fg_clean into experimental

This commit is contained in:
fgenesis 2013-12-12 22:21:29 +00:00
commit 7375a4879d
9 changed files with 36 additions and 9 deletions

View file

@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "AquariaProgressBar.h" #include "AquariaProgressBar.h"
#include "tinyxml.h" #include "tinyxml.h"
#include "ModSelector.h" #include "ModSelector.h"
#include <algorithm>
#ifdef BBGE_BUILD_VFS #ifdef BBGE_BUILD_VFS
#include "ModDownloader.h" #include "ModDownloader.h"

View file

@ -2365,6 +2365,7 @@ void SceneEditor::loadScene()
dsq->game->loadEntityTypeList(); dsq->game->loadEntityTypeList();
dsq->loadElementEffects(); dsq->loadElementEffects();
dsq->continuity.loadSongBank(); dsq->continuity.loadSongBank();
dsq->continuity.stringBank.load();
} }
void SceneEditor::saveScene() void SceneEditor::saveScene()

View file

@ -36,6 +36,7 @@ extern "C"
#include "Web.h" #include "Web.h"
#include "GridRender.h" #include "GridRender.h"
#include "AfterEffect.h" #include "AfterEffect.h"
#include <algorithm>
#include "../BBGE/MathFunctions.h" #include "../BBGE/MathFunctions.h"
@ -8506,6 +8507,11 @@ luaFunc(castLine)
return 3; return 3;
} }
luaFunc(getUserInputString)
{
luaReturnStr(dsq->getUserInputString(getString(L, 1), getString(L, 2), true).c_str());
}
luaFunc(inv_isFull) luaFunc(inv_isFull)
{ {
@ -8657,6 +8663,12 @@ luaFunc(text_setAlign)
luaReturnNil(); luaReturnNil();
} }
luaFunc(text_getHeight)
{
BaseText *txt = getText(L);
luaReturnNum(txt ? txt->getHeight() : 0.0f);
}
luaFunc(loadShader) luaFunc(loadShader)
{ {
int handle = 0; int handle = 0;
@ -9313,6 +9325,7 @@ static const struct {
luaRegister(getObstruction), luaRegister(getObstruction),
luaRegister(findPath), luaRegister(findPath),
luaRegister(castLine), luaRegister(castLine),
luaRegister(getUserInputString),
luaRegister(isFlag), luaRegister(isFlag),
@ -9705,6 +9718,7 @@ static const struct {
luaRegister(text_setFontSize), luaRegister(text_setFontSize),
luaRegister(text_setWidth), luaRegister(text_setWidth),
luaRegister(text_setAlign), luaRegister(text_setAlign),
luaRegister(text_getHeight),
luaRegister(loadShader), luaRegister(loadShader),
luaRegister(createShader), luaRegister(createShader),

View file

@ -13,6 +13,7 @@ public:
virtual void setWidth(int width) = 0; virtual void setWidth(int width) = 0;
virtual void setFontSize(int sz) = 0; virtual void setFontSize(int sz) = 0;
virtual void setAlign(Align a) = 0; virtual void setAlign(Align a) = 0;
virtual float getHeight() = 0;
}; };

View file

@ -72,7 +72,7 @@ public:
void autoKern(); void autoKern();
void setBitmapFontEffect(BitmapFontEffect bfe); void setBitmapFontEffect(BitmapFontEffect bfe);
void render(); void render();
float getHeight(); virtual float getHeight();
void unloadDevice(); void unloadDevice();
void reloadDevice(); void reloadDevice();

View file

@ -3561,7 +3561,11 @@ void Core::pollEvents()
case SDL_KEYDOWN: case SDL_KEYDOWN:
{ {
#if __APPLE__ #if __APPLE__
if ((event.key.keysym.sym == SDLK_q) && (event.key.keysym.mod & KMOD_GUI)) #if SDL_VERSION_ATLEAST(2, 0, 0)
if ((event.key.keysym.sym == SDLK_q) && (event.key.keysym.mod & KMOD_GUI))
#else
if ((event.key.keysym.sym == SDLK_q) && (event.key.keysym.mod & KMOD_META))
#endif
#else #else
if ((event.key.keysym.sym == SDLK_F4) && (event.key.keysym.mod & KMOD_ALT)) if ((event.key.keysym.sym == SDLK_F4) && (event.key.keysym.mod & KMOD_ALT))
#endif #endif

View file

@ -47,6 +47,11 @@ void DebugFont::setFontSize(int sz)
fontDrawSize = sz; fontDrawSize = sz;
} }
float DebugFont::getHeight()
{
return fontDrawSize * lines.size() * 1.5f; // vspc in render()
}
void DebugFont::formatText() void DebugFont::formatText()
{ {
std::string text; std::string text;

View file

@ -33,6 +33,7 @@ public:
void setFontSize(int sz); void setFontSize(int sz);
int getNumLines() { return lines.size(); } int getNumLines() { return lines.size(); }
virtual void setAlign(Align align); virtual void setAlign(Align align);
virtual float getHeight();
protected: protected:
int fontDrawSize, textWidth; int fontDrawSize, textWidth;
void formatText(); void formatText();

View file

@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef BBGE_VECTOR_H #ifndef BBGE_VECTOR_H
#define BBGE_VECTOR_H #define BBGE_VECTOR_H
#include <math.h> #include <cmath>
#include <float.h> #include <float.h>
#include <vector> #include <vector>
#include "Event.h" #include "Event.h"
@ -374,7 +374,7 @@ public:
#ifdef BBGE_BUILD_WINDOWS #ifdef BBGE_BUILD_WINDOWS
return _isnan(x) || _isnan(y) || _isnan(z); return _isnan(x) || _isnan(y) || _isnan(z);
#elif defined(BBGE_BUILD_UNIX) #elif defined(BBGE_BUILD_UNIX)
return isnan(x) || isnan(y) || isnan(z); return std::isnan(x) || std::isnan(y) || std::isnan(z);
#else #else
return false; return false;
#endif #endif