1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-07-03 22:44:32 +00:00

Merge pull request #41

This commit is contained in:
Valentin Ochs 2017-01-12 22:14:26 +01:00 committed by fgenesis
parent 548da72632
commit dcd21b57bd
40 changed files with 281 additions and 177 deletions

View file

@ -1112,7 +1112,7 @@ void AnimationEditor::flipRot()
BoneKeyframe *bcur = editSprite->getCurrentAnimation()->getKeyframe(currentKey)->getBoneKeyframe(editingBone->boneIdx); BoneKeyframe *bcur = editSprite->getCurrentAnimation()->getKeyframe(currentKey)->getBoneKeyframe(editingBone->boneIdx);
if (bcur) if (bcur)
{ {
int rotdiff = editingBone->rotation.z - bcur->rot; // int rotdiff = editingBone->rotation.z - bcur->rot;
if (!core->getCtrlState()) if (!core->getCtrlState())
{ {
for (int i = 0; i < editSprite->getCurrentAnimation()->getNumKeyframes(); ++i) for (int i = 0; i < editSprite->getCurrentAnimation()->getNumKeyframes(); ++i)

View file

@ -694,6 +694,8 @@ void AquariaKeyConfig::onUpdate(float dt)
} }
} }
} }
break;
case INPUTSET_NONE:
break; break;
} }
} }

View file

