mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-04-08 07:37:07 +00:00
Fix build with gcc ~5.4. Thx thegamemaster1234 for pointing.
This commit is contained in:
parent
b5e6234269
commit
bc77c89ad3
9 changed files with 33 additions and 25 deletions
|
@ -1827,7 +1827,7 @@ int DSQ::getEntityTypeIndexByName(std::string s)
|
|||
return -1;
|
||||
}
|
||||
|
||||
void DSQ::loadModsCallback(const std::string &filename, intptr_t param)
|
||||
void DSQ::loadModsCallback(const std::string &filename, void *param)
|
||||
{
|
||||
|
||||
int pos = filename.find_last_of('/')+1;
|
||||
|
@ -1856,7 +1856,7 @@ void DSQ::loadModsCallback(const std::string &filename, intptr_t param)
|
|||
dsq->debugLog(ss.str());
|
||||
}
|
||||
|
||||
void DSQ::loadModPackagesCallback(const std::string &filename, intptr_t param)
|
||||
void DSQ::loadModPackagesCallback(const std::string &filename, void *param)
|
||||
{
|
||||
bool ok = dsq->mountModPackage(filename);
|
||||
|
||||
|
@ -1896,10 +1896,10 @@ void DSQ::loadMods()
|
|||
|
||||
#ifdef BBGE_BUILD_VFS
|
||||
// first load the packages, then enumerate XMLs
|
||||
forEachFile(modpath, ".aqmod", loadModPackagesCallback, 0);
|
||||
forEachFile(modpath, ".aqmod", loadModPackagesCallback);
|
||||
#endif
|
||||
|
||||
forEachFile(modpath, ".xml", loadModsCallback, 0);
|
||||
forEachFile(modpath, ".xml", loadModsCallback);
|
||||
selectedMod = 0;
|
||||
|
||||
std::ostringstream os;
|
||||
|
|
|
@ -382,8 +382,8 @@ public:
|
|||
bool mountModPackage(const std::string&);
|
||||
bool modIsKnown(const std::string& name);
|
||||
void unloadMods();
|
||||
static void loadModsCallback(const std::string &filename, intptr_t param);
|
||||
static void loadModPackagesCallback(const std::string &filename, intptr_t param);
|
||||
static void loadModsCallback(const std::string &filename, void *param);
|
||||
static void loadModPackagesCallback(const std::string &filename, void *param);
|
||||
|
||||
bool doScreenTrans;
|
||||
|
||||
|
|
|
@ -296,7 +296,7 @@ Shot::Shot() : Quad(), Segmented(0,0)
|
|||
shots.push_back(this);
|
||||
}
|
||||
|
||||
void loadShotCallback(const std::string &filename, intptr_t param)
|
||||
void loadShotCallback(const std::string &filename, void *param)
|
||||
{
|
||||
ShotData shotData;
|
||||
|
||||
|
@ -314,12 +314,12 @@ void Shot::loadShotBank(const std::string &bank1, const std::string &bank2)
|
|||
clearShotBank();
|
||||
|
||||
shotBankPath = bank1;
|
||||
forEachFile(bank1, ".txt", loadShotCallback, 0);
|
||||
forEachFile(bank1, ".txt", loadShotCallback);
|
||||
|
||||
if (!bank2.empty())
|
||||
{
|
||||
shotBankPath = bank2;
|
||||
forEachFile(bank2, ".txt", loadShotCallback, 0);
|
||||
forEachFile(bank2, ".txt", loadShotCallback);
|
||||
}
|
||||
|
||||
shotBankPath = "";
|
||||
|
|
|
@ -182,8 +182,8 @@ struct vfscallback_s
|
|||
{
|
||||
const std::string *path;
|
||||
const char *ext;
|
||||
intptr_t param;
|
||||
void (*callback)(const std::string &filename, intptr_t param);
|
||||
void *param;
|
||||
void (*callback)(const std::string &filename, void *param);
|
||||
};
|
||||
|
||||
void forEachFile_vfscallback(VFILE *vf, void *user)
|
||||
|
@ -200,7 +200,7 @@ void forEachFile_vfscallback(VFILE *vf, void *user)
|
|||
|
||||
#endif
|
||||
|
||||
void forEachFile(const std::string& inpath, std::string type, void callback(const std::string &filename, intptr_t param), intptr_t param)
|
||||
void forEachFile(const std::string& inpath, std::string type, void callback(const std::string &filename, void *param), void *param)
|
||||
{
|
||||
if (inpath.empty()) return;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
void initIcon(void *screen);
|
||||
void destroyIcon();
|
||||
void messageBox(const std::string &title, const std::string& msg);
|
||||
void forEachFile(const std::string& inpath, std::string type, void callback(const std::string &filename, intptr_t param), intptr_t param);
|
||||
void forEachFile(const std::string& inpath, std::string type, void callback(const std::string &filename, void *param), void *param = 0);
|
||||
std::string adjustFilenameCase(const char *_buf);
|
||||
std::string adjustFilenameCase(const std::string&);
|
||||
bool createDir(const std::string& d);
|
||||
|
|
|
@ -294,7 +294,7 @@ Particle *ParticleManager::getFreeParticle(Emitter *emitter)
|
|||
return p;
|
||||
}
|
||||
|
||||
void loadParticleCallback(const std::string &filename, intptr_t param)
|
||||
void loadParticleCallback(const std::string &filename, void *param)
|
||||
{
|
||||
ParticleEffect *e = new ParticleEffect();
|
||||
|
||||
|
@ -313,12 +313,12 @@ void ParticleManager::loadParticleBank(const std::string &bank1, const std::stri
|
|||
clearParticleBank();
|
||||
|
||||
particleBankPath = bank1;
|
||||
forEachFile(bank1, ".txt", loadParticleCallback, 0);
|
||||
forEachFile(bank1, ".txt", loadParticleCallback);
|
||||
|
||||
if (!bank2.empty())
|
||||
{
|
||||
particleBankPath = bank2;
|
||||
forEachFile(bank2, ".txt", loadParticleCallback, 0);
|
||||
forEachFile(bank2, ".txt", loadParticleCallback);
|
||||
}
|
||||
|
||||
particleBankPath = "";
|
||||
|
|
|
@ -76,7 +76,7 @@ void Precacher::loadTextureRange(const std::string &file, const std::string &typ
|
|||
}
|
||||
}
|
||||
|
||||
void precacherCallback(const std::string &file, intptr_t param)
|
||||
void precacherCallback(const std::string &file, void *param)
|
||||
{
|
||||
Precacher *p = (Precacher*)param;
|
||||
p->precacheTex(file);
|
||||
|
@ -108,7 +108,7 @@ void Precacher::precacheTex(const std::string &tex)
|
|||
std::string path = tex.substr(0, loc);
|
||||
std::string type = tex.substr(loc+1, tex.size());
|
||||
path = basedir + path;
|
||||
forEachFile(path, type, precacherCallback, (intptr_t)this);
|
||||
forEachFile(path, type, precacherCallback, this);
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1314,7 +1314,7 @@ void SoundManager::stopAllVoice()
|
|||
stopVoice();
|
||||
}
|
||||
|
||||
void loadCacheSoundsCallback (const std::string &filename, intptr_t param)
|
||||
void loadCacheSoundsCallback (const std::string &filename, void *param)
|
||||
{
|
||||
SoundManager *sm;
|
||||
sm = (SoundManager*)param;
|
||||
|
@ -1334,7 +1334,7 @@ void loadCacheSoundsCallback (const std::string &filename, intptr_t param)
|
|||
void SoundManager::loadSoundCache(const std::string &path, const std::string &ftype, void progressCallback())
|
||||
{
|
||||
loadProgressCallback = progressCallback;
|
||||
forEachFile(path, ftype, loadCacheSoundsCallback, (intptr_t)this);
|
||||
forEachFile(path, ftype, loadCacheSoundsCallback, this);
|
||||
loadProgressCallback = NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include <float.h>
|
||||
#include <algorithm>
|
||||
|
||||
#ifdef BBGE_USE_GLM
|
||||
#include "glm/glm.hpp"
|
||||
#include "glm/gtx/transform.hpp"
|
||||
#endif
|
||||
|
||||
/*************************************************************************/
|
||||
|
||||
void Vector::rotate2D360(float angle)
|
||||
|
@ -38,9 +43,15 @@ void Vector::rotate2DRad(float rad)
|
|||
y = sinf(rad)*ox + cosf(rad)*oy;
|
||||
}
|
||||
|
||||
#include "RenderBase.h"
|
||||
|
||||
Vector getRotatedVector(const Vector &vec, float rot)
|
||||
{
|
||||
/*
|
||||
#ifdef BBGE_USE_GLM
|
||||
glm::mat4 m = glm::rotate(glm::mat4(1), rot, glm::vec3(0, 0, 1));
|
||||
glm::vec4 v = m * glm::vec4(vec.x, vec.y, vec.z, 1.0f);
|
||||
return Vector(v.x, v.y, v.z);
|
||||
#else
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
|
||||
|
@ -60,10 +71,7 @@ Vector getRotatedVector(const Vector &vec, float rot)
|
|||
|
||||
glPopMatrix();
|
||||
return Vector(x,y,z);
|
||||
*/
|
||||
float s = sinf(rot);
|
||||
float c = cosf(rot);
|
||||
return Vector(c*vec.x - s*vec.y, s*vec.x + c*vec.y);
|
||||
#endif
|
||||
}
|
||||
|
||||
// note update this from float lerp
|
||||
|
|
Loading…
Add table
Reference in a new issue