mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-07-03 22:44:32 +00:00
Merge branch 'experimental' into controllerfixup
# Conflicts: # Aquaria/Avatar.cpp # Aquaria/Continuity.cpp # Aquaria/DSQ.cpp # Aquaria/DSQ.h # Aquaria/Game.cpp # Aquaria/Game.h # Aquaria/Main.cpp # Aquaria/UserSettings.cpp # BBGE/Base.cpp # BBGE/Base.h # BBGE/Core.cpp # BBGE/Core.h # BBGE/DebugFont.cpp # BBGE/Shader.cpp # BBGE/SoundManager.h
This commit is contained in:
commit
0dc30e668d
67 changed files with 788 additions and 511 deletions
|
@ -1115,7 +1115,6 @@ 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;
|
|
||||||
if (!core->getCtrlState())
|
if (!core->getCtrlState())
|
||||||
{
|
{
|
||||||
for (int i = 0; i < editSprite->getCurrentAnimation()->getNumKeyframes(); ++i)
|
for (int i = 0; i < editSprite->getCurrentAnimation()->getNumKeyframes(); ++i)
|
||||||
|
|
|
@ -884,6 +884,8 @@ void AquariaKeyConfig::onUpdate(float dt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case INPUTSET_NONE:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,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
|
||||||
|
@ -71,7 +71,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;
|
||||||
|
@ -83,9 +83,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;
|
||||||
|
@ -847,6 +847,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;
|
||||||
}
|
}
|
||||||
|
@ -1217,6 +1227,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1567,6 +1581,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2812,6 +2829,10 @@ void Avatar::formAbility(int ability)
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case FORM_NORMAL:
|
||||||
|
case FORM_NONE:
|
||||||
|
case FORM_MAX:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2936,7 +2957,6 @@ void Avatar::doShock(const std::string &shotName)
|
||||||
s->targetPt = targets[j].targetPt;
|
s->targetPt = targets[j].targetPt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Vector d = e->position - position;
|
|
||||||
s->setAimVector(getTendrilAimVector(i, thits));
|
s->setAimVector(getTendrilAimVector(i, thits));
|
||||||
checkUpgradeForShot(s);
|
checkUpgradeForShot(s);
|
||||||
}
|
}
|
||||||
|
@ -2978,8 +2998,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3072,6 +3098,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;
|
||||||
}
|
}
|
||||||
|
@ -4670,6 +4702,10 @@ void Avatar::updateAura(float dt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case AURA_THING:
|
||||||
|
case AURA_HEAL:
|
||||||
|
case AURA_NONE:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
auraTimer -= dt;
|
auraTimer -= dt;
|
||||||
|
@ -4814,6 +4850,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5891,7 +5935,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");
|
||||||
}
|
}
|
||||||
|
@ -5943,6 +5987,13 @@ void Avatar::onUpdate(float dt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case FORM_NORMAL:
|
||||||
|
case FORM_BEAST:
|
||||||
|
case FORM_SPIRIT:
|
||||||
|
case FORM_FISH:
|
||||||
|
case FORM_MAX:
|
||||||
|
case FORM_NONE:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -93,6 +93,8 @@ void CollideEntity::bounce(float ba)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case BOUNCE_NONE:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -559,6 +559,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 "";
|
||||||
|
@ -1192,6 +1196,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 "";
|
||||||
}
|
}
|
||||||
|
@ -1581,8 +1588,12 @@ void Continuity::castSong(int num)
|
||||||
case SONG_FISHFORM:
|
case SONG_FISHFORM:
|
||||||
dsq->game->avatar->changeForm(FORM_FISH);
|
dsq->game->avatar->changeForm(FORM_FISH);
|
||||||
break;
|
break;
|
||||||
case SONG_SONGDOOR1:
|
|
||||||
case SONG_MAP:
|
case SONG_MAP:
|
||||||
|
case SONG_SONGDOOR1:
|
||||||
|
case SONG_SONGDOOR2:
|
||||||
|
case SONG_ANIMA:
|
||||||
|
case SONG_NONE:
|
||||||
|
case SONG_MAX:
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -1683,6 +1683,8 @@ void DSQ::setInputMode(InputMode mode)
|
||||||
core->joystickAsMouse = false;
|
core->joystickAsMouse = false;
|
||||||
updateCursorFromMouse = true;
|
updateCursorFromMouse = true;
|
||||||
break;
|
break;
|
||||||
|
case INPUT_KEYBOARD:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3916,6 +3918,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);
|
||||||
|
|
|
@ -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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -278,7 +278,6 @@ void Game::warpToSceneNode(std::string scene, std::string node)
|
||||||
if (avatar->isfh())
|
if (avatar->isfh())
|
||||||
toFlip = 1;
|
toFlip = 1;
|
||||||
|
|
||||||
|
|
||||||
core->enqueueJumpState("Game");
|
core->enqueueJumpState("Game");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3856,6 +3855,7 @@ void Game::playBurstSound(bool wallJump)
|
||||||
case FORM_BEAST:
|
case FORM_BEAST:
|
||||||
sound->playSfx("BeastBurst", (128+rand()%64)/256.0f);
|
sound->playSfx("BeastBurst", (128+rand()%64)/256.0f);
|
||||||
break;
|
break;
|
||||||
|
default: ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4766,8 +4766,6 @@ void Game::update(float dt)
|
||||||
cameraInterp.interpolateTo(dest, cameraLerpDelay);
|
cameraInterp.interpolateTo(dest, cameraLerpDelay);
|
||||||
dsq->cameraPos = getCameraPositionFor(cameraInterp);
|
dsq->cameraPos = getCameraPositionFor(cameraInterp);
|
||||||
constrainCamera();
|
constrainCamera();
|
||||||
|
|
||||||
float dd = (dsq->cameraPos - oldCamPos).getLength2D();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cameraInterp.update(dt);
|
cameraInterp.update(dt);
|
||||||
|
@ -4874,7 +4872,6 @@ ElementTemplate Game::getElementTemplateForLetter(int i)
|
||||||
|
|
||||||
void Game::loadElementTemplates(std::string pack)
|
void Game::loadElementTemplates(std::string pack)
|
||||||
{
|
{
|
||||||
|
|
||||||
stringToLower(pack);
|
stringToLower(pack);
|
||||||
|
|
||||||
elementTemplates.clear();
|
elementTemplates.clear();
|
||||||
|
|
|
@ -158,7 +158,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;
|
||||||
|
|
|
@ -109,6 +109,8 @@ class FoodHolder : public Quad
|
||||||
public:
|
public:
|
||||||
FoodHolder(int slot, bool trash=false);
|
FoodHolder(int slot, bool trash=false);
|
||||||
|
|
||||||
|
bool isValid() const;
|
||||||
|
void toggleValid(bool b);
|
||||||
bool isEmpty();
|
bool isEmpty();
|
||||||
bool isTrash();
|
bool isTrash();
|
||||||
void setIngredient(IngredientData *i, bool effects=true);
|
void setIngredient(IngredientData *i, bool effects=true);
|
||||||
|
@ -255,6 +257,16 @@ FoodHolder::FoodHolder(int slot, bool trash) : Quad(), slot(slot), trash(trash)
|
||||||
addChild(lid, PM_POINTER);
|
addChild(lid, PM_POINTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FoodHolder::isValid() const
|
||||||
|
{
|
||||||
|
return alpha.x > 0 && alphaMod > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FoodHolder::toggleValid(bool v)
|
||||||
|
{
|
||||||
|
alpha = alphaMod = (float) v;
|
||||||
|
}
|
||||||
|
|
||||||
void FoodHolder::animateLid(bool down, bool longAnim)
|
void FoodHolder::animateLid(bool down, bool longAnim)
|
||||||
{
|
{
|
||||||
float t = 0.2f;
|
float t = 0.2f;
|
||||||
|
@ -518,7 +530,7 @@ void FoodSlot::moveRight()
|
||||||
|
|
||||||
for (int i = foodHolders.size()-1; i >= 0; i--)
|
for (int i = foodHolders.size()-1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
if (foodHolders[i]->alpha.x > 0 && foodHolders[i]->alphaMod > 0 && foodHolders[i]->isEmpty() && !foodHolders[i]->isTrash())
|
if (foodHolders[i]->isValid() && foodHolders[i]->isEmpty() && !foodHolders[i]->isTrash())
|
||||||
{
|
{
|
||||||
foodHolders[i]->setIngredient(ingredient);
|
foodHolders[i]->setIngredient(ingredient);
|
||||||
inCookSlot = true;
|
inCookSlot = true;
|
||||||
|
@ -593,7 +605,7 @@ void FoodSlot::onUpdate(float dt)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (foodHolders[i]->isEmpty())
|
else if (foodHolders[i]->isEmpty() && foodHolders[i]->isValid())
|
||||||
{
|
{
|
||||||
foodHolders[i]->setIngredient(ingredient);
|
foodHolders[i]->setIngredient(ingredient);
|
||||||
inCookSlot = true;
|
inCookSlot = true;
|
||||||
|
@ -1107,7 +1119,7 @@ void InGameMenu::action(int id, int state, int source)
|
||||||
int trashIndex = -1;
|
int trashIndex = -1;
|
||||||
for (int i = 0; i < foodHolders.size(); i++)
|
for (int i = 0; i < foodHolders.size(); i++)
|
||||||
{
|
{
|
||||||
if (foodHolders[i]->alpha.x > 0 && foodHolders[i]->alphaMod > 0 && foodHolders[i]->isTrash())
|
if (foodHolders[i]->isValid() && foodHolders[i]->isTrash())
|
||||||
{
|
{
|
||||||
trashIndex = i;
|
trashIndex = i;
|
||||||
break;
|
break;
|
||||||
|
@ -2268,7 +2280,7 @@ void InGameMenu::create()
|
||||||
for (i = 0; i < foodHolders.size(); i++)
|
for (i = 0; i < foodHolders.size(); i++)
|
||||||
{
|
{
|
||||||
foodHolders[i] = new FoodHolder(i);
|
foodHolders[i] = new FoodHolder(i);
|
||||||
foodHolders[i]->alpha = 0;
|
foodHolders[i]->toggleValid(false);
|
||||||
|
|
||||||
float angle = (float(holders)/float(foodHolders.size()))*PI*2;
|
float angle = (float(holders)/float(foodHolders.size()))*PI*2;
|
||||||
foodHolders[i]->position = rightCenter + Vector(sinf(angle), cosf(angle))*radius;
|
foodHolders[i]->position = rightCenter + Vector(sinf(angle), cosf(angle))*radius;
|
||||||
|
@ -2355,7 +2367,7 @@ void InGameMenu::create()
|
||||||
|
|
||||||
foodHolders.resize(4);
|
foodHolders.resize(4);
|
||||||
foodHolders[3] = new FoodHolder(-1, true);
|
foodHolders[3] = new FoodHolder(-1, true);
|
||||||
foodHolders[3]->alpha = 0;
|
foodHolders[3]->toggleValid(false);
|
||||||
foodHolders[3]->position = rightCenter + Vector(96, 150);
|
foodHolders[3]->position = rightCenter + Vector(96, 150);
|
||||||
menuBg->addChild(foodHolders[3], PM_POINTER);
|
menuBg->addChild(foodHolders[3], PM_POINTER);
|
||||||
|
|
||||||
|
@ -3011,7 +3023,7 @@ void InGameMenu::onCook()
|
||||||
longAnim = false;
|
longAnim = false;
|
||||||
|
|
||||||
for (int i = foodHolders.size()-1; i >= 0; i--)
|
for (int i = foodHolders.size()-1; i >= 0; i--)
|
||||||
if (foodHolders[i]->alpha.x > 0 && !foodHolders[i]->isEmpty() && !foodHolders[i]->isTrash())
|
if (foodHolders[i]->isValid() && !foodHolders[i]->isEmpty() && !foodHolders[i]->isTrash())
|
||||||
foodHolders[i]->animateLid(true, longAnim);
|
foodHolders[i]->animateLid(true, longAnim);
|
||||||
|
|
||||||
//dsq->main(0.2);
|
//dsq->main(0.2);
|
||||||
|
@ -3099,7 +3111,7 @@ void InGameMenu::onCook()
|
||||||
dsq->sound->playSfx("Cook");
|
dsq->sound->playSfx("Cook");
|
||||||
|
|
||||||
for (int i = 0; i < foodHolders.size(); i++)
|
for (int i = 0; i < foodHolders.size(); i++)
|
||||||
if (foodHolders[i]->alpha.x > 0 && !foodHolders[i]->isTrash())
|
if (foodHolders[i]->isValid() && !foodHolders[i]->isTrash())
|
||||||
foodHolders[i]->animateLid(false);
|
foodHolders[i]->animateLid(false);
|
||||||
|
|
||||||
dsq->spawnParticleEffect("cook-food", Vector(575,250), 0, 0, LR_HUD3, 1);
|
dsq->spawnParticleEffect("cook-food", Vector(575,250), 0, 0, LR_HUD3, 1);
|
||||||
|
@ -3568,12 +3580,7 @@ void InGameMenu::toggleFoodMenu(bool f)
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < foodHolders.size(); i++)
|
for (int i = 0; i < foodHolders.size(); i++)
|
||||||
{
|
foodHolders[i]->toggleValid(f);
|
||||||
if (f)
|
|
||||||
foodHolders[i]->alpha = 1;
|
|
||||||
else
|
|
||||||
foodHolders[i]->alpha = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (f)
|
if (f)
|
||||||
{
|
{
|
||||||
|
@ -3584,11 +3591,11 @@ void InGameMenu::toggleFoodMenu(bool f)
|
||||||
|| ((p=game->getNearestPath(game->avatar->position, PATH_COOK))
|
|| ((p=game->getNearestPath(game->avatar->position, PATH_COOK))
|
||||||
&& p->isCoordinateInside(game->avatar->position)))
|
&& p->isCoordinateInside(game->avatar->position)))
|
||||||
{
|
{
|
||||||
foodHolders[0]->alpha = 1;
|
foodHolders[0]->toggleValid(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foodHolders[0]->alpha = 0;
|
foodHolders[0]->toggleValid(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,9 +24,15 @@ 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)
|
||||||
, displayName(dsq->continuity.getIngredientDisplayName(name))
|
, gfx(gfx)
|
||||||
, rotKind(!(type == IT_OIL || type == IT_EGG))
|
, displayName(dsq->continuity.getIngredientDisplayName(name))
|
||||||
|
, type(type)
|
||||||
|
, amount(0)
|
||||||
|
, maxAmount(MAX_INGREDIENT_AMOUNT)
|
||||||
|
, held(0)
|
||||||
|
, marked(0)
|
||||||
|
, rotKind(!(type == IT_OIL || type == IT_EGG))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +52,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;
|
||||||
|
|
|
@ -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();
|
||||||
};
|
};
|
||||||
|
|
|
@ -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
|
||||||
|
@ -480,7 +485,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)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -623,7 +632,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;
|
||||||
}
|
}
|
||||||
|
@ -881,7 +896,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;
|
||||||
|
|
|
@ -60,7 +60,7 @@ protected:
|
||||||
|
|
||||||
minihttp::HttpSocket::_OnOpen();
|
minihttp::HttpSocket::_OnOpen();
|
||||||
|
|
||||||
const Request& r = GetCurrentRequest();
|
//const Request& r = GetCurrentRequest();
|
||||||
// TODO ??
|
// TODO ??
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -587,9 +587,6 @@ 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 right = v.getPerpendicularRight();
|
|
||||||
Vector mid = (end-start) + start;
|
|
||||||
FOR_ENTITIES(i)
|
FOR_ENTITIES(i)
|
||||||
{
|
{
|
||||||
Entity *e = *i;
|
Entity *e = *i;
|
||||||
|
|
|
@ -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;
|
||||||
|
@ -79,8 +79,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;
|
const int sample = 20;
|
||||||
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))
|
||||||
|
|
|
@ -2741,6 +2741,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());
|
||||||
}
|
}
|
||||||
|
@ -2806,6 +2809,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();
|
||||||
|
@ -2913,6 +2920,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)
|
||||||
|
@ -2940,6 +2950,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)
|
||||||
|
@ -3007,7 +3022,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)
|
||||||
|
@ -3105,6 +3120,8 @@ void SceneEditor::update(float dt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ES_MAX:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -598,16 +598,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;
|
||||||
|
@ -893,7 +883,7 @@ luaFunc(os_setclipboard)
|
||||||
|
|
||||||
luaFunc(os_getclipboard)
|
luaFunc(os_getclipboard)
|
||||||
{
|
{
|
||||||
const char *s = SDL_GetClipboardText();
|
char *s = SDL_GetClipboardText();
|
||||||
lua_pushstring(L, s ? s : "");
|
lua_pushstring(L, s ? s : "");
|
||||||
if(s)
|
if(s)
|
||||||
SDL_free(s);
|
SDL_free(s);
|
||||||
|
@ -4575,7 +4565,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;
|
||||||
|
@ -7712,7 +7702,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;
|
||||||
|
@ -9727,6 +9717,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),
|
||||||
|
@ -9979,7 +9970,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),
|
||||||
|
@ -10587,6 +10578,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),
|
||||||
|
@ -10608,7 +10600,7 @@ static const struct {
|
||||||
#undef MK_ALIAS
|
#undef MK_ALIAS
|
||||||
#define MK_FUNC(base, getter, prefix, suffix) luaRegister(prefix##_##suffix),
|
#define MK_FUNC(base, getter, prefix, suffix) luaRegister(prefix##_##suffix),
|
||||||
#define MK_STR(s) #s
|
#define MK_STR(s) #s
|
||||||
#define MK_ALIAS(prefix, suffix, alias) {MK_STR(prefix)"_"MK_STR(alias), l_##prefix##_##suffix},
|
#define MK_ALIAS(prefix, suffix, alias) {MK_STR(prefix) "_" MK_STR(alias), l_##prefix##_##suffix},
|
||||||
|
|
||||||
EXPAND_FUNC_PROTOTYPES
|
EXPAND_FUNC_PROTOTYPES
|
||||||
|
|
||||||
|
@ -11368,12 +11360,12 @@ lua_State *ScriptInterface::createLuaVM()
|
||||||
luaL_openlibs(state);
|
luaL_openlibs(state);
|
||||||
|
|
||||||
#ifdef LUAAPI_HAS_CLIPBOARD
|
#ifdef LUAAPI_HAS_CLIPBOARD
|
||||||
lua_getglobal(L, "os");
|
lua_getglobal(state, "os");
|
||||||
lua_pushcfunction(L, l_os_getclipboard);
|
lua_pushcfunction(state, l_os_getclipboard);
|
||||||
lua_setfield(L, -2, "getclipboard");
|
lua_setfield(state, -2, "getclipboard");
|
||||||
lua_pushcfunction(L, l_os_setclipboard);
|
lua_pushcfunction(state, l_os_setclipboard);
|
||||||
lua_setfield(L, -2, "setclipboard");
|
lua_setfield(state, -2, "setclipboard");
|
||||||
lua_pop(L, 1);
|
lua_pop(state, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(!allowUnsafeFunctions)
|
if(!allowUnsafeFunctions)
|
||||||
|
|
|
@ -93,7 +93,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;
|
||||||
|
@ -105,15 +105,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;
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -259,10 +259,6 @@ void AfterEffectManager::renderGrid()
|
||||||
if (activeShader)
|
if (activeShader)
|
||||||
activeShader->unbind();
|
activeShader->unbind();
|
||||||
|
|
||||||
float width2 = float(vw)/2;
|
|
||||||
float height2 = float(vh)/2;
|
|
||||||
|
|
||||||
|
|
||||||
if(firstShader != lastShader)
|
if(firstShader != lastShader)
|
||||||
{
|
{
|
||||||
// From here on: secondary shader passes.
|
// From here on: secondary shader passes.
|
||||||
|
|
|
@ -29,6 +29,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;
|
||||||
|
|
|
@ -113,11 +113,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];
|
||||||
|
@ -355,7 +350,6 @@ std::string stripEndlineForUnix(const std::string &in)
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool isTouchingLine(Vector lineStart, Vector lineEnd, Vector point, int radius, Vector *closestP)
|
bool isTouchingLine(Vector lineStart, Vector lineEnd, Vector point, int radius, Vector *closestP)
|
||||||
{
|
{
|
||||||
Vector dir = lineEnd - lineStart;
|
Vector dir = lineEnd - lineStart;
|
||||||
|
|
|
@ -769,7 +769,6 @@ bool Core::initGraphicsLibrary(int width, int height, bool fullscreen, bool vsyn
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
initIcon(gScreen);
|
initIcon(gScreen);
|
||||||
// Create window
|
|
||||||
|
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << "setting vsync: " << vsync;
|
os << "setting vsync: " << vsync;
|
||||||
|
@ -1195,7 +1194,6 @@ void Core::run(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)
|
#if !defined(_DEBUG)
|
||||||
bool wasInactive = false;
|
bool wasInactive = false;
|
||||||
|
|
|
@ -164,8 +164,15 @@ void DebugFont::setAlign(Align align)
|
||||||
#include "../BBGE/Quad.h"
|
#include "../BBGE/Quad.h"
|
||||||
|
|
||||||
DebugButton::DebugButton(int buttonID, DebugButtonReceiver *receiver, int bgWidth, int fsize)
|
DebugButton::DebugButton(int buttonID, DebugButtonReceiver *receiver, int bgWidth, int fsize)
|
||||||
: RenderObject(), label(0), highlight(0), receiver(receiver), buttonID(buttonID)
|
: RenderObject()
|
||||||
, activeAlpha(0.5f), activeColor(1,1,1), inactiveAlpha(0.5f), inactiveColor(0,0,0)
|
, label(0)
|
||||||
|
, buttonID(buttonID)
|
||||||
|
, highlight(0)
|
||||||
|
, receiver(receiver)
|
||||||
|
, activeAlpha(0.5f)
|
||||||
|
, activeColor(1,1,1)
|
||||||
|
, inactiveAlpha(0.5f)
|
||||||
|
, inactiveColor(0,0,0)
|
||||||
{
|
{
|
||||||
if (bgWidth == 0)
|
if (bgWidth == 0)
|
||||||
bgWidth = 150;
|
bgWidth = 150;
|
||||||
|
|
|
@ -82,6 +82,8 @@ void PostProcessingFX::render()
|
||||||
FXTypes type = (FXTypes)i;
|
FXTypes type = (FXTypes)i;
|
||||||
switch(type)
|
switch(type)
|
||||||
{
|
{
|
||||||
|
case FXT_MAX:
|
||||||
|
break;
|
||||||
case FXT_RADIALBLUR:
|
case FXT_RADIALBLUR:
|
||||||
|
|
||||||
float windowW = core->getWindowWidth();
|
float windowW = core->getWindowWidth();
|
||||||
|
|
|
@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
enum FXTypes
|
enum FXTypes
|
||||||
{
|
{
|
||||||
FTX_NONE =-1,
|
|
||||||
FXT_RADIALBLUR =0,
|
FXT_RADIALBLUR =0,
|
||||||
FXT_MAX
|
FXT_MAX
|
||||||
};
|
};
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -23,7 +23,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include "RenderBase.h"
|
#include "RenderBase.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;
|
||||||
|
|
|
@ -73,9 +73,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.");
|
||||||
|
@ -288,14 +288,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;
|
||||||
}
|
}
|
||||||
|
@ -391,10 +391,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
|
||||||
|
@ -409,10 +409,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
|
||||||
|
|
|
@ -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];
|
||||||
|
|
||||||
|
|
|
@ -377,6 +377,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,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;
|
||||||
|
|
|
@ -73,7 +73,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;
|
||||||
|
@ -411,6 +411,9 @@ void SoundManager::toggleEffectMusic(SoundEffectType effect, bool on)
|
||||||
dspFlange->remove();
|
dspFlange->remove();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SFX_NONE:
|
||||||
|
case SFX_MAX:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,9 +83,8 @@ enum SoundLoadType
|
||||||
|
|
||||||
struct PlaySfx
|
struct PlaySfx
|
||||||
{
|
{
|
||||||
PlaySfx() : priority(0.5), vol(1), fade(SFT_NONE),
|
PlaySfx() : 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;
|
||||||
float vol;
|
float vol;
|
||||||
|
|
|
@ -221,7 +221,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();
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@ set(ttvfs_SRC
|
||||||
VFSArchiveLoader.h
|
VFSArchiveLoader.h
|
||||||
VFSBase.cpp
|
VFSBase.cpp
|
||||||
VFSBase.h
|
VFSBase.h
|
||||||
|
VFSDebug.cpp
|
||||||
|
VFSDebug.h
|
||||||
VFSDefines.h
|
VFSDefines.h
|
||||||
VFSDir.cpp
|
VFSDir.cpp
|
||||||
VFSDir.h
|
VFSDir.h
|
||||||
|
@ -28,3 +30,8 @@ set(ttvfs_SRC
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(ttvfs ${ttvfs_SRC})
|
add_library(ttvfs ${ttvfs_SRC})
|
||||||
|
|
||||||
|
install(TARGETS ttvfs DESTINATION lib)
|
||||||
|
|
||||||
|
install(DIRECTORY ./ DESTINATION include/ttvfs
|
||||||
|
FILES_MATCHING PATTERN "*.h")
|
||||||
|
|
72
ExternalLibs/ttvfs/VFSDebug.cpp
Normal file
72
ExternalLibs/ttvfs/VFSDebug.cpp
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
#include "VFSDebug.h"
|
||||||
|
#include "VFSInternal.h"
|
||||||
|
#include "VFSRoot.h"
|
||||||
|
#include "VFSDir.h"
|
||||||
|
#include "VFSFile.h"
|
||||||
|
#include "VFSTools.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <set>
|
||||||
|
|
||||||
|
|
||||||
|
VFS_NAMESPACE_START
|
||||||
|
namespace debug {
|
||||||
|
|
||||||
|
|
||||||
|
struct _DbgParams
|
||||||
|
{
|
||||||
|
_DbgParams(std::ostream& os_, const std::string& path, const std::string& sp_)
|
||||||
|
: os(os_), mypath(path), sp(sp_) {}
|
||||||
|
|
||||||
|
std::ostream& os;
|
||||||
|
std::string mypath;
|
||||||
|
const std::string& sp;
|
||||||
|
std::set<std::string> dirnames;
|
||||||
|
};
|
||||||
|
|
||||||
|
static void _DumpFile(File *vf, void *user)
|
||||||
|
{
|
||||||
|
_DbgParams& p = *((_DbgParams*)user);
|
||||||
|
p.os << p.sp << " F:" << vf->fullname() << " [" << vf->getType() << ", ref " << vf->getRefCount() << ", 0x" << vf << "]" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void _DumpDir(DirBase *vd, void *user)
|
||||||
|
{
|
||||||
|
_DbgParams& p = *((_DbgParams*)user);
|
||||||
|
if(!(vd->fullname()[0] == '/' && vd->fullnameLen() == 1)) // don't recurse down the root dir.
|
||||||
|
p.dirnames.insert(vd->name());
|
||||||
|
p.os << p.sp << "D : " << vd->fullname() << " [" << vd->getType() << ", ref " << vd->getRefCount() << ", 0x" << vd << "]" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void _DumpTree(_DbgParams& p, Root& vfs, int level)
|
||||||
|
{
|
||||||
|
p.os << ">> [" << p.mypath << "]" << std::endl;
|
||||||
|
|
||||||
|
vfs.ForEach(p.mypath.c_str(), _DumpFile, _DumpDir);
|
||||||
|
|
||||||
|
if(!level)
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::string sub = p.sp + " ";
|
||||||
|
for(std::set<std::string>::iterator it = p.dirnames.begin(); it != p.dirnames.end(); ++it)
|
||||||
|
{
|
||||||
|
_DbgParams recP(p.os, joinPath(p.mypath, it->c_str()), sub);
|
||||||
|
_DumpTree(recP, vfs, level - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dumpTree(Root& root, std::ostream& os, const char *path /* = NULL */, int level /* = -1 */)
|
||||||
|
{
|
||||||
|
if(!path)
|
||||||
|
path = "";
|
||||||
|
os << ">>> FILE TREE DUMP <<<" << std::endl;
|
||||||
|
_DbgParams recP(os, path, "");
|
||||||
|
_DumpTree(recP, root, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} // end namespace debug
|
||||||
|
|
||||||
|
VFS_NAMESPACE_END
|
||||||
|
|
22
ExternalLibs/ttvfs/VFSDebug.h
Normal file
22
ExternalLibs/ttvfs/VFSDebug.h
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#ifndef TTVFS_DEBUG_H
|
||||||
|
#define TTVFS_DEBUG_H
|
||||||
|
|
||||||
|
#include "VFSDefines.h"
|
||||||
|
#include <iosfwd>
|
||||||
|
|
||||||
|
VFS_NAMESPACE_START
|
||||||
|
class Root;
|
||||||
|
|
||||||
|
namespace debug {
|
||||||
|
|
||||||
|
/** Dump tree structure with debug information to a stream.
|
||||||
|
path specifies the subdir to dump; use "" or NULL to dump the whole tree.
|
||||||
|
Set level to >= 0 to limit the recursion depth.
|
||||||
|
Level < 0 recurses as deep as the tree goes. */
|
||||||
|
void dumpTree(Root& root, std::ostream& os, const char *path = NULL, int level = -1);
|
||||||
|
|
||||||
|
|
||||||
|
} // end namespace debug
|
||||||
|
VFS_NAMESPACE_END
|
||||||
|
|
||||||
|
#endif
|
|
@ -28,30 +28,39 @@
|
||||||
#define VFS_NAMESPACE_END }
|
#define VFS_NAMESPACE_END }
|
||||||
|
|
||||||
|
|
||||||
#if !defined(_MSC_VER)
|
// Important that this is included outside of the namespace.
|
||||||
# include <stdint.h>
|
// Note that stdint.h is intentionally NOT included if possible,
|
||||||
|
// because on gcc it pulls in features.h, which in turn checks for
|
||||||
|
// _FILE_OFFSET_BITS presence. That means to enable 64bit file I/O,
|
||||||
|
// _FILE_OFFSET_BITS would have to be defined here.
|
||||||
|
// For the sake of not polluting the includer, use other means to define
|
||||||
|
// a 64 bit type.
|
||||||
|
#if !defined(_MSC_VER) && !defined(__GNUC__)
|
||||||
|
# include <stdint.h> // Hope it works.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
VFS_NAMESPACE_START
|
VFS_NAMESPACE_START
|
||||||
|
|
||||||
#ifdef VFS_LARGEFILE_SUPPORT
|
// vfspos type (signed 64bit integer if possible, 32bit otherwise)
|
||||||
# if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
typedef __int64 vfspos;
|
typedef __int64 vfspos;
|
||||||
# else
|
#elif defined(__GNUC__)
|
||||||
# include <stdint.h>
|
__extension__ // suppress warnings about long long
|
||||||
|
typedef long long int vfspos;
|
||||||
|
#elif defined(VFS_LARGEFILE_SUPPORT)
|
||||||
|
// fallback using stdint. h, but only if necessary
|
||||||
typedef int64_t vfspos;
|
typedef int64_t vfspos;
|
||||||
# endif
|
|
||||||
#else
|
#else
|
||||||
typedef unsigned int vfspos;
|
// If all else fails
|
||||||
|
typedef long int vfspos; // what fseek() uses, no guarantees whether 64 or 32 bits
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
|
#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
# define VFS_STRICMP _stricmp
|
# define VFS_STRICMP _stricmp
|
||||||
static const vfspos npos = vfspos(-1i64);
|
|
||||||
#else
|
#else
|
||||||
# define VFS_STRICMP strcasecmp
|
# define VFS_STRICMP strcasecmp
|
||||||
static const vfspos npos = vfspos(-1LL);
|
|
||||||
#endif
|
#endif
|
||||||
|
static const vfspos npos = ~vfspos(0);
|
||||||
|
|
||||||
typedef void (*delete_func)(void *);
|
typedef void (*delete_func)(void *);
|
||||||
|
|
||||||
|
@ -63,6 +72,12 @@ struct _AbiCheck
|
||||||
int nocase;
|
int nocase;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class File;
|
||||||
|
class DirBase;
|
||||||
|
|
||||||
|
typedef void (*FileEnumCallback)(File *vf, void *user);
|
||||||
|
typedef void (*DirEnumCallback)(DirBase *vd, void *user);
|
||||||
|
|
||||||
|
|
||||||
VFS_NAMESPACE_END
|
VFS_NAMESPACE_END
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,6 @@ std::pair<DirBase*, DirBase*> DirBase::_getDirEx(const char *subdir, const char
|
||||||
return std::make_pair(this, this);
|
return std::make_pair(this, this);
|
||||||
|
|
||||||
DirBase *ret = NULL;
|
DirBase *ret = NULL;
|
||||||
DirBase *last = NULL;
|
|
||||||
char *slashpos = (char *)strchr(subdir, '/');
|
char *slashpos = (char *)strchr(subdir, '/');
|
||||||
|
|
||||||
// if there is a '/' in the string, descend into subdir and continue there
|
// if there is a '/' in the string, descend into subdir and continue there
|
||||||
|
@ -239,12 +238,13 @@ void Dir::forEachDir(DirEnumCallback f, void *user /* = NULL */, bool safe /* =
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool Dir::add(File *f)
|
bool Dir::add(File *f)
|
||||||
{
|
{
|
||||||
if(!f)
|
return _addRecursiveSkip(f, 0);
|
||||||
return false;
|
}
|
||||||
|
|
||||||
|
bool Dir::_addSingle(File *f)
|
||||||
|
{
|
||||||
Files::iterator it = _files.find(f->name());
|
Files::iterator it = _files.find(f->name());
|
||||||
|
|
||||||
if(it != _files.end())
|
if(it != _files.end())
|
||||||
|
@ -260,11 +260,8 @@ bool Dir::add(File *f)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Dir::addRecursive(File *f, size_t skip /* = 0 */)
|
bool Dir::_addRecursiveSkip(File *f, size_t skip /* = 0 */)
|
||||||
{
|
{
|
||||||
if(!f)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Dir *vdir = this;
|
Dir *vdir = this;
|
||||||
if(f->fullnameLen() - f->nameLen() > skip)
|
if(f->fullnameLen() - f->nameLen() > skip)
|
||||||
{
|
{
|
||||||
|
@ -285,7 +282,7 @@ bool Dir::addRecursive(File *f, size_t skip /* = 0 */)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return vdir->add(f);
|
return vdir->_addSingle(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dir::clearGarbage()
|
void Dir::clearGarbage()
|
||||||
|
@ -374,4 +371,12 @@ void DiskDir::load()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ----- MemDir start here -----
|
||||||
|
|
||||||
|
MemDir *MemDir::createNew(const char *dir) const
|
||||||
|
{
|
||||||
|
return new MemDir(dir);
|
||||||
|
}
|
||||||
|
|
||||||
VFS_NAMESPACE_END
|
VFS_NAMESPACE_END
|
||||||
|
|
|
@ -59,9 +59,6 @@ class DirView;
|
||||||
class File;
|
class File;
|
||||||
class VFSLoader;
|
class VFSLoader;
|
||||||
|
|
||||||
typedef void (*FileEnumCallback)(File *vf, void *user);
|
|
||||||
typedef void (*DirEnumCallback)(DirBase *vd, void *user);
|
|
||||||
|
|
||||||
|
|
||||||
// Avoid using std::string as key.
|
// Avoid using std::string as key.
|
||||||
// The file names are known to remain constant during each object's lifetime,
|
// The file names are known to remain constant during each object's lifetime,
|
||||||
|
@ -125,14 +122,12 @@ public:
|
||||||
virtual ~Dir();
|
virtual ~Dir();
|
||||||
|
|
||||||
/** Adds a file directly to this directory, allows any name.
|
/** Adds a file directly to this directory, allows any name.
|
||||||
|
If the file name contains a path, descend the tree to the target dir.
|
||||||
|
Not-existing subdirs are created on the way.
|
||||||
If another file with this name already exists, drop the old one out.
|
If another file with this name already exists, drop the old one out.
|
||||||
Returns whether the file was actually added (false if the same file already existed) */
|
Returns whether the file was actually added (false if the same file already existed) */
|
||||||
bool add(File *f);
|
bool add(File *f);
|
||||||
|
|
||||||
/** Like add(), but if the file name contains a path, descend the tree to the target dir.
|
|
||||||
Not-existing subdirs are created on the way. */
|
|
||||||
bool addRecursive(File *f, size_t skip = 0);
|
|
||||||
|
|
||||||
/** Enumerate directory with given path. Clears previously loaded entries. */
|
/** Enumerate directory with given path. Clears previously loaded entries. */
|
||||||
virtual void load() = 0;
|
virtual void load() = 0;
|
||||||
|
|
||||||
|
@ -146,9 +141,12 @@ public:
|
||||||
File *getFileByName(const char *fn, bool lazyLoad = true);
|
File *getFileByName(const char *fn, bool lazyLoad = true);
|
||||||
File *getFileFromSubdir(const char *subdir, const char *file);
|
File *getFileFromSubdir(const char *subdir, const char *file);
|
||||||
|
|
||||||
|
bool _addRecursiveSkip(File *f, size_t skip = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
bool _addSingle(File *f);
|
||||||
|
|
||||||
inline VFSLoader *getLoader() const { return _loader; }
|
inline VFSLoader *getLoader() const { return _loader; }
|
||||||
|
|
||||||
Files _files;
|
Files _files;
|
||||||
|
@ -162,9 +160,23 @@ class DiskDir : public Dir
|
||||||
public:
|
public:
|
||||||
DiskDir(const char *path, VFSLoader *ldr);
|
DiskDir(const char *path, VFSLoader *ldr);
|
||||||
virtual ~DiskDir() {};
|
virtual ~DiskDir() {};
|
||||||
virtual void load();
|
|
||||||
virtual DiskDir *createNew(const char *dir) const;
|
// virtual overloads
|
||||||
virtual const char *getType() const { return "DiskDir"; }
|
void load();
|
||||||
|
DiskDir *createNew(const char *dir) const;
|
||||||
|
const char *getType() const { return "DiskDir"; }
|
||||||
|
};
|
||||||
|
|
||||||
|
class MemDir : public Dir
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MemDir(const char *fullpath) : Dir(fullpath, NULL) {}
|
||||||
|
virtual ~MemDir() {}
|
||||||
|
|
||||||
|
// virtual overloads
|
||||||
|
void load() {}
|
||||||
|
MemDir *createNew(const char *dir) const;
|
||||||
|
const char *getType() const { return "MemDir"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
VFS_NAMESPACE_END
|
VFS_NAMESPACE_END
|
||||||
|
|
|
@ -106,12 +106,6 @@ void InternalDir::forEachFile(FileEnumCallback f, void *user /* = NULL */, bool
|
||||||
f(it->second, user);
|
f(it->second, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _iterDirs(Dirs &m, DirEnumCallback f, void *user)
|
|
||||||
{
|
|
||||||
for(Dirs::iterator it = m.begin(); it != m.end(); ++it)
|
|
||||||
f(it->second.content(), user);
|
|
||||||
}
|
|
||||||
|
|
||||||
void InternalDir::forEachDir(DirEnumCallback f, void *user /* = NULL */, bool safe /* = false */)
|
void InternalDir::forEachDir(DirEnumCallback f, void *user /* = NULL */, bool safe /* = false */)
|
||||||
{
|
{
|
||||||
for(MountedDirs::reverse_iterator it = _mountedDirs.rbegin(); it != _mountedDirs.rend(); ++it)
|
for(MountedDirs::reverse_iterator it = _mountedDirs.rbegin(); it != _mountedDirs.rend(); ++it)
|
||||||
|
|
|
@ -95,7 +95,7 @@ vfspos DiskFile::size()
|
||||||
// ------------- MemFile -----------------------
|
// ------------- MemFile -----------------------
|
||||||
|
|
||||||
MemFile::MemFile(const char *name, void *buf, unsigned int size, delete_func delfunc /* = NULL */, DeleteMode delmode /* = ON_CLOSE */)
|
MemFile::MemFile(const char *name, void *buf, unsigned int size, delete_func delfunc /* = NULL */, DeleteMode delmode /* = ON_CLOSE */)
|
||||||
: File(name), _pos(0), _size(size), _buf(buf), _delfunc(delfunc), _delmode(delmode)
|
: File(name), _buf(buf), _pos(0), _size(size), _delfunc(delfunc), _delmode(delmode)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,13 +88,14 @@ public:
|
||||||
ON_CLOSE,
|
ON_CLOSE,
|
||||||
ON_DESTROY
|
ON_DESTROY
|
||||||
};
|
};
|
||||||
/* Creates a virtual file from a memory buffer. The buffer is passed as-is,
|
/** Creates a virtual file from a memory buffer. The buffer is passed as-is,
|
||||||
so for text files you should make sure it ends with a \0 character.
|
so for text files you should make sure it ends with a \0 character.
|
||||||
A deletor function can be passed optionally, that the buffer will be passed to
|
A deletor function can be passed optionally, that the buffer will be passed to
|
||||||
when the memory file is destroyed. Pass NULL or leave away to keep the buffer alive. */
|
when the memory file is destroyed. Pass NULL or leave away to keep the buffer alive. */
|
||||||
MemFile(const char *name, void *buf, unsigned int size, delete_func delfunc = NULL, DeleteMode delmode = ON_CLOSE);
|
MemFile(const char *name, void *buf, unsigned int size, delete_func delfunc = NULL, DeleteMode delmode = ON_CLOSE);
|
||||||
virtual ~MemFile();
|
virtual ~MemFile();
|
||||||
virtual bool open(const char *mode = NULL) { return true; }
|
/** In order not to modify the passed buffer, MemFile does NOT respect the mode parameter. */
|
||||||
|
virtual bool open(const char *mode = NULL) { return !!_buf; }
|
||||||
virtual bool isopen() const { return !!_buf; } // always open
|
virtual bool isopen() const { return !!_buf; } // always open
|
||||||
virtual bool iseof() const { return _pos >= _size; }
|
virtual bool iseof() const { return _pos >= _size; }
|
||||||
virtual void close();
|
virtual void close();
|
||||||
|
|
|
@ -8,10 +8,12 @@ VFS_NAMESPACE_START
|
||||||
|
|
||||||
// Compile time assertion to make sure things work as expected
|
// Compile time assertion to make sure things work as expected
|
||||||
#if defined(VFS_LARGEFILE_SUPPORT)
|
#if defined(VFS_LARGEFILE_SUPPORT)
|
||||||
static void _dummy_()
|
TTVFS_UNUSED static void _dummy_()
|
||||||
{
|
{
|
||||||
|
// Ensure vfspos is 64 bits in largefile mode.
|
||||||
switch(0) { case 0:; case 4: case sizeof(vfspos): ; }
|
switch(0) { case 0:; case 4: case sizeof(vfspos): ; }
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
|
// Ensure the _FILE_OFFSET_BITS=64 setting in VFSInternal.h is effective
|
||||||
switch(0) { case 0:; case 4: case sizeof(off_t): ; }
|
switch(0) { case 0:; case 4: case sizeof(off_t): ; }
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,12 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
# define TTVFS_UNUSED __attribute__((unused))
|
||||||
|
#else
|
||||||
|
# define TTVFS_UNUSED
|
||||||
|
#endif
|
||||||
|
|
||||||
// These are used for small, temporary memory allocations that can remain on the stack.
|
// These are used for small, temporary memory allocations that can remain on the stack.
|
||||||
// If alloca is available, this is the preferred way.
|
// If alloca is available, this is the preferred way.
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
|
@ -37,6 +37,7 @@ public:
|
||||||
{
|
{
|
||||||
int val = s_getRef(_refcount);
|
int val = s_getRef(_refcount);
|
||||||
assert(val == 0 && "Object was deleted with refcount != 0");
|
assert(val == 0 && "Object was deleted with refcount != 0");
|
||||||
|
(void)val;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void incref()
|
inline void incref()
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
// VFSRoot.cpp - glues it all together and makes use simple
|
// VFSRoot.cpp - glues it all together and makes use simple
|
||||||
// For conditions of distribution and use, see copyright notice in VFS.h
|
// For conditions of distribution and use, see copyright notice in VFS.h
|
||||||
|
|
||||||
#include <set>
|
|
||||||
|
|
||||||
#include "VFSInternal.h"
|
#include "VFSInternal.h"
|
||||||
#include "VFSRoot.h"
|
#include "VFSRoot.h"
|
||||||
#include "VFSTools.h"
|
#include "VFSTools.h"
|
||||||
|
@ -13,9 +11,6 @@
|
||||||
#include "VFSArchiveLoader.h"
|
#include "VFSArchiveLoader.h"
|
||||||
#include "VFSDirView.h"
|
#include "VFSDirView.h"
|
||||||
|
|
||||||
//#include <stdio.h>
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
# include <cassert>
|
# include <cassert>
|
||||||
# define DEBUG_ASSERT(x) assert(x)
|
# define DEBUG_ASSERT(x) assert(x)
|
||||||
|
@ -64,11 +59,12 @@ void Root::Clear()
|
||||||
|
|
||||||
loaders.clear();
|
loaders.clear();
|
||||||
archLdrs.clear();
|
archLdrs.clear();
|
||||||
|
loadersInfo.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Root::Mount(const char *src, const char *dest)
|
void Root::Mount(const char *src, const char *dest)
|
||||||
{
|
{
|
||||||
AddVFSDir(GetDir(src, true), dest);
|
return AddVFSDir(GetDir(src, true), dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Root::AddVFSDir(DirBase *dir, const char *subdir /* = NULL */)
|
void Root::AddVFSDir(DirBase *dir, const char *subdir /* = NULL */)
|
||||||
|
@ -79,26 +75,54 @@ void Root::AddVFSDir(DirBase *dir, const char *subdir /* = NULL */)
|
||||||
into->_addMountDir(dir);
|
into->_addMountDir(dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Root::Unmount(const char *src, const char *dest)
|
bool Root::RemoveVFSDir(DirBase *dir, const char *subdir /* = NULL */)
|
||||||
{
|
{
|
||||||
DirBase *vdsrc = GetDir(src, false);
|
if(!subdir)
|
||||||
InternalDir *vddest = safecast<InternalDir*>(GetDir(dest, false));
|
subdir = dir->fullname();
|
||||||
if(!vdsrc || !vddest)
|
InternalDir *vddest = safecast<InternalDir*>(GetDir(subdir, false));
|
||||||
|
if(!vddest)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
vddest->_removeMountDir(vdsrc);
|
vddest->_removeMountDir(dir);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Root::AddLoader(VFSLoader *ldr, const char *path /* = NULL */)
|
bool Root::Unmount(const char *src, const char *dest)
|
||||||
{
|
{
|
||||||
loaders.push_back(ldr);
|
DirBase *vdsrc = GetDir(src, false);
|
||||||
AddVFSDir(ldr->getRoot(), path);
|
if(!vdsrc)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return RemoveVFSDir(vdsrc, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Root::AddArchiveLoader(VFSArchiveLoader *ldr)
|
int Root::AddLoader(VFSLoader *ldr, const char *path /* = NULL */)
|
||||||
{
|
{
|
||||||
|
DEBUG_ASSERT(ldr != NULL);
|
||||||
|
loaders.push_back(ldr);
|
||||||
|
loadersInfo.push_back(path);
|
||||||
|
AddVFSDir(ldr->getRoot(), path);
|
||||||
|
return (int)(loaders.size() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Root::RemoveLoader(int index, const char *path /* = NULL */)
|
||||||
|
{
|
||||||
|
VFSLoader *ldr = loaders[index];
|
||||||
|
RemoveVFSDir(ldr->getRoot(), loadersInfo[index].getPath());
|
||||||
|
loaders.erase(loaders.begin() + index);
|
||||||
|
loadersInfo.erase(loadersInfo.begin() + index);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Root::AddArchiveLoader(VFSArchiveLoader *ldr)
|
||||||
|
{
|
||||||
|
DEBUG_ASSERT(ldr != NULL);
|
||||||
archLdrs.push_back(ldr);
|
archLdrs.push_back(ldr);
|
||||||
|
return (int)(archLdrs.size() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Root::RemoveArchiveLoader(int index)
|
||||||
|
{
|
||||||
|
archLdrs.erase(archLdrs.begin() + index);
|
||||||
}
|
}
|
||||||
|
|
||||||
Dir *Root::AddArchive(const char *arch, void *opaque /* = NULL */)
|
Dir *Root::AddArchive(const char *arch, void *opaque /* = NULL */)
|
||||||
|
@ -133,7 +157,7 @@ inline static File *VFSHelper_GetFileByLoader(VFSLoader *ldr, const char *fn, co
|
||||||
return NULL;
|
return NULL;
|
||||||
File *vf = ldr->Load(fn, unmangled);
|
File *vf = ldr->Load(fn, unmangled);
|
||||||
if(vf)
|
if(vf)
|
||||||
ldr->getRoot()->addRecursive(vf);
|
ldr->getRoot()->add(vf);
|
||||||
return vf;
|
return vf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,62 +241,21 @@ void Root::ClearGarbage()
|
||||||
merged->clearGarbage();
|
merged->clearGarbage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Root::ForEach(const char *path, FileEnumCallback fileCallback /* = NULL */, DirEnumCallback dirCallback /* = NULL */,
|
||||||
|
void *user /* = NULL */, bool safe /* = false */)
|
||||||
// DEBUG STUFF
|
|
||||||
|
|
||||||
struct _DbgParams
|
|
||||||
{
|
{
|
||||||
_DbgParams(std::ostream& os_, const std::string& path, const std::string& sp_)
|
|
||||||
: os(os_), mypath(path), sp(sp_) {}
|
|
||||||
|
|
||||||
std::ostream& os;
|
|
||||||
std::string mypath;
|
|
||||||
const std::string& sp;
|
|
||||||
std::set<std::string> dirnames;
|
|
||||||
};
|
|
||||||
|
|
||||||
static void _DumpFile(File *vf, void *user)
|
|
||||||
{
|
|
||||||
_DbgParams& p = *((_DbgParams*)user);
|
|
||||||
p.os << p.sp << " F:" << vf->fullname() << " [" << vf->getType() << ", ref " << vf->getRefCount() << ", 0x" << vf << "]" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void _DumpDir(DirBase *vd, void *user)
|
|
||||||
{
|
|
||||||
_DbgParams& p = *((_DbgParams*)user);
|
|
||||||
if(!(vd->fullname()[0] == '/' && vd->fullnameLen() == 1)) // don't recurse down the root dir.
|
|
||||||
p.dirnames.insert(vd->name());
|
|
||||||
p.os << p.sp << "D : " << vd->fullname() << " [" << vd->getType() << ", ref " << vd->getRefCount() << ", 0x" << vd << "]" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void _DumpTree(_DbgParams& p, Root& vfs, int level)
|
|
||||||
{
|
|
||||||
p.os << ">> [" << p.mypath << "]" << std::endl;
|
|
||||||
DirView view;
|
DirView view;
|
||||||
vfs.FillDirView(p.mypath.c_str(), view);
|
if(!FillDirView(path, view))
|
||||||
|
return false;
|
||||||
|
|
||||||
view.forEachDir(_DumpDir, &p);
|
if(dirCallback)
|
||||||
view.forEachFile(_DumpFile, &p);
|
view.forEachDir(dirCallback, user, safe);
|
||||||
|
if(fileCallback)
|
||||||
|
view.forEachFile(fileCallback, user, safe);
|
||||||
|
|
||||||
if(!level)
|
return true;
|
||||||
return;
|
|
||||||
|
|
||||||
std::string sub = p.sp + " ";
|
|
||||||
for(std::set<std::string>::iterator it = p.dirnames.begin(); it != p.dirnames.end(); ++it)
|
|
||||||
{
|
|
||||||
_DbgParams recP(p.os, joinPath(p.mypath, it->c_str()), sub);
|
|
||||||
_DumpTree(recP, vfs, level - 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Root::debugDumpTree(std::ostream& os, const char *path, int level)
|
|
||||||
{
|
|
||||||
os << ">>> FILE TREE DUMP <<<" << std::endl;
|
|
||||||
_DbgParams recP(os, path, "");
|
|
||||||
_DumpTree(recP, *this, level);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
VFS_NAMESPACE_END
|
VFS_NAMESPACE_END
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iosfwd>
|
|
||||||
|
|
||||||
#include "VFSRefcounted.h"
|
#include "VFSRefcounted.h"
|
||||||
|
|
||||||
|
@ -23,7 +22,12 @@ class VFSArchiveLoader;
|
||||||
class DirView;
|
class DirView;
|
||||||
|
|
||||||
|
|
||||||
/** Root - extensible class to simplify working with the VFS tree */
|
/** Root - simplify working with the VFS tree.
|
||||||
|
|
||||||
|
Everything is reference-counted. If you store pointers to contained objects externally,
|
||||||
|
use ttvfs::CountedPtr<>.
|
||||||
|
To enumerate the file tree for debugging, use ttvfs::debug::dumpTree().
|
||||||
|
*/
|
||||||
class Root
|
class Root
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -31,28 +35,24 @@ public:
|
||||||
virtual ~Root();
|
virtual ~Root();
|
||||||
|
|
||||||
/** Reset an instance to its initial state.
|
/** Reset an instance to its initial state.
|
||||||
Drops all archives, loaders, archive loaders, mount points, internal trees, ...*/
|
Drops all subdirs, loaders, archive loaders, mount points, ...*/
|
||||||
virtual void Clear();
|
virtual void Clear();
|
||||||
|
|
||||||
/** Do cleanups from time to time. For internal classes, this is a no-op.
|
/** Do cleanups from time to time. For internal classes, this is a no-op.
|
||||||
Extensions may wish to override this method do do cleanup jobs. */
|
Extensions may wish to override this method do do cleanup jobs. */
|
||||||
virtual void ClearGarbage();
|
virtual void ClearGarbage();
|
||||||
|
|
||||||
/** Mount a directory in the tree to a different location. Requires a previous call to Prepare().
|
/** Mount a directory in the tree to a different location.
|
||||||
This can be imagined like the contents of a directory appearing in a different location.
|
This means that the contents of src will appear in dest.
|
||||||
Be careful not to create circles! */
|
Be careful not to create circles! */
|
||||||
void Mount(const char *src, const char *dest);
|
void Mount(const char *src, const char *dest);
|
||||||
|
|
||||||
/** Drops a directory from the tree. Internally, this calls Reload(false),
|
/** Like Mount(), but in reverse.
|
||||||
which is a heavy operation compared to Mount(). Be warned. */
|
Returns true if the mount point does not exist after the call,
|
||||||
|
(that is, if it was removed or it never existed in the first place),
|
||||||
|
false if src or dst do not exist. */
|
||||||
bool Unmount(const char *src, const char *dest);
|
bool Unmount(const char *src, const char *dest);
|
||||||
|
|
||||||
/** Adds a Dir object into the merged tree. If subdir is NULL (the default),
|
|
||||||
add into the subdir stored in the Dir object. The tree will be extended if target dir does not exist.
|
|
||||||
Files in the tree will be replaced if already existing.
|
|
||||||
Like with Mount(); be careful not to create cycles. */
|
|
||||||
void AddVFSDir(DirBase *dir, const char *subdir = NULL);
|
|
||||||
|
|
||||||
/** Add an archive file to the tree, which can then be addressed like a folder,
|
/** Add an archive file to the tree, which can then be addressed like a folder,
|
||||||
e.g. "path/to/example.zip/file.txt".
|
e.g. "path/to/example.zip/file.txt".
|
||||||
Returns a pointer to the actual Dir object that represents the added archive, or NULL if failed.
|
Returns a pointer to the actual Dir object that represents the added archive, or NULL if failed.
|
||||||
|
@ -60,18 +60,31 @@ public:
|
||||||
such as a password to open the file.
|
such as a password to open the file.
|
||||||
Read the comments in VFSArchiveLoader.h for an explanation how it works.
|
Read the comments in VFSArchiveLoader.h for an explanation how it works.
|
||||||
If you have no idea, leave it NULL, because it can easily cause a crash if not used carefully. */
|
If you have no idea, leave it NULL, because it can easily cause a crash if not used carefully. */
|
||||||
Dir *AddArchive(const char *arch, void *opaque = NULL);
|
|
||||||
Dir *AddArchive(File *file, const char *path = NULL, void *opaque = NULL);
|
Dir *AddArchive(File *file, const char *path = NULL, void *opaque = NULL);
|
||||||
|
|
||||||
|
/** Add an archive by file name. This is a quick convenience method using the method above. */
|
||||||
|
Dir *AddArchive(const char *arch, void *opaque = NULL);
|
||||||
|
|
||||||
/** Add a loader that can look for files on demand.
|
/** Add a loader that can look for files on demand.
|
||||||
Do not add more then once instance of a loader type. */
|
Do not add more than one instance of a loader type.
|
||||||
void AddLoader(VFSLoader *ldr, const char *path = NULL);
|
The optional path parameter is experimental, do not use it.
|
||||||
|
Returns the index of the added loader, which is required for RemoveLoader().
|
||||||
|
If the loader will not be removed, ignore the return value.*/
|
||||||
|
int AddLoader(VFSLoader *ldr, const char *path = NULL);
|
||||||
|
|
||||||
|
/** Remove a previously added loader. Use the index returned by AddLoader(). */
|
||||||
|
void RemoveLoader(int index, const char *path = NULL);
|
||||||
|
|
||||||
/** Add an archive loader that can open archives of various types.
|
/** Add an archive loader that can open archives of various types.
|
||||||
Whenever an archive file is requested to be opened by AddArchive(),
|
Whenever an archive file is requested to be opened by AddArchive(),
|
||||||
it is sent through each registered loader until one of them can recognize
|
it is sent through each registered loader until one of them recognizes
|
||||||
the format and open it. */
|
the format and can open it.
|
||||||
void AddArchiveLoader(VFSArchiveLoader *ldr);
|
Returns the index of the added loader, which is required for RemoveArchiveLoader().
|
||||||
|
If the loader will not be removed, ignore the return value.*/
|
||||||
|
int AddArchiveLoader(VFSArchiveLoader *ldr);
|
||||||
|
|
||||||
|
/** Remove a previously added archive loader. Use the index returned by AddArchiveLoader(). */
|
||||||
|
void RemoveArchiveLoader(int index);
|
||||||
|
|
||||||
/** Get a file from the merged tree. Asks loaders if the file is not in the tree.
|
/** Get a file from the merged tree. Asks loaders if the file is not in the tree.
|
||||||
If found by a loader, the file will be added to the tree. */
|
If found by a loader, the file will be added to the tree. */
|
||||||
|
@ -79,18 +92,37 @@ public:
|
||||||
|
|
||||||
/** Fills a DirView object with a list of directories that match the specified path.
|
/** Fills a DirView object with a list of directories that match the specified path.
|
||||||
This is the preferred way to enumerate directories, as it respects and collects
|
This is the preferred way to enumerate directories, as it respects and collects
|
||||||
mount points during traversal. The DirView instance can be re-used until an (un-)mounting
|
mount points during traversal. The DirView instance can be re-used until any mount or unmount
|
||||||
operation takes place. If the content of directories changes, this is reflected in the view.
|
operation takes place. If the content of a contained directory changes, this is reflected in the view.
|
||||||
(Added dirs or files will appear, removed ones disappear).
|
(Added dirs or files will appear, removed ones disappear).
|
||||||
Use DirView::forEachFile() or DirView::forEachDir() to iterate. */
|
Use DirView::forEachFile() or DirView::forEachDir() to iterate. */
|
||||||
bool FillDirView(const char *path, DirView& view);
|
bool FillDirView(const char *path, DirView& view);
|
||||||
|
|
||||||
|
/** Convenience method to iterate over all files and subdirs of a given path.
|
||||||
|
Returns true if the path exists and iteration was successful.
|
||||||
|
Both callback functions are optional, pass NULL if not interested.
|
||||||
|
user is an opaque pointer passed to the callbacks.
|
||||||
|
Set safe = true if the file tree is modified by a callback function. */
|
||||||
|
bool ForEach(const char *path, FileEnumCallback fileCallback = NULL, DirEnumCallback dirCallback = NULL, void *user = NULL, bool safe = false);
|
||||||
|
|
||||||
/** Remove a file or directory from the tree */
|
/** Remove a file or directory from the tree */
|
||||||
//bool Remove(File *vf);
|
//bool Remove(File *vf);
|
||||||
//bool Remove(Dir *dir);
|
//bool Remove(Dir *dir);
|
||||||
//bool Remove(const char *name); // TODO: CODE ME
|
//bool Remove(const char *name); // TODO: CODE ME
|
||||||
|
|
||||||
|
|
||||||
|
// --- Less common functions below ---
|
||||||
|
|
||||||
|
/** Adds a Dir object into the merged tree. If subdir is NULL (the default),
|
||||||
|
use the full path of dir. The tree will be extended if target dir does not exist.
|
||||||
|
Files in the tree will be overridden if already existing.
|
||||||
|
Like with Mount(); be careful not to create cycles. */
|
||||||
|
void AddVFSDir(DirBase *dir, const char *subdir = NULL);
|
||||||
|
|
||||||
|
/** Removes a dir from a given path previously added to via AddVFSDir().
|
||||||
|
Returns true if dir does not exist at subdir after the call. */
|
||||||
|
bool RemoveVFSDir(DirBase *dir, const char *subdir /* = NULL */);
|
||||||
|
|
||||||
/** Returns the tree root, which is usually the working directory.
|
/** Returns the tree root, which is usually the working directory.
|
||||||
Same as GetDir("").
|
Same as GetDir("").
|
||||||
You will most likely not need this function. */
|
You will most likely not need this function. */
|
||||||
|
@ -99,25 +131,31 @@ public:
|
||||||
/** Get a directory from the merged tree. If create is true and the directory does not exist,
|
/** Get a directory from the merged tree. If create is true and the directory does not exist,
|
||||||
build the tree structure and return the newly created dir. NULL otherwise.
|
build the tree structure and return the newly created dir. NULL otherwise.
|
||||||
You will most likely not need this function.
|
You will most likely not need this function.
|
||||||
Use FillDirView() on a DirView object to iterate over directory contents. */
|
Use FillDirView() on a DirView object or ForEach() to iterate over directory contents. */
|
||||||
DirBase *GetDir(const char* dn, bool create = false);
|
DirBase *GetDir(const char* dn, bool create = false);
|
||||||
|
|
||||||
// DEBUG STUFF
|
|
||||||
void debugDumpTree(std::ostream& os, const char *path, int level);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
InternalDir *_GetDirByLoader(VFSLoader *ldr, const char *fn, const char *unmangled);
|
InternalDir *_GetDirByLoader(VFSLoader *ldr, const char *fn, const char *unmangled);
|
||||||
|
|
||||||
|
class _LoaderInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
_LoaderInfo(const char *path) : isnull(path == NULL), pathstr(path ? path : "") {}
|
||||||
|
inline const char *getPath() { return isnull ? NULL : pathstr.c_str(); }
|
||||||
|
private:
|
||||||
|
bool isnull;
|
||||||
|
std::string pathstr;
|
||||||
|
};
|
||||||
|
|
||||||
typedef std::vector<CountedPtr<VFSLoader> > LoaderArray;
|
typedef std::vector<CountedPtr<VFSLoader> > LoaderArray;
|
||||||
typedef std::vector<CountedPtr<VFSArchiveLoader> > ArchiveLoaderArray;
|
typedef std::vector<CountedPtr<VFSArchiveLoader> > ArchiveLoaderArray;
|
||||||
|
typedef std::vector<_LoaderInfo> ArchiveLoaderInfoArray;
|
||||||
|
|
||||||
// If files are not in the tree, maybe one of these is able to find it.
|
LoaderArray loaders; // If files are not in the tree, maybe one of these is able to find it.
|
||||||
LoaderArray loaders;
|
|
||||||
|
|
||||||
CountedPtr<InternalDir> merged; // contains the merged virtual/actual file system tree
|
CountedPtr<InternalDir> merged; // contains the merged virtual/actual file system tree
|
||||||
|
|
||||||
ArchiveLoaderArray archLdrs;
|
ArchiveLoaderArray archLdrs;
|
||||||
|
ArchiveLoaderInfoArray loadersInfo;
|
||||||
};
|
};
|
||||||
|
|
||||||
VFS_NAMESPACE_END
|
VFS_NAMESPACE_END
|
||||||
|
|
|
@ -10,3 +10,7 @@ add_library(ttvfs_cfileapi ${cfileapi_SRC})
|
||||||
|
|
||||||
target_link_libraries(ttvfs_cfileapi ttvfs)
|
target_link_libraries(ttvfs_cfileapi ttvfs)
|
||||||
|
|
||||||
|
install(TARGETS ttvfs_cfileapi DESTINATION lib)
|
||||||
|
|
||||||
|
install(DIRECTORY ./ DESTINATION include/ttvfs
|
||||||
|
FILES_MATCHING PATTERN "*.h")
|
||||||
|
|
|
@ -16,12 +16,6 @@ void ttvfs_setroot(ttvfs::Root *root)
|
||||||
|
|
||||||
VFILE *vfopen(const char *fn, const char *mode)
|
VFILE *vfopen(const char *fn, const char *mode)
|
||||||
{
|
{
|
||||||
if (strchr(mode, 'w'))
|
|
||||||
{
|
|
||||||
assert(0 && "ttvfs_stdio: File writing via VFS not yet supported!");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
VFILE *vf = vfs->GetFile(fn);
|
VFILE *vf = vfs->GetFile(fn);
|
||||||
if (!vf || !vf->open(mode))
|
if (!vf || !vf->open(mode))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -6,13 +6,14 @@
|
||||||
// * Define VFS_ENABLE_C_API to 1 to use ttvfs overrides.
|
// * Define VFS_ENABLE_C_API to 1 to use ttvfs overrides.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This file is a minimal wrapper to replace the C API and std::ifstream.
|
This file is a poor man's wrapper to replace the C API and std::ifstream.
|
||||||
Note that if you have an advanced needs, this wrapper API is not for you.
|
Note that if you have any advanced needs, this wrapper API is not for you.
|
||||||
|
|
||||||
To use it, go through your code and rename all FILE* to VFILE*,
|
To use it, go through your code and rename all FILE* to VFILE*,
|
||||||
and fopen() and related to vfopen() (so just put a 'v' in front).
|
and fopen() and related to vfopen() (so just put a 'v' in front).
|
||||||
Instead of std::ifstream, use InStream. If you use std::fstream for reading ONLY,
|
Instead of std::ifstream, use InStream. If you use std::fstream for reading ONLY,
|
||||||
also use InStream.
|
also use InStream.
|
||||||
|
Make sure that a FILE* is not opened twice at any time - this is not supported.
|
||||||
|
|
||||||
Note that the seek and tell functions do not offer 64 bit offsets in this API.
|
Note that the seek and tell functions do not offer 64 bit offsets in this API.
|
||||||
*/
|
*/
|
||||||
|
@ -35,6 +36,8 @@ typedef ttvfs::File VFILE;
|
||||||
|
|
||||||
void ttvfs_setroot(ttvfs::Root *root);
|
void ttvfs_setroot(ttvfs::Root *root);
|
||||||
|
|
||||||
|
// Note that vfopen() returns the same pointer for the same file name,
|
||||||
|
// so effectively a file is a singleton object.
|
||||||
VFILE *vfopen(const char *fn, const char *mode);
|
VFILE *vfopen(const char *fn, const char *mode);
|
||||||
size_t vfread(void *ptr, size_t size, size_t count, VFILE *vf);
|
size_t vfread(void *ptr, size_t size, size_t count, VFILE *vf);
|
||||||
int vfclose(VFILE *vf);
|
int vfclose(VFILE *vf);
|
||||||
|
|
|
@ -10,8 +10,16 @@ set(ttvfs_zip_SRC
|
||||||
VFSZipArchiveRef.h
|
VFSZipArchiveRef.h
|
||||||
miniz.c
|
miniz.c
|
||||||
miniz.h
|
miniz.h
|
||||||
|
ttvfs_zip.h
|
||||||
)
|
)
|
||||||
|
|
||||||
include_directories(${TTVFS_INCLUDE_DIRS})
|
include_directories(${TTVFS_INCLUDE_DIRS})
|
||||||
|
|
||||||
add_library(ttvfs_zip ${ttvfs_zip_SRC})
|
add_library(ttvfs_zip ${ttvfs_zip_SRC})
|
||||||
|
|
||||||
|
install(TARGETS ttvfs_zip DESTINATION lib)
|
||||||
|
|
||||||
|
install(FILES miniz.c DESTINATION include/ttvfs)
|
||||||
|
|
||||||
|
install(DIRECTORY ./ DESTINATION include/ttvfs
|
||||||
|
FILES_MATCHING PATTERN "*.h")
|
||||||
|
|
|
@ -65,7 +65,7 @@ void ZipDir::load()
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ZipFile *vf = new ZipFile(fs.m_filename, _archiveHandle, fs.m_file_index);
|
ZipFile *vf = new ZipFile(fs.m_filename, _archiveHandle, fs.m_file_index);
|
||||||
addRecursive(vf, len);
|
_addRecursiveSkip(vf, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
_canLoad = false;
|
_canLoad = false;
|
||||||
|
|
|
@ -30,6 +30,8 @@ bool ZipFile::open(const char *mode /* = NULL */)
|
||||||
_pos = 0;
|
_pos = 0;
|
||||||
if(!mode)
|
if(!mode)
|
||||||
mode = "rb";
|
mode = "rb";
|
||||||
|
else if(strchr(mode, 'w') || strchr(mode, 'a'))
|
||||||
|
return false; // writing not yet supported
|
||||||
if(_mode != mode)
|
if(_mode != mode)
|
||||||
{
|
{
|
||||||
delete [] _buf;
|
delete [] _buf;
|
||||||
|
@ -53,7 +55,7 @@ void ZipFile::close()
|
||||||
{
|
{
|
||||||
//flush(); // TODO: write to zip file on close
|
//flush(); // TODO: write to zip file on close
|
||||||
|
|
||||||
delete []_buf;
|
delete [] _buf;
|
||||||
_buf = NULL;
|
_buf = NULL;
|
||||||
_bufSize = 0;
|
_bufSize = 0;
|
||||||
}
|
}
|
||||||
|
@ -143,16 +145,15 @@ bool ZipFile::unpack()
|
||||||
close(); // delete the buffer
|
close(); // delete the buffer
|
||||||
|
|
||||||
const vfspos sz = size(); // will reopen the file
|
const vfspos sz = size(); // will reopen the file
|
||||||
if(sz < 0)
|
if(sz == npos)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_buf = new char[sz + 1];
|
_buf = new char[size_t(sz) + 1];
|
||||||
if(!_buf)
|
if(!_buf)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(!mz_zip_reader_extract_to_mem(MZ, _fileIdx, _buf, sz, 0))
|
if(!mz_zip_reader_extract_to_mem(MZ, _fileIdx, _buf, (size_t)sz, 0))
|
||||||
{
|
{
|
||||||
//assert(0 && "ZipFile unpack: Failed mz_zip_reader_extract_to_mem");
|
|
||||||
delete [] _buf;
|
delete [] _buf;
|
||||||
_buf = NULL;
|
_buf = NULL;
|
||||||
return false; // this should not happen
|
return false; // this should not happen
|
||||||
|
|
|
@ -144,7 +144,7 @@
|
||||||
// If all macros here are defined the only functionality remaining will be CRC-32, adler-32, tinfl, and tdefl.
|
// If all macros here are defined the only functionality remaining will be CRC-32, adler-32, tinfl, and tdefl.
|
||||||
|
|
||||||
// Define MINIZ_NO_STDIO to disable all usage and any functions which rely on stdio for file I/O.
|
// Define MINIZ_NO_STDIO to disable all usage and any functions which rely on stdio for file I/O.
|
||||||
#define MINIZ_NO_STDIO
|
//#define MINIZ_NO_STDIO
|
||||||
|
|
||||||
// If MINIZ_NO_TIME is specified then the ZIP archive functions will not be able to get the current time, or
|
// If MINIZ_NO_TIME is specified then the ZIP archive functions will not be able to get the current time, or
|
||||||
// get/set file times.
|
// get/set file times.
|
||||||
|
|
6
ExternalLibs/ttvfs_zip/ttvfs_zip.h
Normal file
6
ExternalLibs/ttvfs_zip/ttvfs_zip.h
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef TTVFS_ZIP_INC_H
|
||||||
|
#define TTVFS_ZIP_INC_H
|
||||||
|
|
||||||
|
#include "VFSZipArchiveLoader.h"
|
||||||
|
|
||||||
|
#endif
|
Loading…
Add table
Add a link
Reference in a new issue