@ -54,7 +54,7 @@ int SongIcon::notesOpen = 0;
Avatar *avatar = 0; Avatar *avatar = 0;
const Vector BLIND_COLOR = Vector(0.1, 0.1, 0.1); const Vector BLIND_COLOR = Vector(0.1, 0.1, 0.1);
const float ANIM_TRANSITION = 0.2; const float ANIM_TRANSITION = 0.2;
const float MANA_RECHARGE_RATE = 1.0; //const float MANA_RECHARGE_RATE = 1.0;
const int AURA_SHIELD_RADIUS = 64; const int AURA_SHIELD_RADIUS = 64;
//const int TARGET_RANGE = 1024; //const int TARGET_RANGE = 1024;
const int TARGET_RANGE = 1024; // 650 const int TARGET_RANGE = 1024; // 650
@ -69,7 +69,7 @@ const int BURST_DISTANCE = 200;
const int STOP_DISTANCE = 48; const int STOP_DISTANCE = 48;
const int maxMouse = BURST_DISTANCE; const int maxMouse = BURST_DISTANCE;
//const int SHOCK_RANGE = 700; //const int SHOCK_RANGE = 700;
const int SHOCK_RANGE = 1000; //const int SHOCK_RANGE = 1000;
const int SPIRIT_RANGE = 2000; const int SPIRIT_RANGE = 2000;
const float QUICK_SONG_CAST_DELAY = 0.4; const float QUICK_SONG_CAST_DELAY = 0.4;
@ -81,9 +81,9 @@ const float BURST_ACCEL = 4000; //2000 // 1000
// Minimum time between two splash effects (seconds). // Minimum time between two splash effects (seconds).
const float SPLASH_INTERVAL = 0.2; const float SPLASH_INTERVAL = 0.2;
const float TUMMY_TIME = 6.0; //const float TUMMY_TIME = 6.0;
const float chargeMax = 2.0; //const float chargeMax = 2.0;
// Axis input distance (0.0-1.0) at which we start moving. // Axis input distance (0.0-1.0) at which we start moving.
const float JOYSTICK_LOW_THRESHOLD = 0.2; const float JOYSTICK_LOW_THRESHOLD = 0.2;
@ -862,6 +862,16 @@ std::string Avatar::getIdleAnimName()
case FORM_ENERGY: case FORM_ENERGY:
ret="energyidle"; ret="energyidle";
break; break;
case FORM_NORMAL:
case FORM_BEAST:
case FORM_NATURE:
case FORM_SPIRIT:
case FORM_DUAL:
case FORM_FISH:
case FORM_SUN:
case FORM_MAX:
case FORM_NONE:
break;
} }
return ret; return ret;
} }
@ -1232,6 +1242,10 @@ void Avatar::entityDied(Entity *e)
dsq->continuity.eatBeast(e->eatData); dsq->continuity.eatBeast(e->eatData);
} }
break; break;
case EAT_DEFAULT:
case EAT_MAX:
case EAT_NONE:
break;
} }
} }
@ -1582,6 +1596,9 @@ void Avatar::changeForm(FormType form, bool effects, bool onInit, FormType lastF
case FORM_DUAL: case FORM_DUAL:
core->sound->playSfx("DualForm"); core->sound->playSfx("DualForm");
break; break;
case FORM_NONE:
case FORM_MAX:
break;
} }
/* /*
@ -2818,6 +2835,10 @@ void Avatar::formAbility(int ability)
{ {
} }
break;
case FORM_NORMAL:
case FORM_NONE:
case FORM_MAX:
break; break;
} }
} }
@ -2979,7 +3000,7 @@ void Avatar::doShock(const std::string &shotName)
} }
} }
*/ */
Vector d = e->position - position; // Vector d = e->position - position;
/* /*
float a = float(float(i)/float(sz))*PI*2; float a = float(float(i)/float(sz))*PI*2;
Vector aim(sinf(a), cosf(a)); Vector aim(sinf(a), cosf(a));
@ -3035,8 +3056,14 @@ void Avatar::formAbilityUpdate(float dt)
} }
break; break;
case FORM_ENERGY: case FORM_ENERGY:
{ case FORM_NORMAL:
} case FORM_BEAST:
case FORM_NATURE:
case FORM_SPIRIT:
case FORM_DUAL:
case FORM_SUN:
case FORM_MAX:
case FORM_NONE:
break; break;
} }
} }
@ -3129,6 +3156,12 @@ bool Avatar::canCharge(int ability)
case FORM_SUN: case FORM_SUN:
return true; return true;
break; break;
case FORM_NORMAL:
case FORM_SPIRIT:
case FORM_FISH:
case FORM_MAX:
case FORM_NONE:
break;
} }
return false; return false;
} }
@ -4720,6 +4753,10 @@ void Avatar::updateAura(float dt)
} }
} }
} }
break;
case AURA_THING:
case AURA_HEAL:
case AURA_NONE:
break; break;
} }
@ -4865,6 +4902,14 @@ void Avatar::updateFormVisualEffects(float dt)
skeletalSprite.update(dt); skeletalSprite.update(dt);
skeletalSprite.position = bodyPosition; skeletalSprite.position = bodyPosition;
break; break;
case FORM_NORMAL:
case FORM_BEAST:
case FORM_NATURE:
case FORM_DUAL:
case FORM_FISH:
case FORM_MAX:
case FORM_NONE:
break;
} }
} }
@ -5975,7 +6020,7 @@ void Avatar::onUpdate(float dt)
{ {
if (state.spellCharge > 1.5f && chargeLevelAttained <1) if (state.spellCharge > 1.5f && chargeLevelAttained <1)
{ {
chargeLevelAttained = 1.5; chargeLevelAttained = 1;
core->sound->playSfx("PowerUp"); core->sound->playSfx("PowerUp");
chargingEmitter->load("ChargingEnergy2"); chargingEmitter->load("ChargingEnergy2");
} }
@ -6026,6 +6071,13 @@ void Avatar::onUpdate(float dt)
chargingEmitter->start(); chargingEmitter->start();
} }
} }
break;
case FORM_NORMAL:
case FORM_BEAST:
case FORM_SPIRIT:
case FORM_FISH:
case FORM_MAX:
case FORM_NONE:
break; break;
} }
} }

View file

@ -92,6 +92,8 @@ void CollideEntity::bounce(float ba)
vel.z = 0; vel.z = 0;
} }
} }
break;
case BOUNCE_NONE:
break; break;
} }

View file

@ -607,6 +607,10 @@ std::string Continuity::getIEString(IngredientData *data, int i)
return ret; return ret;
} }
break; break;
case IET_NONE:
case IET_RANDOM:
case IET_MAX:
break;
} }
return ""; return "";
@ -1241,6 +1245,9 @@ std::string Continuity::getInternalFormName()
return "sun"; return "sun";
case FORM_DUAL: case FORM_DUAL:
return "dual"; return "dual";
case FORM_NONE:
case FORM_MAX:
break;
} }
return ""; return "";
} }
@ -1635,6 +1642,10 @@ void Continuity::castSong(int num)
dsq->game->avatar->changeForm(FORM_FISH); dsq->game->avatar->changeForm(FORM_FISH);
break; break;
case SONG_SONGDOOR1: case SONG_SONGDOOR1:
case SONG_SONGDOOR2:
case SONG_ANIMA:
case SONG_NONE:
case SONG_MAX:
break; break;
#endif #endif
} }

View file

@ -1782,6 +1782,8 @@ void DSQ::toggleInputMode()
case INPUT_JOYSTICK: case INPUT_JOYSTICK:
setInputMode(INPUT_MOUSE); setInputMode(INPUT_MOUSE);
break; break;
case INPUT_KEYBOARD:
break;
} }
} }
@ -1799,6 +1801,8 @@ void DSQ::setInputMode(InputMode mode)
core->joystickAsMouse = false; core->joystickAsMouse = false;
updateCursorFromMouse = true; updateCursorFromMouse = true;
break; break;
case INPUT_KEYBOARD:
break;
} }
} }
@ -4091,6 +4095,8 @@ void DSQ::onUpdate(float dt)
case INPUT_JOYSTICK: case INPUT_JOYSTICK:
os << "joystick"; os << "joystick";
break; break;
case INPUT_KEYBOARD:
break;
} }
os << std::endl; os << std::endl;
Bone *b = dsq->game->avatar->skeletalSprite.getBoneByIdx(1); Bone *b = dsq->game->avatar->skeletalSprite.getBoneByIdx(1);

View file

@ -683,7 +683,7 @@ enum FoodSortType
struct IngredientEffect struct IngredientEffect
{ {
IngredientEffect() : type(IET_NONE), magnitude(0) {} IngredientEffect() : magnitude(0), type(IET_NONE) {}
float magnitude; float magnitude;
IngredientEffectType type; IngredientEffectType type;
std::string string; std::string string;

View file

@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Game.h" #include "Game.h"
ElementEffectData::ElementEffectData() ElementEffectData::ElementEffectData()
: elementEffectIndex(-1) : elementEffectType(EFX_NONE)
, wavyAngleOffset(0) , wavyAngleOffset(0)
, wavyMagnitude(0) , wavyMagnitude(0)
, wavyLerpIn(0) , wavyLerpIn(0)
@ -33,7 +33,7 @@ ElementEffectData::ElementEffectData()
, wavyWaving(false) , wavyWaving(false)
, wavyFlip(false) , wavyFlip(false)
, touching(false) , touching(false)
, elementEffectType(EFX_NONE) , elementEffectIndex(-1)
{ {
} }

View file

@ -998,11 +998,6 @@ bool Entity::touchAvatarDamage(int radius, float dmg, const Vector &override, fl
const float sct = 0.15; const float sct = 0.15;
const float blurMax = 0.01;
const float blurMin = 0.0;
void Entity::onFHScale() void Entity::onFHScale()
{ {
flipScale.interpolateTo(Vector(1, 1), sct); flipScale.interpolateTo(Vector(1, 1), sct);

View file

@ -156,7 +156,7 @@ void PetSlot::onUpdate(float dt)
} }
} }
FoodHolder::FoodHolder(int slot, bool trash) : Quad(), slot(slot), trash(trash) FoodHolder::FoodHolder(int slot, bool trash) : Quad(), trash(trash), slot(slot)
{ {
foodHolderIngredient = 0; foodHolderIngredient = 0;
buttonDown = false; buttonDown = false;
@ -1020,7 +1020,7 @@ public:
Vector menuBgScale; Vector menuBgScale;
const int ITEMS_PER_PAGE = 12; //const int ITEMS_PER_PAGE = 12;
ObsRow::ObsRow(int tx, int ty, int len) : tx(tx), ty(ty), len(len) ObsRow::ObsRow(int tx, int ty, int len) : tx(tx), ty(ty), len(len)
{ {
@ -2244,7 +2244,7 @@ float Game::getCoverage(Vector pos, int sampleArea)
{ {
if (x == t.x && y == t.y) continue; if (x == t.x && y == t.y) continue;
TileVector ct(x,y); TileVector ct(x,y);
Vector vt = ct.worldVector(); //Vector vt = ct.worldVector();
if (isObstructed(ct)) if (isObstructed(ct))
{ {
covered++; covered++;
@ -8250,11 +8250,9 @@ void Game::playBurstSound(bool wallJump)
sound->playSfx("Burst", 1); sound->playSfx("Burst", 1);
if (chance(50)) if (chance(50))
{ {
switch (dsq->continuity.form) if (dsq->continuity.form == FORM_BEAST)
{ {
case FORM_BEAST:
sound->playSfx("BeastBurst", (128+rand()%64)/256.0f); sound->playSfx("BeastBurst", (128+rand()%64)/256.0f);
break;
} }
} }
} }
@ -10404,7 +10402,7 @@ void Game::update(float dt)
dsq->cameraPos = getCameraPositionFor(cameraInterp); dsq->cameraPos = getCameraPositionFor(cameraInterp);
constrainCamera(); constrainCamera();
float dd = (dsq->cameraPos - oldCamPos).getLength2D(); //float dd = (dsq->cameraPos - oldCamPos).getLength2D();
} }
cameraInterp.update(dt); cameraInterp.update(dt);

View file

@ -363,7 +363,7 @@ class EntityClass
{ {
public: public:
EntityClass(std::string name, bool script=false, int idx=-1, std::string prevGfx="", float prevScale=1) EntityClass(std::string name, bool script=false, int idx=-1, std::string prevGfx="", float prevScale=1)
: name(name), script(script), idx(idx), prevGfx(prevGfx), prevScale(prevScale) {} : name(name), prevScale(prevScale), prevGfx(prevGfx), script(script), idx(idx) {}
std::string name; std::string name;
float prevScale; float prevScale;
std::string prevGfx; std::string prevGfx;

View file

@ -22,8 +22,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Avatar.h" #include "Avatar.h"
IngredientData::IngredientData(const std::string &name, const std::string &gfx, IngredientType type) IngredientData::IngredientData(const std::string &name, const std::string &gfx, IngredientType type)
: name(name), gfx(gfx), amount(0), maxAmount(MAX_INGREDIENT_AMOUNT), held(0), type(type), marked(0), sorted(false) : name(name)
, gfx(gfx)
, displayName(dsq->continuity.getIngredientDisplayName(name)) , displayName(dsq->continuity.getIngredientDisplayName(name))
, type(type)
, amount(0)
, maxAmount(MAX_INGREDIENT_AMOUNT)
, held(0)
, marked(0)
, rotKind(!(type == IT_OIL || type == IT_EGG)) , rotKind(!(type == IT_OIL || type == IT_EGG))
{ {
} }
@ -44,7 +50,11 @@ bool IngredientData::hasIET(IngredientEffectType iet)
} }
Ingredient::Ingredient(const Vector &pos, IngredientData *data, int amount) Ingredient::Ingredient(const Vector &pos, IngredientData *data, int amount)
: Entity(), data(data), amount(amount), gone(false), used(false) : Entity()
, data(data)
, used(false)
, gone(false)
, amount(amount)
{ {
addType(SCO_INGREDIENT); addType(SCO_INGREDIENT);
entityType = ET_INGREDIENT; entityType = ET_INGREDIENT;

View file

@ -27,7 +27,7 @@ class Logo : public StateObject
{ {
public: public:
Logo(); Logo();
EVENT(JumpTitle, jumpTitle); EVENT(JumpTitle, jumpTitle)
void applyState(); void applyState();
void removeState(); void removeState();
}; };

View file

@ -41,8 +41,13 @@ static bool _modname_cmp(const ModIcon *a, const ModIcon *b)
return a->fname < b->fname; return a->fname < b->fname;
} }
ModSelectorScreen::ModSelectorScreen() : Quad(), ActionMapper(), ModSelectorScreen::ModSelectorScreen()
currentPanel(-1), gotServerList(false), dlText(&dsq->smallFont), subtext(&dsq->subsFont) : Quad()
, ActionMapper()
, dlText(&dsq->smallFont)
, gotServerList(false)
, currentPanel(-1)
, subtext(&dsq->subsFont)
{ {
followCamera = 1; followCamera = 1;
shareAlphaWithChildren = false; shareAlphaWithChildren = false;
@ -131,7 +136,7 @@ void ModSelectorScreen::showPanel(int id)
if(id == currentPanel) if(id == currentPanel)
return; return;
const float t = 0.2f; //const float t = 0.2f;
IconGridPanel *newgrid = panels[id]; IconGridPanel *newgrid = panels[id];
// fade in selected panel // fade in selected panel
@ -478,7 +483,11 @@ void BasicIcon::onClick()
dsq->sound->playSfx("denied"); dsq->sound->playSfx("denied");
} }
MenuIcon::MenuIcon(int id) : SubtitleIcon(), iconId(id), cb(0), cb_data(0) MenuIcon::MenuIcon(int id)
: SubtitleIcon()
, cb(0)
, cb_data(0)
, iconId(id)
{ {
} }
@ -614,7 +623,13 @@ void ModIcon::updateStatus()
ModIconOnline::ModIconOnline() ModIconOnline::ModIconOnline()
: SubtitleIcon(), pb(0), extraIcon(0), statusIcon(0), clickable(true), pkgtype(MPT_MOD), hasUpdate(false) : SubtitleIcon()
, pb(0)
, extraIcon(0)
, statusIcon(0)
, pkgtype(MPT_MOD)
, clickable(true)
, hasUpdate(false)
{ {
label = desc; label = desc;
} }
@ -872,7 +887,7 @@ void MenuIconBar::add(MenuIcon *ico)
} }
IconGridPanel::IconGridPanel() IconGridPanel::IconGridPanel()
: spacing(0), y(0), x(0) : spacing(0), x(0), y(0)
{ {
shareAlphaWithChildren = false; // patch selection icons need their own alpha, use fade() instead shareAlphaWithChildren = false; // patch selection icons need their own alpha, use fade() instead
alphaMod = 0.01f; alphaMod = 0.01f;

View file

@ -60,7 +60,7 @@ protected:
minihttp::HttpSocket::_OnOpen(); minihttp::HttpSocket::_OnOpen();
const Request& r = GetCurrentRequest(); //const Request& r = GetCurrentRequest();
// TODO ?? // TODO ??
} }

View file

@ -587,9 +587,9 @@ void Path::update(float dt)
Vector start = nodes[0].position; Vector start = nodes[0].position;
Vector end = nodes[1].position; Vector end = nodes[1].position;
Vector v = end - start; Vector v = end - start;
Vector left = v.getPerpendicularLeft(); //Vector left = v.getPerpendicularLeft();
Vector right = v.getPerpendicularRight(); //Vector right = v.getPerpendicularRight();
Vector mid = (end-start) + start; //Vector mid = (end-start) + start;
FOR_ENTITIES(i) FOR_ENTITIES(i)
{ {
Entity *e = *i; Entity *e = *i;

View file

@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
class SearchGridRaw class SearchGridRaw
{ {
public: public:
SearchGridRaw(ObsType blocking) : game(dsq->game), blockingObsBits(blocking) {} SearchGridRaw(ObsType blocking) : blockingObsBits(blocking), game(dsq->game) {}
inline bool operator()(unsigned x, unsigned y) const inline bool operator()(unsigned x, unsigned y) const
{ {
return (game->getGridRaw(TileVector(x, y)) & blockingObsBits) == OT_EMPTY; return (game->getGridRaw(TileVector(x, y)) & blockingObsBits) == OT_EMPTY;
@ -80,7 +80,7 @@ void PathFinding::molestPath(VectorPath &path)
Vector node = path.getPathNode(i)->value; Vector node = path.getPathNode(i)->value;
float dist; float dist;
int sample = 20; int sample = 20;
float maxDist = sample * TILE_SIZE; //float maxDist = sample * TILE_SIZE;
{ {
Vector n = dsq->game->getWallNormal(node, sample, &dist); Vector n = dsq->game->getWallNormal(node, sample, &dist);
if (dist != -1 && (n.x != 0 || n.y != 0)) if (dist != -1 && (n.x != 0 || n.y != 0))

View file

@ -2863,6 +2863,9 @@ void SceneEditor::updateText()
if (getSelectedPath()) if (getSelectedPath())
os << " name: " << getSelectedPath()->name; os << " name: " << getSelectedPath()->name;
break; break;
case ET_SELECTENTITY:
case ET_MAX:
break;
} }
text->setText(os.str()); text->setText(os.str());
} }
@ -2992,6 +2995,10 @@ void SceneEditor::update(float dt)
else else
placer->alpha = 0.5; placer->alpha = 0.5;
break; break;
case ET_PATHS:
case ET_SELECTENTITY:
case ET_MAX:
break;
} }
updateText(); updateText();
@ -3099,6 +3106,9 @@ void SceneEditor::update(float dt)
if (selectedIdx >= 0) if (selectedIdx >= 0)
dsq->game->getPath(selectedIdx)->nodes[selectedNode].position = dsq->getGameCursorPosition() + cursorOffset; dsq->game->getPath(selectedIdx)->nodes[selectedNode].position = dsq->getGameCursorPosition() + cursorOffset;
break; break;
case ES_ROTATING:
case ES_MAX:
break;
} }
} }
else if (editType == ET_ENTITIES) else if (editType == ET_ENTITIES)
@ -3126,6 +3136,11 @@ void SceneEditor::update(float dt)
} }
} }
} }
break;
case ES_SELECTING:
case ES_SCALING:
case ES_MAX:
break;
} }
} }
else if (editType == ET_ELEMENTS) else if (editType == ET_ELEMENTS)
@ -3193,7 +3208,7 @@ void SceneEditor::update(float dt)
else if (cursorOffset.x < oldPosition.x-10) else if (cursorOffset.x < oldPosition.x-10)
right = false; right = false;
else else
noSide++; noSide = true;
if (cursorOffset.y > oldPosition.y+10) if (cursorOffset.y > oldPosition.y+10)
down = true; down = true;
else if (cursorOffset.y < oldPosition.y-10) else if (cursorOffset.y < oldPosition.y-10)
@ -3291,6 +3306,8 @@ void SceneEditor::update(float dt)
} }
} }
break; break;
case ES_MAX:
break;
} }
} }
} }

View file

@ -25,10 +25,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
const float strengthSeparation = 1; const float strengthSeparation = 1;
const float strengthAlignment = 0.8f; const float strengthAlignment = 0.8f;
const float strengthAvoidance = 1; //const float strengthAvoidance = 1;
const float strengthCohesion = 0.5f; const float strengthCohesion = 0.5f;
const float avoidanceDistance = 128; //const float avoidanceDistance = 128;
const float separationDistance = 128; const float separationDistance = 128;
const float minUrgency = 5;//0.05; const float minUrgency = 5;//0.05;
const float maxUrgency = 10;//0.1; const float maxUrgency = 10;//0.1;

View file

@ -586,16 +586,6 @@ BaseText *getText(lua_State *L, int slot = 1)
return q; return q;
} }
static inline
Shader *getShader(lua_State *L, int slot = 1)
{
Shader *q = (Shader*)lua_touserdata(L, slot);
ENSURE_TYPE(q, SCO_SHADER);
if (!q)
scriptDebug(L, "Invalid Shader");
return q;
}
static SkeletalSprite *getSkeletalSprite(Entity *e) static SkeletalSprite *getSkeletalSprite(Entity *e)
{ {
return e ? &e->skeletalSprite : NULL; return e ? &e->skeletalSprite : NULL;
@ -4542,7 +4532,7 @@ luaFunc(entity_getAnimationLoop)
luaFunc(entity_move) luaFunc(entity_move)
{ {
Entity *e = entity(L); Entity *e = entity(L);
bool ease = lua_tointeger(L, 5); //bool ease = lua_tointeger(L, 5);
Vector p(lua_tonumber(L, 2), lua_tonumber(L, 3)); Vector p(lua_tonumber(L, 2), lua_tonumber(L, 3));
if (getBool(L, 6)) if (getBool(L, 6))
p = e->position + p; p = e->position + p;
@ -7703,7 +7693,7 @@ luaFunc(getNearestEntity)
Vector p(lua_tonumber(L, 1), lua_tonumber(L, 2)); Vector p(lua_tonumber(L, 1), lua_tonumber(L, 2));
int radius = lua_tointeger(L, 3); int radius = lua_tointeger(L, 3);
Entity *ignore = lua_isuserdata(L, 4) ? entity(L, 4) : NULL; Entity *ignore = lua_isuserdata(L, 4) ? entity(L, 4) : NULL;
EntityType et = lua_isnumber(L, 5) ? (EntityType)lua_tointeger(L, 5) : ET_NOTYPE; //EntityType et = lua_isnumber(L, 5) ? (EntityType)lua_tointeger(L, 5) : ET_NOTYPE;
DamageType dt = lua_isnumber(L, 6) ? (DamageType)lua_tointeger(L, 6) : DT_NONE; DamageType dt = lua_isnumber(L, 6) ? (DamageType)lua_tointeger(L, 6) : DT_NONE;
int lrStart = lua_isnumber(L, 7) ? lua_tointeger(L, 7) : -1; int lrStart = lua_isnumber(L, 7) ? lua_tointeger(L, 7) : -1;
int lrEnd = lua_isnumber(L, 8) ? lua_tointeger(L, 8) : -1; int lrEnd = lua_isnumber(L, 8) ? lua_tointeger(L, 8) : -1;
@ -9706,6 +9696,7 @@ static const struct {
luaRegister(entity_setDeathParticleEffect), luaRegister(entity_setDeathParticleEffect),
luaRegister(entity_setDeathSound), luaRegister(entity_setDeathSound),
luaRegister(entity_setStopSoundsOnDeath),
luaRegister(entity_setDamageTarget), luaRegister(entity_setDamageTarget),
luaRegister(entity_setAllDamageTargets), luaRegister(entity_setAllDamageTargets),
@ -9958,7 +9949,7 @@ static const struct {
luaRegister(resetTimer), luaRegister(resetTimer),
luaRegister(addInfluence), luaRegister(addInfluence),
luaRegister(setSuckPosition), luaRegister(getSuckPosition),
luaRegister(setSuckPosition), luaRegister(setSuckPosition),
luaRegister(setNumSuckPositions), luaRegister(setNumSuckPositions),
luaRegister(setupBasicEntity), luaRegister(setupBasicEntity),
@ -10569,6 +10560,7 @@ static const struct {
luaRegister(minimap_setBottomTex), luaRegister(minimap_setBottomTex),
luaRegister(minimap_setAvatarIconTex), luaRegister(minimap_setAvatarIconTex),
luaRegister(minimap_setHealthBarTex), luaRegister(minimap_setHealthBarTex),
luaRegister(minimap_setMaxHealthMarkerTex),
luaRegister(entity_mmicon_delete), luaRegister(entity_mmicon_delete),
luaRegister(entity_mmicon_tex), luaRegister(entity_mmicon_tex),
luaRegister(entity_mmicon_size), luaRegister(entity_mmicon_size),

View file

@ -92,7 +92,7 @@ const int FLAG_SPIRIT_DRASK = 126;
const int FLAG_SPIRIT_DRUNIAD = 127; const int FLAG_SPIRIT_DRUNIAD = 127;
const int FLAG_TRANSTURTLE_VEIL01 = 130; const int FLAG_TRANSTURTLE_VEIL01 = 130;
const int FLAG_TRANSTURTLE_OPENWATER06 = 131; //const int FLAG_TRANSTURTLE_OPENWATER06 = 131;
const int FLAG_TRANSTURTLE_FOREST04 = 132; const int FLAG_TRANSTURTLE_FOREST04 = 132;
const int FLAG_TRANSTURTLE_OPENWATER03 = 133; const int FLAG_TRANSTURTLE_OPENWATER03 = 133;
const int FLAG_TRANSTURTLE_FOREST05 = 134; const int FLAG_TRANSTURTLE_FOREST05 = 134;
@ -104,15 +104,15 @@ const int FLAG_TRANSTURTLE_FINALBOSS = 139;
const int FLAG_SEAHORSEBESTTIME = 247; const int FLAG_SEAHORSEBESTTIME = 247;
const int FLAG_MINIBOSS_START = 700; //const int FLAG_MINIBOSS_START = 700;
const int FLAG_MINIBOSS_NAUTILUSPRIME = 700; //const int FLAG_MINIBOSS_NAUTILUSPRIME = 700;
const int FLAG_MINIBOSS_KINGJELLY = 701; const int FLAG_MINIBOSS_KINGJELLY = 701;
const int FLAG_MINIBOSS_MERGOG = 702; const int FLAG_MINIBOSS_MERGOG = 702;
const int FLAG_MINIBOSS_CRAB = 703; const int FLAG_MINIBOSS_CRAB = 703;
const int FLAG_MINIBOSS_OCTOMUN = 704; const int FLAG_MINIBOSS_OCTOMUN = 704;
const int FLAG_MINIBOSS_MANTISSHRIMP = 705; const int FLAG_MINIBOSS_MANTISSHRIMP = 705;
const int FLAG_MINIBOSS_PRIESTS = 706; //const int FLAG_MINIBOSS_PRIESTS = 706;
const int FLAG_MINIBOSS_END = 720; //const int FLAG_MINIBOSS_END = 720;
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View file

@ -155,7 +155,7 @@ private:
// Should we store stats this frame? // Should we store stats this frame?
bool storeStats; bool storeStats;
PlayStats playStats; // PlayStats playStats;
// Current Stat details // Current Stat details
//float m_flGameFeetTraveled; //float m_flGameFeetTraveled;

View file

@ -264,8 +264,8 @@ void AfterEffectManager::renderGrid()
if (activeShader) if (activeShader)
activeShader->unbind(); activeShader->unbind();
float width2 = float(vw)/2; //float width2 = float(vw)/2;
float height2 = float(vh)/2; //float height2 = float(vh)/2;
if(firstShader != lastShader) if(firstShader != lastShader)

View file

@ -28,6 +28,7 @@ class Effect
{ {
public: public:
Effect(); Effect();
virtual ~Effect(){};
virtual void go(){} virtual void go(){}
virtual void update(float dt, Vector ** drawGrid, int xDivs, int yDivs){} virtual void update(float dt, Vector ** drawGrid, int xDivs, int yDivs){}
bool done; bool done;

View file

@ -67,6 +67,13 @@ Vector getDirVector(Direction dir)
case DIR_RIGHT: case DIR_RIGHT:
return Vector(1, 0); return Vector(1, 0);
break; break;
case DIR_UPLEFT:
case DIR_UPRIGHT:
case DIR_DOWNLEFT:
case DIR_DOWNRIGHT:
case DIR_MAX:
case DIR_NONE:
break;
} }
return Vector(0,0); return Vector(0,0);
} }
@ -87,6 +94,13 @@ Direction getOppositeDir(Direction dir)
case DIR_RIGHT: case DIR_RIGHT:
return DIR_LEFT; return DIR_LEFT;
break; break;
case DIR_UPLEFT:
case DIR_UPRIGHT:
case DIR_DOWNLEFT:
case DIR_DOWNRIGHT:
case DIR_MAX:
case DIR_NONE:
break;
} }
return DIR_NONE; return DIR_NONE;
@ -108,6 +122,13 @@ Direction getNextDirClockwise(Direction dir)
case DIR_RIGHT: case DIR_RIGHT:
return DIR_DOWN; return DIR_DOWN;
break; break;
case DIR_UPLEFT:
case DIR_UPRIGHT:
case DIR_DOWNLEFT:
case DIR_DOWNRIGHT:
case DIR_MAX:
case DIR_NONE:
break;
} }
return DIR_NONE; return DIR_NONE;
} }
@ -200,11 +221,6 @@ static unsigned char charIsUpper(unsigned char c)
return c == upperToLowerTable[c]; return c == upperToLowerTable[c];
} }
static unsigned char charIsLower(unsigned char c)
{
return c == lowerToUpperTable[c];
}
static unsigned char charToLower(unsigned char c) static unsigned char charToLower(unsigned char c)
{ {
return upperToLowerTable[c]; return upperToLowerTable[c];
@ -591,7 +607,7 @@ void forEachFile(std::string path, std::string type, void callback(const std::st
dirent *file=0; dirent *file=0;
while ( (file=readdir(dir)) != NULL ) while ( (file=readdir(dir)) != NULL )
{ {
if (file->d_name && strlen(file->d_name) > 4) if (strlen(file->d_name) > 4)
{ {
debugLog(file->d_name); debugLog(file->d_name);
char *extension=strrchr(file->d_name,'.'); char *extension=strrchr(file->d_name,'.');

View file

@ -1280,35 +1280,6 @@ bool Core::createWindow(int width, int height, int bits, bool fullscreen, std::s
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#endif #endif
static void
bbgePerspective(float fovy, float aspect, float zNear, float zFar)
{
float sine, cotangent, deltaZ;
float radians = fovy / 2.0f * M_PI / 180.0f;
deltaZ = zFar - zNear;
sine = sinf(radians);
if ((deltaZ == 0.0f) || (sine == 0.0f) || (aspect == 0.0f)) {
return;
}
cotangent = cosf(radians) / sine;
GLfloat m[4][4] = {
{ 1.0f, 0.0f, 0.0f, 0.0f },
{ 0.0f, 1.0f, 0.0f, 0.0f },
{ 0.0f, 0.0f, 1.0f, 0.0f },
{ 0.0f, 0.0f, 0.0f, 1.0f }
};
m[0][0] = (GLfloat) (cotangent / aspect);
m[1][1] = (GLfloat) cotangent;
m[2][2] = (GLfloat) (-(zFar + zNear) / deltaZ);
m[2][3] = -1.0f;
m[3][2] = (GLfloat) (-2.0f * zNear * zFar / deltaZ);
m[3][3] = 0.0f;
glMultMatrixf(&m[0][0]);
}
void Core::setPixelScale(int pixelScaleX, int pixelScaleY) void Core::setPixelScale(int pixelScaleX, int pixelScaleY)
{ {
@ -1565,7 +1536,6 @@ void Core::main(float runTime)
float dt; float dt;
float counter = 0; float counter = 0;
int frames = 0; int frames = 0;
float real_dt = 0;
#if (!defined(_DEBUG) || defined(BBGE_BUILD_UNIX)) && defined(BBGE_BUILD_SDL) #if (!defined(_DEBUG) || defined(BBGE_BUILD_UNIX)) && defined(BBGE_BUILD_SDL)

View file

@ -162,7 +162,12 @@ void DebugFont::setAlign(Align align)
#include "../BBGE/Quad.h" #include "../BBGE/Quad.h"
DebugButton::DebugButton(int buttonID, DebugButtonReceiver *receiver, int bgWidth, int fsize, bool quitMain) DebugButton::DebugButton(int buttonID, DebugButtonReceiver *receiver, int bgWidth, int fsize, bool quitMain)
: RenderObject(), label(0), highlight(0), quitMain(quitMain), receiver(receiver), buttonID(buttonID) : RenderObject()
, label(0)
, quitMain(quitMain)
, buttonID(buttonID)
, highlight(0)
, receiver(receiver)
{ {
if (bgWidth == 0) if (bgWidth == 0)
bgWidth = 150; bgWidth = 150;

View file

@ -80,6 +80,10 @@ void PostProcessingFX::render()
FXTypes type = (FXTypes)i; FXTypes type = (FXTypes)i;
switch(type) switch(type)
{ {
case FTX_NONE:
break;
case FXT_MAX:
break;
case FXT_RADIALBLUR: case FXT_RADIALBLUR:
float windowW = core->getWindowWidth(); float windowW = core->getWindowWidth();

View file

@ -185,7 +185,7 @@ protected:
struct ParticleInfluence struct ParticleInfluence
{ {
ParticleInfluence(Vector pos, float spd, float size, bool pull) ParticleInfluence(Vector pos, float spd, float size, bool pull)
: pos(pos), spd(spd), size(size), pull(pull) : pos(pos), size(size), spd(spd), pull(pull)
{} {}
ParticleInfluence() : size(0), spd(0), pull(false) {} ParticleInfluence() : size(0), spd(0), pull(false) {}
Vector pos; Vector pos;

View file

@ -22,7 +22,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <assert.h> #include <assert.h>
QuadTrail::QuadTrail(int maxPoints, float pointDist) QuadTrail::QuadTrail(int maxPoints, float pointDist)
: RenderObject(), maxPoints(maxPoints), pointDist(pointDist), numPoints(0) : RenderObject()
, numPoints(0)
, maxPoints(maxPoints)
, pointDist(pointDist)
{ {
quadTrailAlphaEffect = QTAE_NORMAL; quadTrailAlphaEffect = QTAE_NORMAL;
cull = false; cull = false;

View file

@ -114,9 +114,9 @@ void Shader::staticInit()
// everything fine when we are here // everything fine when we are here
_useShaders = true; _useShaders = true;
#endif
end: end:
#endif
if (_useShaders) if (_useShaders)
debugLog("Shader support enabled."); debugLog("Shader support enabled.");
@ -329,14 +329,14 @@ void Shader::_setUniform(Uniform *u)
{ {
switch(u->type) switch(u->type)
{ {
case GL_FLOAT: glUniform1fvARB(u->location, 1, u->data.f); break; case GL_FLOAT: glUniform1fvARB(u->location, 1, u->data.f.f); break;
case GL_FLOAT_VEC2_ARB: glUniform2fvARB(u->location, 1, u->data.f); break; case GL_FLOAT_VEC2_ARB: glUniform2fvARB(u->location, 1, u->data.f.f); break;
case GL_FLOAT_VEC3_ARB: glUniform3fvARB(u->location, 1, u->data.f); break; case GL_FLOAT_VEC3_ARB: glUniform3fvARB(u->location, 1, u->data.f.f); break;
case GL_FLOAT_VEC4_ARB: glUniform4fvARB(u->location, 1, u->data.f); break; case GL_FLOAT_VEC4_ARB: glUniform4fvARB(u->location, 1, u->data.f.f); break;
case GL_INT: glUniform1ivARB(u->location, 1, u->data.i); break; case GL_INT: glUniform1ivARB(u->location, 1, u->data.i.i); break;
case GL_INT_VEC2_ARB: glUniform2ivARB(u->location, 1, u->data.i); break; case GL_INT_VEC2_ARB: glUniform2ivARB(u->location, 1, u->data.i.i); break;
case GL_INT_VEC3_ARB: glUniform3ivARB(u->location, 1, u->data.i); break; case GL_INT_VEC3_ARB: glUniform3ivARB(u->location, 1, u->data.i.i); break;
case GL_INT_VEC4_ARB: glUniform4ivARB(u->location, 1, u->data.i); break; case GL_INT_VEC4_ARB: glUniform4ivARB(u->location, 1, u->data.i.i); break;
} }
u->dirty = false; u->dirty = false;
} }
@ -432,10 +432,10 @@ void Shader::setInt(const char *name, int x, int y /* = 0 */, int z /* = 0 */, i
if(unsigned(idx) >= uniforms.size()) if(unsigned(idx) >= uniforms.size())
return; return;
Uniform& u = uniforms[idx]; Uniform& u = uniforms[idx];
u.data.i[0] = x; u.data.i.i[0] = x;
u.data.i[1] = y; u.data.i.i[1] = y;
u.data.i[2] = z; u.data.i.i[2] = z;
u.data.i[3] = w; u.data.i.i[3] = w;
u.dirty = true; u.dirty = true;
uniformsDirty = true; uniformsDirty = true;
#endif #endif
@ -450,10 +450,10 @@ void Shader::setFloat(const char *name, float x, float y /* = 0 */, float z /* =
if(unsigned(idx) >= uniforms.size()) if(unsigned(idx) >= uniforms.size())
return; return;
Uniform& u = uniforms[idx]; Uniform& u = uniforms[idx];
u.data.f[0] = x; u.data.f.f[0] = x;
u.data.f[1] = y; u.data.f.f[1] = y;
u.data.f[2] = z; u.data.f.f[2] = z;
u.data.f[3] = w; u.data.f.f[3] = w;
u.dirty = true; u.dirty = true;
uniformsDirty = true; uniformsDirty = true;
#endif #endif

View file

@ -62,14 +62,14 @@ private:
bool dirty; // need to flush if true bool dirty; // need to flush if true
union union
{ {
struct struct si
{ {
int i[4]; int i[4];
}; } i;
struct struct sf
{ {
float f[4]; float f[4];
}; } f;
} data; } data;
char name[64]; char name[64];

View file

@ -372,6 +372,9 @@ void BoneCommand::run()
case AC_RESET_PASS: case AC_RESET_PASS:
b->setRenderPass(b->originalRenderPass); b->setRenderPass(b->originalRenderPass);
break; break;
case AC_SEGS_START:
case AC_SEGS_STOP:
break;
} }
} }

View file

@ -105,7 +105,7 @@ public:
class BoneKeyframe class BoneKeyframe
{ {
public: public:
BoneKeyframe() : idx(0), x(0), y(0), rot(0), doScale(0), sx(1), sy(1) {} BoneKeyframe() : idx(0), x(0), y(0), rot(0), sx(1), sy(1), doScale(0) {}
int idx, x, y, rot; int idx, x, y, rot;
float sx, sy; float sx, sy;
bool doScale; bool doScale;

View file

@ -72,7 +72,7 @@ namespace SoundCore
struct FadeCh struct FadeCh
{ {
public: public:
FadeCh() : v(1), s(1), c(0), d(-1), to(0) {} FadeCh() : c(0), v(1), s(1), to(0), d(-1) {}
FMOD::Channel *c; FMOD::Channel *c;
float v,s,to; float v,s,to;
int d; int d;
@ -410,6 +410,9 @@ void SoundManager::toggleEffectMusic(SoundEffectType effect, bool on)
dspFlange->remove(); dspFlange->remove();
} }
break; break;
case SFX_NONE:
case SFX_MAX:
break;
} }
} }

View file

@ -84,9 +84,8 @@ enum SoundLoadType
struct PlaySfx struct PlaySfx
{ {
PlaySfx() : priority(0.5), handle(0), vol(1), fade(SFT_NONE), PlaySfx() : handle(0), vol(1), time(0), freq(1), loops(0), priority(0.5),
time(0), freq(1), loops(0), maxdist(0), fade(SFT_NONE), x(0), y(0), relative(true), positional(false) {}
maxdist(0), x(0), y(0), relative(true), positional(false) {}
std::string name; std::string name;
intptr_t handle; intptr_t handle;

View file

@ -230,7 +230,7 @@ bool Texture::load(std::string file)
size_t pos = file.find_last_of('.'); size_t pos = file.find_last_of('.');
if ((pos != std::string::npos) && (pos >= 0)) if (pos != std::string::npos)
{ {
// make sure this didn't catch the '.' in /home/username/.Aquaria/* --ryan. // make sure this didn't catch the '.' in /home/username/.Aquaria/* --ryan.
const std::string userdata = core->getUserDataFolder(); const std::string userdata = core->getUserDataFolder();

View file

@ -148,26 +148,26 @@ public:
ByteBuffer() ByteBuffer()
: _rpos(0), _wpos(0), _buf(NULL), _size(0), _growable(true), _res(0), _mybuf(false), _delfunc(NULL), : _buf(NULL), _rpos(0), _wpos(0), _res(0), _size(0), _delfunc(NULL),
_allocfunc(NULL) _allocfunc(NULL), _mybuf(false), _growable(true)
{ {
} }
ByteBuffer(uint32 res) ByteBuffer(uint32 res)
: _rpos(0), _wpos(0), _buf(NULL), _size(0), _growable(true), _res(0), _mybuf(false), _delfunc(NULL), : _buf(NULL), _rpos(0), _wpos(0), _res(0), _size(0), _delfunc(NULL),
_allocfunc(NULL) _allocfunc(NULL), _mybuf(false), _growable(true)
{ {
_allocate(res); _allocate(res);
} }
ByteBuffer(ByteBuffer &buf, Mode mode = COPY, uint32 extra = 0) ByteBuffer(ByteBuffer &buf, Mode mode = COPY, uint32 extra = 0)
: _rpos(0), _wpos(0), _buf(NULL), _size(0), _growable(true), _res(0), _mybuf(false), _delfunc(NULL), : _buf(NULL), _rpos(0), _wpos(0), _res(0), _size(0), _delfunc(NULL),
_allocfunc(NULL) _allocfunc(NULL), _mybuf(false), _growable(true)
{ {
init(buf, mode, extra); init(buf, mode, extra);
} }
// del param only used with TAKE_OVER, extra only used with COPY // del param only used with TAKE_OVER, extra only used with COPY
ByteBuffer(void *buf, uint32 size, Mode mode = COPY, delete_func del = NULL, uint32 extra = 0) ByteBuffer(void *buf, uint32 size, Mode mode = COPY, delete_func del = NULL, uint32 extra = 0)
: _rpos(0), _wpos(0), _size(size), _buf(NULL), _growable(true), _delfunc(del), : _buf(NULL), _rpos(0), _wpos(0), _res(0), _size(0), _delfunc(NULL),
_mybuf(false), _allocfunc(NULL) // for mode == REUSE _allocfunc(NULL), _mybuf(false), _growable(true) // for mode == REUSE
{ {
init(buf, size, mode, del, extra); init(buf, size, mode, del, extra);
} }

View file

@ -9,9 +9,9 @@
DeflateCompressor::DeflateCompressor() DeflateCompressor::DeflateCompressor()
: _windowBits(-MAX_WBITS), // negative, because we want a raw deflate stream, and not zlib-wrapped : _windowBits(-MAX_WBITS), // negative, because we want a raw deflate stream, and not zlib-wrapped
_real_size(0),
_forceCompress(false), _forceCompress(false),
_iscompressed(false), _iscompressed(false)
_real_size(0)
{ {
} }