diff --git a/Aquaria/AquariaMenuItem.h b/Aquaria/AquariaMenuItem.h index c9c4ad5..161142f 100644 --- a/Aquaria/AquariaMenuItem.h +++ b/Aquaria/AquariaMenuItem.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef AQUARIAMENUITEM_H +#define AQUARIAMENUITEM_H #include "../BBGE/BitmapFont.h" #include "../BBGE/Quad.h" @@ -257,3 +258,4 @@ protected: }; */ +#endif diff --git a/Aquaria/AquariaProgressBar.h b/Aquaria/AquariaProgressBar.h index 6635c11..be0a5ad 100644 --- a/Aquaria/AquariaProgressBar.h +++ b/Aquaria/AquariaProgressBar.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef AQUARIAPROGRESSBAR_H +#define AQUARIAPROGRESSBAR_H #include "../BBGE/Quad.h" @@ -34,3 +35,4 @@ protected: float perc; }; +#endif diff --git a/Aquaria/AutoMap.h b/Aquaria/AutoMap.h index 29c154c..365c621 100644 --- a/Aquaria/AutoMap.h +++ b/Aquaria/AutoMap.h @@ -18,7 +18,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef AUTOMAP_H +#define AUTOMAP_H + #include "../BBGE/ActionMapper.h" #include "../BBGE/RenderObject.h" @@ -47,3 +49,4 @@ protected: void onRender(); }; +#endif diff --git a/Aquaria/Avatar.h b/Aquaria/Avatar.h index fbd1448..b4232f5 100644 --- a/Aquaria/Avatar.h +++ b/Aquaria/Avatar.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef AVATAR_H +#define AVATAR_H #include "../BBGE/Particles.h" #include "../BBGE/BitmapFont.h" @@ -544,6 +545,4 @@ protected: }; - - - +#endif diff --git a/Aquaria/CollideEntity.h b/Aquaria/CollideEntity.h index b2d7997..0100aae 100644 --- a/Aquaria/CollideEntity.h +++ b/Aquaria/CollideEntity.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef COLLIDEENTITY_H +#define COLLIDEENTITY_H #include "Entity.h" @@ -41,3 +42,5 @@ protected: void bounce(float ba); }; + +#endif diff --git a/Aquaria/Continuity.cpp b/Aquaria/Continuity.cpp index 8902916..8d4190c 100644 --- a/Aquaria/Continuity.cpp +++ b/Aquaria/Continuity.cpp @@ -871,10 +871,21 @@ void Continuity::loadTreasureData() { treasureData.clear(); - std::string line, gfx; + std::string line, gfx, file; int num, use; float sz; - InStream in2("data/treasures.txt"); + bool found = false; + if (dsq->mod.isActive()) + { + file = dsq->mod.getPath() + "treasures.txt"; + if(exists(file)) + found = true; + } + + if(!found) + file = "data/treasures.txt"; + + InStream in2(file.c_str()); while (std::getline(in2, line)) { std::istringstream is(line); @@ -2542,12 +2553,25 @@ void Continuity::loadFileData(int slot, TiXmlDocument &doc) void Continuity::loadFile(int slot) { dsq->user.save(); - this->reset(); - knowsSong.clear(); // Adds shield song by default, which interferes with mods that don't start with it TiXmlDocument doc; loadFileData(slot, doc); + TiXmlElement *startData = doc.FirstChildElement("StartData"); + if (startData) + { + if (startData->Attribute("mod")) + { +#ifdef AQUARIA_DEMO + exit(-1); +#else + dsq->mod.load(startData->Attribute("mod")); +#endif + } + } + + this->reset(); + int versionMajor=-1, versionMinor=-1, versionRevision=-1; TiXmlElement *xmlVersion = doc.FirstChildElement("Version"); if (xmlVersion) @@ -2786,7 +2810,6 @@ void Continuity::loadFile(int slot) e2 = e2->NextSiblingElement("StringFlag"); } - TiXmlElement *startData = doc.FirstChildElement("StartData"); if (startData) { int x = atoi(startData->Attribute("x")); @@ -2800,15 +2823,6 @@ void Continuity::loadFile(int slot) //dsq->continuity.naijaModel = startData->Attribute("naijaModel"); } - if (startData->Attribute("mod")) - { -#ifdef AQUARIA_DEMO - exit(-1); -#else - dsq->mod.load(startData->Attribute("mod")); -#endif - } - if (startData->Attribute("form")) { dsq->continuity.form = FormType(atoi(startData->Attribute("form"))); @@ -2906,10 +2920,6 @@ void Continuity::loadFile(int slot) dsq->game->sceneToLoad = startData->Attribute("scene"); //dsq->game->transitionToScene(); } - - // Possibly mod-specific data the the continuity reset didn't catch - loadSongBank(); - this->worldMap.load(); } void Continuity::setNaijaModel(std::string model) @@ -3238,6 +3248,7 @@ void Continuity::reset() worldMap.load(); ingredients.clear(); + naijaEats.clear(); foodSortType = 0; diff --git a/Aquaria/DSQ.cpp b/Aquaria/DSQ.cpp index 61a8bbf..41e31d2 100644 --- a/Aquaria/DSQ.cpp +++ b/Aquaria/DSQ.cpp @@ -300,7 +300,18 @@ void DSQ::newGame() void DSQ::loadElementEffects() { - std::ifstream inFile("data/elementeffects.txt"); + bool found = false; + std::string fn; + if (dsq->mod.isActive()) + { + fn = dsq->mod.getPath() + "elementeffects.txt"; + if(exists(fn)) + found = true; + } + if(!found) + fn = "data/elementeffects.txt"; + + InStream inFile(fn.c_str()); elementEffects.clear(); std::string line; while (std::getline(inFile, line)) @@ -983,11 +994,7 @@ This build is not yet final, and as such there are a couple things lacking. They float asp = float(user.video.resx)/float(user.video.resy); - - if (asp >= 1.0f && asp < 1.8f) - { - } - else + if(asp < 1.0f) { std::ostringstream os; os << "Aspect ratio for resolution [" << user.video.resx << ", " << user.video.resy << "] not supported."; diff --git a/Aquaria/DSQ.h b/Aquaria/DSQ.h index 1787b83..48ef1f2 100644 --- a/Aquaria/DSQ.h +++ b/Aquaria/DSQ.h @@ -177,6 +177,14 @@ enum MenuPage MENUPAGE_PETS = 3 }; +enum WorldMapRevealMethod +{ + REVEAL_UNSPECIFIED = -1, + REVEAL_DEFAULT = 0, + REVEAL_PARTIAL = 1 // Not visited areas have zero alpha (invisible) +}; + + /* class Title; class GameOver; @@ -200,7 +208,7 @@ public: StringBank(); void load(); - std::string get(int idx); + const std::string& get(int idx); protected: void _load(const std::string &file); @@ -258,15 +266,15 @@ public: void recache(); - std::string getBaseModPath(); + const std::string& getBaseModPath() const; bool isActive(); bool isDebugMenu(); bool hasWorldMap(); bool isEditorBlocked(); - std::string getPath(); - std::string getName(); + const std::string& getPath() const; + const std::string& getName() const; void shutdown(); bool isShuttingDown(); @@ -274,6 +282,8 @@ public: static bool loadModXML(TiXmlDocument *d, std::string modName); static ModType getTypeFromXML(TiXmlElement *xml); + WorldMapRevealMethod mapRevealMethod; + protected: bool shuttingDown; bool active; diff --git a/Aquaria/Entity.h b/Aquaria/Entity.h index 3f468f9..cc4d125 100644 --- a/Aquaria/Entity.h +++ b/Aquaria/Entity.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef ENTITY_H +#define ENTITY_H #include "../BBGE/AnimatedSprite.h" #include "../BBGE/StateMachine.h" @@ -606,3 +607,4 @@ private: }; +#endif diff --git a/Aquaria/FlockEntity.h b/Aquaria/FlockEntity.h index e60dfb9..aa68f69 100644 --- a/Aquaria/FlockEntity.h +++ b/Aquaria/FlockEntity.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef FLOCKENTITY_H +#define FLOCKENTITY_H #include "CollideEntity.h" @@ -67,3 +68,5 @@ protected: FlockEntity *nearestFlockMate; float nearestDistance; }; + +#endif diff --git a/Aquaria/Game.cpp b/Aquaria/Game.cpp index 03a732c..68d699b 100644 --- a/Aquaria/Game.cpp +++ b/Aquaria/Game.cpp @@ -3577,48 +3577,49 @@ void Game::createInGameMenu() group_keyConfig->addChild(kcb, PM_POINTER); int offy = -20; + +#define SB(x) dsq->continuity.stringBank.get(x) TTFText *header_action = new TTFText(&dsq->fontArialSmall); - header_action->setText("Action"); + header_action->setText(SB(2101)); header_action->position = Vector(140, 80+offy); group_keyConfig->addChild(header_action, PM_POINTER); TTFText *header_key1 = new TTFText(&dsq->fontArialSmall); - header_key1->setText("Key 1"); + header_key1->setText(SB(2102)); header_key1->position = Vector(350, 80+offy); header_key1->setAlign(ALIGN_CENTER); group_keyConfig->addChild(header_key1, PM_POINTER); TTFText *header_key2 = new TTFText(&dsq->fontArialSmall); - header_key2->setText("Key 2"); + header_key2->setText(SB(2103)); header_key2->position = Vector(475, 80+offy); header_key2->setAlign(ALIGN_CENTER); group_keyConfig->addChild(header_key2, PM_POINTER); TTFText *header_joy = new TTFText(&dsq->fontArialSmall); - header_joy->setText("Joystick"); + header_joy->setText(SB(2104)); header_joy->position = Vector(600, 80+offy); header_joy->setAlign(ALIGN_CENTER); group_keyConfig->addChild(header_joy, PM_POINTER); + addKeyConfigLine(group_keyConfig, SB(2105), "lmb", 100+offy, 0, 0, 0); + addKeyConfigLine(group_keyConfig, SB(2106), "rmb", 120+offy, 0, 0, 0); + addKeyConfigLine(group_keyConfig, SB(2107), "PrimaryAction", 140+offy); + addKeyConfigLine(group_keyConfig, SB(2108), "SecondaryAction", 160+offy); + addKeyConfigLine(group_keyConfig, SB(2109), "SwimUp", 180+offy); + addKeyConfigLine(group_keyConfig, SB(2110), "SwimDown", 200+offy); + addKeyConfigLine(group_keyConfig, SB(2111), "SwimLeft", 220+offy); + addKeyConfigLine(group_keyConfig, SB(2112), "SwimRight", 240+offy); + addKeyConfigLine(group_keyConfig, SB(2113), "Roll", 260+offy); + addKeyConfigLine(group_keyConfig, SB(2114), "Revert", 280+offy); + addKeyConfigLine(group_keyConfig, SB(2115), "WorldMap", 300+offy); + addKeyConfigLine(group_keyConfig, SB(2116), "Escape", 320+offy, 1, 0, 0); - addKeyConfigLine(group_keyConfig, "Left Mouse Equiv.", "lmb", 100+offy, 0, 0, 0); - addKeyConfigLine(group_keyConfig, "Right Mouse Equiv.", "rmb", 120+offy, 0, 0, 0); - addKeyConfigLine(group_keyConfig, "Action 1: Swim", "PrimaryAction", 140+offy); - addKeyConfigLine(group_keyConfig, "Action 2: Sing/Ability", "SecondaryAction", 160+offy); - addKeyConfigLine(group_keyConfig, "Swim Up", "SwimUp", 180+offy); - addKeyConfigLine(group_keyConfig, "Swim Down", "SwimDown", 200+offy); - addKeyConfigLine(group_keyConfig, "Swim Left", "SwimLeft", 220+offy); - addKeyConfigLine(group_keyConfig, "Swim Right", "SwimRight", 240+offy); - addKeyConfigLine(group_keyConfig, "Roll", "Roll", 260+offy); - addKeyConfigLine(group_keyConfig, "Revert", "Revert", 280+offy); - addKeyConfigLine(group_keyConfig, "WorldMap/Recipes", "WorldMap", 300+offy); - addKeyConfigLine(group_keyConfig, "Menu/Escape", "Escape", 320+offy, 1, 0, 0); - - AquariaKeyConfig* s1x = addAxesConfigLine(group_keyConfig, "Stick 1 X", "s1ax", 340+offy, 0); - AquariaKeyConfig* s1y = addAxesConfigLine(group_keyConfig, "Stick 1 Y", "s1ay", 340+offy, 130); - AquariaKeyConfig* s2x = addAxesConfigLine(group_keyConfig, "Stick 2 X", "s2ax", 340+offy, 260); - AquariaKeyConfig* s2y = addAxesConfigLine(group_keyConfig, "Stick 2 Y", "s2ay", 340+offy, 380); + AquariaKeyConfig* s1x = addAxesConfigLine(group_keyConfig, SB(2117), "s1ax", 340+offy, 0); + AquariaKeyConfig* s1y = addAxesConfigLine(group_keyConfig, SB(2118), "s1ay", 340+offy, 130); + AquariaKeyConfig* s2x = addAxesConfigLine(group_keyConfig, SB(2119), "s2ax", 340+offy, 260); + AquariaKeyConfig* s2y = addAxesConfigLine(group_keyConfig, SB(2120), "s2ay", 340+offy, 380); s1x->setDirMove(DIR_LEFT, s1x); s1x->setDirMove(DIR_RIGHT, s1y); @@ -3634,18 +3635,18 @@ void Game::createInGameMenu() offy += 20; - addKeyConfigLine(group_keyConfig, "Prev Page", "PrevPage", 340+offy); - addKeyConfigLine(group_keyConfig, "Next Page", "NextPage", 360+offy); - addKeyConfigLine(group_keyConfig, "Food Menu Cook", "CookFood", 380+offy); - addKeyConfigLine(group_keyConfig, "Food Left", "FoodLeft", 400+offy); - addKeyConfigLine(group_keyConfig, "Food Right", "FoodRight", 420+offy); - addKeyConfigLine(group_keyConfig, "Food Drop", "FoodDrop", 440+offy); + addKeyConfigLine(group_keyConfig, SB(2121), "PrevPage", 340+offy); + addKeyConfigLine(group_keyConfig, SB(2122), "NextPage", 360+offy); + addKeyConfigLine(group_keyConfig, SB(2123), "CookFood", 380+offy); + addKeyConfigLine(group_keyConfig, SB(2124), "FoodLeft", 400+offy); + addKeyConfigLine(group_keyConfig, SB(2125), "FoodRight", 420+offy); + addKeyConfigLine(group_keyConfig, SB(2126), "FoodDrop", 440+offy); - addKeyConfigLine(group_keyConfig, "Look", "Look", 460+offy); + addKeyConfigLine(group_keyConfig, SB(2127), "Look", 460+offy); - addKeyConfigLine(group_keyConfig, "Help", "ToggleHelp", 480+offy); - + addKeyConfigLine(group_keyConfig, SB(2128), "ToggleHelp", 480+offy); +#undef SB group_keyConfig->shareAlphaWithChildren = 1; group_keyConfig->followCamera = 1; @@ -4182,7 +4183,9 @@ bool Game::loadSceneXML(std::string scene) { //errorLog("Could not find [" + fn + "]"); //msg("Could not find map [" + fn + "]"); - debugLog("Could not find map [" + fn + "]"); + std::string s = "Could not find map [" + fn + "]"; + debugLog(s); + dsq->screenMessage(s); return false; } TiXmlDocument doc; @@ -5400,10 +5403,10 @@ bool Game::loadScene(std::string scene) */ } -void Game::saveScene(std::string scene) +bool Game::saveScene(std::string scene) { if (!this->saveFile) - return; + return false; std::string fn = getSceneFilename(scene); @@ -5463,7 +5466,7 @@ void Game::saveScene(std::string scene) saveFile->InsertEndChild(level); */ - std::ostringstream obs, obsBinary; + std::ostringstream obs; int i = 0; for (i = 0; i < obsRows.size(); i++) { @@ -5595,7 +5598,13 @@ void Game::saveScene(std::string scene) } */ - saveFile.SaveFile(fn); + bool result = saveFile.SaveFile(fn); + if (result) + debugLog("Successfully saved map: " + fn); + else + debugLog("Failed to save map: " + fn); + + return result; } void Game::warpToArea(WarpArea *area) @@ -6733,6 +6742,11 @@ void Game::applyState() worldMapRender = 0; + if(dsq->mod.isActive() && dsq->mod.mapRevealMethod != REVEAL_UNSPECIFIED) + WorldMapRender::setRevealMethod(dsq->mod.mapRevealMethod); + else + WorldMapRender::setRevealMethod((WorldMapRevealMethod)dsq->user.video.worldMapRevealMethod); + worldMapRender = new WorldMapRender; addRenderObject(worldMapRender, LR_WORLDMAP); // to hide minimap @@ -7719,9 +7733,9 @@ void Game::setControlHint(const std::string &h, bool left, bool right, bool midd Vector p = controlHint_mouseLeft->position + Vector(-100,0); - os.seekp(0); - os << "song/songslot-" << dsq->continuity.getSongSlotByType(songType) << '\0'; // ensure correct string termination across compilers - Quad *q = new Quad(os.str(), p); + char sbuf[32]; + sprintf(sbuf, "song/songslot-%d", dsq->continuity.getSongSlotByType(songType)); + Quad *q = new Quad(sbuf, p); q->followCamera = 1; q->scale = Vector(0.7, 0.7); q->alpha = 0; @@ -7734,9 +7748,8 @@ void Game::setControlHint(const std::string &h, bool left, bool right, bool midd { int note = song->notes[i]; - os.seekp(0); - os << "song/notebutton-" << note << '\0'; - Quad *q = new Quad(os.str(), p); + sprintf(sbuf, "song/notebutton-%d", note); + Quad *q = new Quad(sbuf, p); q->color = dsq->getNoteColor(note)*0.5f + Vector(1, 1, 1)*0.5f; q->followCamera = 1; q->scale = Vector(1.0, 1.0); @@ -9917,8 +9930,8 @@ void Game::constrainCamera() cameraOffBounds = 0; if (cameraConstrained) { - int vw2 = core->getVirtualOffX()*core->invGlobalScale; - int vh2 = core->getVirtualOffY()*core->invGlobalScale; + float vw2 = core->getVirtualOffX()*core->invGlobalScale; + float vh2 = core->getVirtualOffY()*core->invGlobalScale; if (dsq->cameraPos.x - vw2 < (cameraMin.x+1)) { @@ -9932,9 +9945,11 @@ void Game::constrainCamera() cameraOffBounds = 1; } - int scrw, scrh; - scrw = core->getVirtualWidth()*core->invGlobalScale; - scrh = 600*core->invGlobalScale; + // The camera is positioned at (0, 0) screen coordinates, which, on widescreen resolutions, + // is *not* the upper left corner. Subtract the offset to get the real position. + // HACK: One column shows through after blackness ends, adding TILE_SIZE fixes this. -- fg + float scrw = (core->getVirtualWidth()-core->getVirtualOffX()+TILE_SIZE)*core->invGlobalScale; + float scrh = 600*core->invGlobalScale; if (cameraMax.x != -1 && dsq->cameraPos.x + scrw >= cameraMax.x) { diff --git a/Aquaria/Game.h b/Aquaria/Game.h index a505640..c7789ee 100644 --- a/Aquaria/Game.h +++ b/Aquaria/Game.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef GAME_H +#define GAME_H #include "../ExternalLibs/tinyxml.h" #include "../BBGE/DebugFont.h" @@ -693,7 +694,7 @@ public: ElementTemplate *getElementTemplateByIdx(int idx); - void saveScene(std::string scene); + bool saveScene(std::string scene); typedef std::vector WarpAreas; WarpAreas warpAreas; @@ -1249,3 +1250,5 @@ bool Game::isObstructed(const TileVector &tile, int t /* = -1 */) const { return (getGrid(tile) & t); } + +#endif diff --git a/Aquaria/GridRender.cpp b/Aquaria/GridRender.cpp index f95ae1c..3ebcd41 100644 --- a/Aquaria/GridRender.cpp +++ b/Aquaria/GridRender.cpp @@ -108,6 +108,8 @@ void GridRender::onRender() startY = 0; if (endY >= MAX_GRID) endY = MAX_GRID-1; + if (startY > endY) + return; for (int x = startX; x <= endX; ++x) { const signed char *gridColumn = dsq->game->getGridColumn(x); diff --git a/Aquaria/GridRender.h b/Aquaria/GridRender.h index 4fed0e1..43e04b3 100644 --- a/Aquaria/GridRender.h +++ b/Aquaria/GridRender.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef GRIDRENDER_H +#define GRIDRENDER_H #include "../BBGE/Quad.h" @@ -85,6 +86,9 @@ public: void removeGem(GemMover *gemMover); void onToggleHelpScreen(); bool isCursorOffHud(); + + static void setRevealMethod(WorldMapRevealMethod m); + protected: Quad *addHintQuad1, *addHintQuad2; AquariaMenuItem *helpButton; @@ -150,3 +154,4 @@ protected: std::vector pts; }; +#endif diff --git a/Aquaria/Mod.cpp b/Aquaria/Mod.cpp index c715bb3..693b9f0 100644 --- a/Aquaria/Mod.cpp +++ b/Aquaria/Mod.cpp @@ -60,6 +60,7 @@ void Mod::clear() debugMenu = false; hasMap = false; blockEditor = false; + mapRevealMethod = REVEAL_UNSPECIFIED; } bool Mod::isDebugMenu() @@ -82,7 +83,7 @@ bool Mod::loadModXML(TiXmlDocument *d, std::string modName) return d->LoadFile(baseModPath + modName + ".xml"); } -std::string Mod::getBaseModPath() +const std::string& Mod::getBaseModPath() const { refreshBaseModPath(); @@ -98,6 +99,8 @@ void Mod::load(const std::string &p) name = p; path = baseModPath + p + "/"; + setLocalisationModPath(path); + setActive(true); TiXmlDocument d; @@ -135,14 +138,15 @@ void Mod::load(const std::string &p) props->Attribute("blockEditor", &t); blockEditor = t; } + if (props->Attribute("worldMapRevealMethod")) { + int t; + props->Attribute("worldMapRevealMethod", &t); + mapRevealMethod = (WorldMapRevealMethod)t; + } } } -#if defined(BBGE_BUILD_UNIX) dsq->secondaryTexturePath = path + "graphics/"; -#else - dsq->secondaryTexturePath = "./" + path + "graphics/"; -#endif dsq->sound->audioPath2 = path + "audio/"; dsq->sound->setVoicePath2(path + "audio/"); @@ -156,12 +160,12 @@ void Mod::load(const std::string &p) particleManager->loadParticleBank(dsq->particleBank1, dsq->particleBank2); } -std::string Mod::getPath() +const std::string& Mod::getPath() const { return path; } -std::string Mod::getName() +const std::string& Mod::getName() const { return name; } @@ -250,6 +254,8 @@ void Mod::setActive(bool a) { if (!active) { + mapRevealMethod = REVEAL_UNSPECIFIED; + setLocalisationModPath(""); name = path = ""; dsq->secondaryTexturePath = ""; dsq->sound->audioPath2 = ""; diff --git a/Aquaria/ModDownloader.cpp b/Aquaria/ModDownloader.cpp index edf792d..489ca89 100644 --- a/Aquaria/ModDownloader.cpp +++ b/Aquaria/ModDownloader.cpp @@ -157,7 +157,7 @@ void ModDL::GetModlist(const std::string& url, bool allowChaining, bool first) if(first) knownServers.clear(); - // Prevent recursion, self-linling, or cycle linking. + // Prevent recursion, self-linking, or cycle linking. // In theory, this allows setting up a server network // where each server links to any servers it knows, // without screwing up, but this isn't going to happen anyways. @@ -203,7 +203,7 @@ void ModDL::GetModlist(const std::string& url, bool allowChaining, bool first) { scr->globeIcon->quad->color.interpolateTo(Vector(1,1,1), 0.3f); scr->globeIcon->alpha.interpolateTo(0.5f, 0.2f, -1, true, true); - scr->dlText.setText("Retrieving online mod list..."); + scr->dlText.setText(dsq->continuity.stringBank.get(2033)); scr->dlText.alpha.stopPath(); scr->dlText.alpha.interpolateTo(1, 0.1f); } diff --git a/Aquaria/ModSelector.cpp b/Aquaria/ModSelector.cpp index 0f93970..dd03b87 100644 --- a/Aquaria/ModSelector.cpp +++ b/Aquaria/ModSelector.cpp @@ -73,20 +73,20 @@ void ModSelectorScreen::move(int ud, bool instant /* = false */) v.data->target.y += ch; v.data->timePassed = 0; - if(v.data->target.y > 150) - v.data->target.y = 150; - else if(v.data->target.y < -grid->getUsedY() / 2) - v.data->target.y = -grid->getUsedY() / 2; + if(v.data->target.y > 200) + v.data->target.y = 200; + else if(v.data->target.y < -grid->getUsedY()) + v.data->target.y = -grid->getUsedY(); } else { Vector v2 = grid->position; v2.y += ch; // scroll down == grid pos y gets negative (grid scrolls up) - if(v2.y > 150) - grid->position.interpolateTo(Vector(v2.x, 150), t); - else if(v2.y < -grid->getUsedY() / 2) - grid->position.interpolateTo(Vector(v2.x, -grid->getUsedY() / 2), t); + if(v2.y > 200) + grid->position.interpolateTo(Vector(v2.x, 200), t); + else if(v2.y < -grid->getUsedY()) + grid->position.interpolateTo(Vector(v2.x, -grid->getUsedY()), t); else grid->position.interpolateTo(v2, t, 0, false, true); } @@ -99,7 +99,7 @@ void ModSelectorScreen::onUpdate(float dt) // mouse wheel scroll if(dsq->mouse.scrollWheelChange) { - move(dsq->mouse.scrollWheelChange); + move(dsq->mouse.scrollWheelChange * 2); } if(subFadeT >= 0) @@ -369,22 +369,11 @@ static void _FadeOutAll(RenderObject *r, float t) void ModSelectorScreen::close() { - /*for(int i = 0; i < panels.size(); ++i) - if(i != currentPanel) - panels[i]->setHidden(true);*/ - const float t = 0.5f; _FadeOutAll(this, t); //panels[currentPanel]->scale.interpolateTo(Vector(0.9f, 0.9f), t); // HMM dsq->user.save(); dsq->toggleVersionLabel(true); - - // kinda hackish - /*dlText.setHidden(true); - arrowDown.glow->setHidden(true); - arrowUp.glow->setHidden(true); - subbox.setHidden(true); - subtext.setHidden(true);*/ } JuicyProgressBar::JuicyProgressBar() : Quad(), txt(&dsq->smallFont) @@ -450,7 +439,7 @@ void BasicIcon::onUpdate(float dt) dsq->modSelectorScr->move(5, true); else dsq->modSelectorScr->move(-5, true); - core->main(FRAME_TIME); // HACK: this is necessary to correctly position the mouse on the object after mofing the panel + core->main(FRAME_TIME); // HACK: this is necessary to correctly position the mouse on the object after moving the panel setFocus(true); // re-position mouse } } diff --git a/Aquaria/Network.cpp b/Aquaria/Network.cpp index cc9f71d..6dba942 100644 --- a/Aquaria/Network.cpp +++ b/Aquaria/Network.cpp @@ -147,6 +147,10 @@ static void init() os << AQUARIA_CUSTOM_BUILD_ID; #endif + const char *loc = getUsedLocale(); + if(*loc) + os << "; Locale=" << loc; + userAgent = os.str(); if(!worker) diff --git a/Aquaria/Path.h b/Aquaria/Path.h index d863d89..b3369a2 100644 --- a/Aquaria/Path.h +++ b/Aquaria/Path.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef AQ_PATH_H +#define AQ_PATH_H #include "../BBGE/Base.h" #include "../BBGE/Particles.h" @@ -149,3 +150,4 @@ public: void parseWarpNodeData(const std::string &dataString); }; +#endif diff --git a/Aquaria/PathFinding.h b/Aquaria/PathFinding.h index b44246f..fb82b42 100644 --- a/Aquaria/PathFinding.h +++ b/Aquaria/PathFinding.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef PATHFINDING_H +#define PATHFINDING_H #include "../BBGE/Base.h" //#include "Astar.h" @@ -803,7 +804,7 @@ private: // data }; - +#endif diff --git a/Aquaria/SceneEditor.cpp b/Aquaria/SceneEditor.cpp index 17d63e5..bfe068d 100644 --- a/Aquaria/SceneEditor.cpp +++ b/Aquaria/SceneEditor.cpp @@ -2593,12 +2593,15 @@ void SceneEditor::loadScene() particleManager->loadParticleBank(dsq->particleBank1, dsq->particleBank2); Shot::loadShotBank(dsq->shotBank1, dsq->shotBank2); dsq->game->loadEntityTypeList(); + dsq->loadElementEffects(); } void SceneEditor::saveScene() { - dsq->screenMessage(dsq->game->sceneName + " Saved!"); - dsq->game->saveScene(dsq->game->sceneName); + if(dsq->game->saveScene(dsq->game->sceneName)) + dsq->screenMessage(dsq->game->sceneName + " Saved!"); + else + dsq->screenMessage(dsq->game->sceneName + " FAILED to save!"); } void SceneEditor::deleteSelectedElement() @@ -3104,9 +3107,9 @@ void SceneEditor::selectEnd() for (int i = 0; i < dsq->game->elementTemplates.size(); i++) { ElementTemplate et = dsq->game->elementTemplates[i]; - if (et.idx < 1024 && et.idx > largest) + if (et.idx < 1024 && i > largest) { - largest = et.idx; + largest = i; } } curElement = largest; @@ -3482,10 +3485,12 @@ void SceneEditor::update(float dt) autoSaveTimer = 0; std::ostringstream os; os << "auto/AUTO_" << autoSaveFile << "_" << dsq->game->sceneName; - std::string m = "Map AutoSaved to " + os.str(); - dsq->game->saveScene(os.str()); - dsq->debugLog(m); - dsq->screenMessage(m); + if(dsq->game->saveScene(os.str())) + { + std::string m = "Map AutoSaved to " + os.str(); + dsq->debugLog(m); + dsq->screenMessage(m); + } autoSaveFile++; if (autoSaveFile > vars->autoSaveFiles) diff --git a/Aquaria/SchoolFish.h b/Aquaria/SchoolFish.h index 3512a54..53208c7 100644 --- a/Aquaria/SchoolFish.h +++ b/Aquaria/SchoolFish.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef SCHOOLFISH_H +#define SCHOOLFISH_H #include "FlockEntity.h" @@ -50,3 +51,4 @@ protected: }; +#endif diff --git a/Aquaria/ScriptInterface.cpp b/Aquaria/ScriptInterface.cpp index 974ffe5..303e3af 100644 --- a/Aquaria/ScriptInterface.cpp +++ b/Aquaria/ScriptInterface.cpp @@ -359,6 +359,7 @@ static void scriptError(lua_State *L, const std::string& msg) // memory location, be sure this is the case before running into undefined behavior later. // - The C++ standard allows offsetof() only on POD-types. Oh well, it probably works anyways. // If it does not compile for some reason, comment it out, hope for the best, and go ahead. +#if !(defined(__GNUC__) && __GNUC__ <= 2) void compile_time_assertions() { #define oo(cls) offsetof(cls, _objtype) @@ -377,6 +378,7 @@ void compile_time_assertions() compile_assert(oo(Path) == oo(BaseText)); #undef oo } +#endif template static void ensureType(lua_State *L, T *& ptr, ScriptObjectType ty) @@ -658,7 +660,7 @@ luaFunc(newindexWarnGlobal) { std::ostringstream os; os << "WARNING: script set global " - << lua_typename(L, -2) + << lua_typename(L, lua_type(L, -2)) << " " << varname; scriptError(L, os.str()); } @@ -700,16 +702,17 @@ static bool findFile_helper(const char *rawname, std::string &fname) return false; if (dsq->mod.isActive()) { - fname += dsq->mod.getPath(); + fname = dsq->mod.getPath(); if(fname[fname.length() - 1] != '/') fname += '/'; fname += rawname; + fname = localisePath(fname, dsq->mod.getPath()); fname = core->adjustFilenameCase(fname); if (exists(fname)) return true; } - - fname = core->adjustFilenameCase(rawname); + fname = localisePath(rawname); + fname = core->adjustFilenameCase(fname); return exists(fname); } @@ -8951,7 +8954,8 @@ void ScriptInterface::shutdown() Script *ScriptInterface::openScript(const std::string &file, bool ignoremissing /* = false */) { - std::string realFile = core->adjustFilenameCase(file); + std::string realFile = localisePathInternalModpath(file); + realFile = core->adjustFilenameCase(realFile); bool loadedScript = false; lua_getglobal(baseState, "_scriptvars"); diff --git a/Aquaria/ScriptInterface.h b/Aquaria/ScriptInterface.h index 9fdb0f8..bf23dca 100644 --- a/Aquaria/ScriptInterface.h +++ b/Aquaria/ScriptInterface.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef SCRIPTINTERFACE_H +#define SCRIPTINTERFACE_H #include "../BBGE/Base.h" @@ -101,3 +102,5 @@ protected: lua_State *baseState; }; + +#endif diff --git a/Aquaria/ScriptedEntity.h b/Aquaria/ScriptedEntity.h index ea67712..a838728 100644 --- a/Aquaria/ScriptedEntity.h +++ b/Aquaria/ScriptedEntity.h @@ -18,7 +18,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef SCRIPTEDENTITY_H +#define SCRIPTEDENTITY_H + #include "CollideEntity.h" #include "Segmented.h" #include "Hair.h" @@ -112,3 +114,5 @@ protected: void onExitState(int action); virtual void deathNotify(RenderObject *r); }; + +#endif diff --git a/Aquaria/Segmented.h b/Aquaria/Segmented.h index b1fea06..c9fb81d 100644 --- a/Aquaria/Segmented.h +++ b/Aquaria/Segmented.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef SEGMENTED_H +#define SEGMENTED_H #include "../BBGE/Quad.h" @@ -53,3 +54,4 @@ protected: void onRender(); }; +#endif diff --git a/Aquaria/Shot.h b/Aquaria/Shot.h index 9ead4a1..c94d911 100644 --- a/Aquaria/Shot.h +++ b/Aquaria/Shot.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef SHOT_H +#define SHOT_H #include "CollideEntity.h" #include "Segmented.h" @@ -192,3 +193,4 @@ protected: void onEndOfLife(); }; +#endif diff --git a/Aquaria/StatsAndAchievements.h b/Aquaria/StatsAndAchievements.h index 3fc0b7c..5087d11 100644 --- a/Aquaria/StatsAndAchievements.h +++ b/Aquaria/StatsAndAchievements.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef STATS_ACH_H +#define STATS_ACH_H #ifdef BBGE_BUILD_ACHIEVEMENTS_INTERNAL #include @@ -172,4 +173,4 @@ private: */ }; - +#endif diff --git a/Aquaria/StringBank.cpp b/Aquaria/StringBank.cpp index 7fe20d9..d1d144f 100644 --- a/Aquaria/StringBank.cpp +++ b/Aquaria/StringBank.cpp @@ -71,7 +71,7 @@ void StringBank::_load(const std::string &file) } } -std::string StringBank::get(int idx) +const std::string& StringBank::get(int idx) { return stringMap[idx]; } diff --git a/Aquaria/TileVector.h b/Aquaria/TileVector.h index b3620f0..cc25959 100644 --- a/Aquaria/TileVector.h +++ b/Aquaria/TileVector.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef TILEVECTOR_H +#define TILEVECTOR_H #include "../BBGE/Vector.h" @@ -55,3 +56,4 @@ public: int x,y; }; +#endif diff --git a/Aquaria/ToolTip.h b/Aquaria/ToolTip.h index e822c90..73095ed 100644 --- a/Aquaria/ToolTip.h +++ b/Aquaria/ToolTip.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef TOOLTIP_H +#define TOOLTIP_H #include "../BBGE/BitmapFont.h" #include "../BBGE/Quad.h" @@ -51,4 +52,4 @@ protected: Quad *back; }; - +#endif diff --git a/Aquaria/UserSettings.cpp b/Aquaria/UserSettings.cpp index f90af3c..49e19f4 100644 --- a/Aquaria/UserSettings.cpp +++ b/Aquaria/UserSettings.cpp @@ -144,6 +144,12 @@ void UserSettings::save() xml_saveSlotScreens.SetAttribute("on", video.saveSlotScreens); } xml_video.InsertEndChild(xml_saveSlotScreens); + + TiXmlElement xml_worldMap("WorldMap"); + { + xml_worldMap.SetAttribute("revealMethod", video.worldMapRevealMethod); + } + xml_video.InsertEndChild(xml_worldMap); } doc.InsertEndChild(xml_video); @@ -445,6 +451,8 @@ void UserSettings::load(bool doApply, const std::string &overrideFile) } readInt(xml_video, "SaveSlotScreens", "on", &video.saveSlotScreens); + + readInt(xml_video, "WorldMap", "revealMethod", &video.worldMapRevealMethod); } TiXmlElement *xml_control = doc.FirstChildElement("Control"); @@ -535,6 +543,18 @@ void UserSettings::load(bool doApply, const std::string &overrideFile) //clearInputCodeMap(); + if (system.locale.empty()) + { + std::string loc = getSystemLocale(); + debugLog("Using autodetected system locale: " + loc); + setUsedLocale(loc); + } + else + { + debugLog("Using user config locale: " + system.locale); + setUsedLocale(system.locale); + } + if (doApply) apply(); } @@ -574,18 +594,6 @@ void UserSettings::apply() core->settings.prebufferSounds = audio.prebuffer; - if (system.locale.empty()) - { - std::string loc = getSystemLocale(); - debugLog("Using autodetected system locale: " + loc); - setUsedLocale(loc); - } - else - { - debugLog("Using user config locale: " + system.locale); - setUsedLocale(system.locale); - } - #endif } diff --git a/Aquaria/UserSettings.h b/Aquaria/UserSettings.h index e152033..1e31763 100644 --- a/Aquaria/UserSettings.h +++ b/Aquaria/UserSettings.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef USERSETTINGS_H +#define USERSETTINGS_H #include @@ -112,6 +113,7 @@ public: vsync = 1; darkbuffersize = 256; displaylists = 0; + worldMapRevealMethod = 0; } int shader; int blur; @@ -122,6 +124,7 @@ public: int parallaxOn0, parallaxOn1, parallaxOn2; int numParticles; int displaylists; + int worldMapRevealMethod; } video; struct Control @@ -182,3 +185,5 @@ public: void save(); void apply(); }; + +#endif diff --git a/Aquaria/WaterFont.h b/Aquaria/WaterFont.h index 809063f..955603e 100644 --- a/Aquaria/WaterFont.h +++ b/Aquaria/WaterFont.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef WATERFONT_H +#define WATERFONT_H #include "../BBGE/BitmapFont.h" @@ -31,3 +32,4 @@ protected: void onUpdate(float dt); }; +#endif diff --git a/Aquaria/WaterSurfaceRender.h b/Aquaria/WaterSurfaceRender.h index ba4878d..e01f7fc 100644 --- a/Aquaria/WaterSurfaceRender.h +++ b/Aquaria/WaterSurfaceRender.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef WATERSURFACERENDER_H +#define WATERSURFACERENDER_H #include "../BBGE/Quad.h" @@ -32,4 +33,4 @@ protected: void onRender(); }; - +#endif diff --git a/Aquaria/Web.h b/Aquaria/Web.h index 7f4e9bc..78762d0 100644 --- a/Aquaria/Web.h +++ b/Aquaria/Web.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef AQ_WEB_H +#define AQ_WEB_H #include "../BBGE/Quad.h" #include "Entity.h" @@ -44,3 +45,4 @@ protected: void onRender(); }; +#endif diff --git a/Aquaria/WorldMapRender.cpp b/Aquaria/WorldMapRender.cpp index b49f2e6..e9f1b9f 100644 --- a/Aquaria/WorldMapRender.cpp +++ b/Aquaria/WorldMapRender.cpp @@ -44,11 +44,12 @@ namespace WorldMapRenderNamespace enum VisMethod { - VIS_VERTEX = 0, - VIS_WRITE = 1 + VIS_VERTEX = 0, // Uses the RenderObject tile grid (RenderObject::setSegs()) to display visited areas + VIS_WRITE = 1 // Uses render-to-texture instead }; VisMethod visMethod = VIS_VERTEX; + WorldMapRevealMethod revMethod = REVEAL_DEFAULT; std::vector tiles; @@ -61,9 +62,9 @@ namespace WorldMapRenderNamespace float xMin, yMin, xMax, yMax; float zoomMin = 0.2; - float zoomMax = 1; - const float exteriorZoomMax = 1; - const float interiorZoomMax = 1.8; + float zoomMax = 3.0; + const float exteriorZoomMax = 3.0; + const float interiorZoomMax = 3.0; bool editorActive=false; @@ -84,6 +85,23 @@ WorldMapTile *activeTile=0; const float beaconSpawnBitTime = 0.05; + +void WorldMapRender::setRevealMethod(WorldMapRevealMethod m) +{ + switch(m) + { + case REVEAL_PARTIAL: + revMethod = REVEAL_PARTIAL; + baseMapSegAlpha = 0; + break; + + default: + revMethod = REVEAL_DEFAULT; + baseMapSegAlpha = 0.4; + } +} + + class WorldMapBoundQuad : public Quad { public: @@ -277,6 +295,7 @@ public: followCamera = 1; blink = false; blinkTimer = 0; + alphaMod = 0.66; canMove = gemData->canMove; //canMove = true; //gemData->userString = "HI THERE!"; @@ -731,8 +750,6 @@ WorldMapRender::WorldMapRender() : RenderObject(), ActionMapper() q->alphaMod = 0; tile->q = q; - - setProperTileColor(tile); q->setWidthHeight(q->getWidth()*tile->scale, q->getHeight()*tile->scale); q->scale = Vector(0.25f*tile->scale2, 0.25f*tile->scale2); @@ -740,10 +757,18 @@ WorldMapRender::WorldMapRender() : RenderObject(), ActionMapper() if (tile == activeTile) activeQuad = q; - if (activeQuad == q) + if (revMethod == REVEAL_PARTIAL || activeQuad == q) { setVis(tile); } + + setProperTileColor(tile); + + if(activeQuad == q) + { + activeTile->q->color = Vector(1,1,1); + activeTile->q->alphaMod = 1; + } addChild(q, PM_POINTER); @@ -861,7 +886,13 @@ void WorldMapRender::bindInput() void WorldMapRender::destroy() { - clearVis(activeTile); + //clearVis(activeTile); + for (int i = 0; i < dsq->continuity.worldMap.getNumWorldMapTiles(); i++) + { + WorldMapTile *tile = dsq->continuity.worldMap.getWorldMapTile(i); + clearVis(tile); + } + RenderObject::destroy(); delete[] savedTexData; } @@ -973,7 +1004,8 @@ void WorldMapRender::onUpdate(float dt) { if ((activeTile != selectedTile) && selectedTile->q) { - clearVis(activeTile); + if(revMethod == REVEAL_DEFAULT) + clearVis(activeTile); activeTile = selectedTile; activeQuad = activeTile->q; @@ -1428,8 +1460,11 @@ void WorldMapRender::toggle(bool turnON) { if (activeTile != originalActiveTile) { - clearVis(activeTile); - setVis(originalActiveTile); + if(revMethod == REVEAL_DEFAULT) + { + clearVis(activeTile); + setVis(originalActiveTile); + } activeTile = originalActiveTile; activeQuad = activeTile->q; } @@ -1504,7 +1539,7 @@ void WorldMapRender::createGemHint(const std::string &gfx) doubleClickTimer = 0; GemData *g = dsq->continuity.pickupGem(gfx, false); g->canMove = 1; - g->pos = getAvatarWorldMapPosition() + Vector(0, -20); + g->pos = getAvatarWorldMapPosition();// + Vector(0, -20); g->userString = useString; addGem(g); fixGems(); diff --git a/BBGE/ActionInput.h b/BBGE/ActionInput.h index d45a9d1..a679204 100644 --- a/BBGE/ActionInput.h +++ b/BBGE/ActionInput.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef ACTIONINPUT_H +#define ACTIONINPUT_H #include #include @@ -53,3 +54,5 @@ enum InputSetType INPUTSET_MOUSE = 3, INPUTSET_OTHER = 4 }; + +#endif diff --git a/BBGE/ActionSet.h b/BBGE/ActionSet.h index 282ee03..3d9b9a4 100644 --- a/BBGE/ActionSet.h +++ b/BBGE/ActionSet.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef ACTIONSET_H +#define ACTIONSET_H #include #include @@ -47,3 +48,5 @@ public: std::string insertInputIntoString(const std::string &string); }; + +#endif diff --git a/BBGE/Base.cpp b/BBGE/Base.cpp index 29ac097..ebaa09c 100644 --- a/BBGE/Base.cpp +++ b/BBGE/Base.cpp @@ -232,7 +232,7 @@ void stringToLowerUserData(std::string &s) const size_t len = userdata.length(); const bool match = (s.length() > len) && ((s[len] == '/') || (s[len] == '\\')) && - (userdata.compare(0, len, s, 0, len) == 0); + !strncmp(userdata.c_str(), s.c_str(), len); if (!match) stringToLower(s); else diff --git a/BBGE/Base.h b/BBGE/Base.h index 345065c..586a944 100644 --- a/BBGE/Base.h +++ b/BBGE/Base.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef BBGE_BASE_H +#define BBGE_BASE_H #ifdef BBGE_BUILD_WINDOWS @@ -296,3 +297,5 @@ void openURL(const std::string &url); std::string underscoresToSpaces(const std::string &str); std::string spacesToUnderscores(const std::string &str); + +#endif diff --git a/BBGE/BitmapFont.h b/BBGE/BitmapFont.h index a8264ff..0ddfe79 100644 --- a/BBGE/BitmapFont.h +++ b/BBGE/BitmapFont.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef BITMAPFONT_H +#define BITMAPFONT_H //#include "DrawText.h" #include "RenderObject.h" @@ -101,3 +102,4 @@ protected: int textWidth; }; +#endif diff --git a/BBGE/BloomEffect.h b/BBGE/BloomEffect.h index 43d2208..19503b2 100644 --- a/BBGE/BloomEffect.h +++ b/BBGE/BloomEffect.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef BLOOMEFFECT_H +#define BLOOMEFFECT_H #include "RenderObject.h" #include "FrameBuffer.h" @@ -44,3 +45,4 @@ protected: bool useFrameBuffer; }; +#endif diff --git a/BBGE/Collision.h b/BBGE/Collision.h index 09df967..2d06fa4 100644 --- a/BBGE/Collision.h +++ b/BBGE/Collision.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef COLLISION_H +#define COLLISION_H #include "Base.h" @@ -142,3 +143,4 @@ public: }; */ +#endif diff --git a/BBGE/CommonEvents.h b/BBGE/CommonEvents.h index 6d8703f..e435ab8 100644 --- a/BBGE/CommonEvents.h +++ b/BBGE/CommonEvents.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef COMMONEVENTS_H +#define COMMONEVENTS_H #include "Event.h" @@ -46,3 +47,5 @@ public: private: std::string state; }; + +#endif diff --git a/BBGE/DarkLayer.h b/BBGE/DarkLayer.h index 3d37d52..a571ea7 100644 --- a/BBGE/DarkLayer.h +++ b/BBGE/DarkLayer.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef DARKLAYER_H +#define DARKLAYER_H #include "Base.h" #include "FrameBuffer.h" @@ -52,3 +53,4 @@ protected: GLuint format; }; +#endif diff --git a/BBGE/DebugFont.h b/BBGE/DebugFont.h index 00ec72a..d11c17f 100644 --- a/BBGE/DebugFont.h +++ b/BBGE/DebugFont.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef DEBUGFONT_H +#define DEBUGFONT_H #include "Core.h" #include "BaseText.h" @@ -66,3 +67,4 @@ public: virtual void buttonPress(DebugButton *db){} }; +#endif diff --git a/BBGE/Effects.h b/BBGE/Effects.h index 418427f..debf7d0 100644 --- a/BBGE/Effects.h +++ b/BBGE/Effects.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef EFFECTS_H +#define EFFECTS_H #include "Vector.h" #include "Base.h" @@ -57,4 +58,5 @@ protected: bool enabled[FXT_MAX]; }; +#endif diff --git a/BBGE/FileVars.h b/BBGE/FileVars.h index 24c90d3..166181d 100644 --- a/BBGE/FileVars.h +++ b/BBGE/FileVars.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef FILEVARS_H +#define FILEVARS_H #include "Base.h" @@ -34,3 +35,5 @@ protected: std::map floats; std::map ints; }; + +#endif diff --git a/BBGE/Flags.h b/BBGE/Flags.h index da0142f..5eb304b 100644 --- a/BBGE/Flags.h +++ b/BBGE/Flags.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef BBGE_FLAGS_H +#define BBGE_FLAGS_H #ifdef BBGE_BUILD_WINDOWS typedef unsigned __int32 uint32; @@ -44,3 +45,4 @@ public: uint32 flags; }; +#endif diff --git a/BBGE/FmodOpenALBridge.cpp b/BBGE/FmodOpenALBridge.cpp index 1ab51b4..6db0855 100644 --- a/BBGE/FmodOpenALBridge.cpp +++ b/BBGE/FmodOpenALBridge.cpp @@ -568,6 +568,9 @@ namespace FMOD { #define SANITY_CHECK_OPENAL_CALL() #endif +// HACK: works fairly well without it. Annoying to be thrown into the debugger because all channels are full. +#undef SANITY_CHECK_OPENAL_CALL +#define SANITY_CHECK_OPENAL_CALL() // simply nasty. #define ALBRIDGE(cls,method,params,args) \ diff --git a/BBGE/FrameBuffer.h b/BBGE/FrameBuffer.h index 67636d7..105b290 100644 --- a/BBGE/FrameBuffer.h +++ b/BBGE/FrameBuffer.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef FRAMEBUFFER_H +#define FRAMEBUFFER_H #include "Base.h" @@ -57,3 +58,4 @@ protected: bool enabled, inited; }; +#endif diff --git a/BBGE/Gradient.h b/BBGE/Gradient.h index f145e2c..8d92d5d 100644 --- a/BBGE/Gradient.h +++ b/BBGE/Gradient.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef GRADIENT_H +#define GRADIENT_H #include "RenderObject.h" @@ -37,3 +38,5 @@ protected: void onRender(); Vector ulc0, ulc1, ulc2, ulc3; }; + +#endif diff --git a/BBGE/LensFlare.h b/BBGE/LensFlare.h index 5f75718..ed88bd3 100644 --- a/BBGE/LensFlare.h +++ b/BBGE/LensFlare.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef LENSFLARE_H +#define LENSFLARE_H #include "Quad.h" @@ -34,3 +35,5 @@ protected: void onUpdate(float dt); std::vector flares; }; + +#endif diff --git a/BBGE/Localization.cpp b/BBGE/Localization.cpp index 5558e3b..4669814 100644 --- a/BBGE/Localization.cpp +++ b/BBGE/Localization.cpp @@ -26,15 +26,43 @@ static std::string _CFToStdString(CFStringRef cs) #endif static std::string s_locale; +static std::string s_modpath; void setUsedLocale(const std::string& s) { s_locale = s; } -std::string localisePath(const std::string &path, const std::string &modpath /* = "" */) +const char *getUsedLocale() { - if (s_locale.empty()) + return s_locale.c_str(); +} + +void setLocalisationModPath(const std::string& s) +{ + s_modpath = s; + stringToLower(s_modpath); +} + +// hackish +// intended to be used only for paths which are known to start with the mod path, +// but can deal with it if this is not the case +std::string localisePathInternalModpath(const std::string &path) +{ + std::string tmp = path; + stringToLower(tmp); + + if(!strncmp(tmp.c_str(), s_modpath.c_str(), s_modpath.length())) + return localisePath(path, s_modpath); + + return localisePath(path); +} + +std::string localisePath(const std::string &path, const std::string& modpath /* = "" */) +{ + if (s_locale.empty() || s_locale == "-") + return path; + if(path.length() < modpath.length()) return path; const std::string fname = path.substr(modpath.length()); @@ -110,7 +138,7 @@ std::string getSystemLocale() size_t found = localeStr.find('.'); - if (found != string::npos) + if (found != std::string::npos) localeStr.resize(found); } #endif diff --git a/BBGE/Localization.h b/BBGE/Localization.h index 0b67301..49df21f 100644 --- a/BBGE/Localization.h +++ b/BBGE/Localization.h @@ -4,7 +4,10 @@ #include "Base.h" void setUsedLocale(const std::string& s); -std::string localisePath(const std::string &path, const std::string &modpath = ""); +const char *getUsedLocale(); +void setLocalisationModPath(const std::string& s); +std::string localisePath(const std::string &path, const std::string& modpath = ""); +std::string localisePathInternalModpath(const std::string &path); std::string getSystemLocale(); #endif diff --git a/BBGE/Model.h b/BBGE/Model.h index e732210..3b78728 100644 --- a/BBGE/Model.h +++ b/BBGE/Model.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef BBGE_MODEL_H +#define BBGE_MODEL_H #include "RenderObject.h" @@ -57,3 +58,5 @@ protected: float m_lodLevel; std::string m_path; }; + +#endif diff --git a/BBGE/PointSprites.h b/BBGE/PointSprites.h index c5cf695..d80ec3b 100644 --- a/BBGE/PointSprites.h +++ b/BBGE/PointSprites.h @@ -18,7 +18,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef POINTSPRITES_H +#define POINTSPRITES_H + #include "Base.h" #ifdef BBGE_BUILD_WINDOWS @@ -34,3 +36,4 @@ public: }; #endif +#endif diff --git a/BBGE/Precacher.h b/BBGE/Precacher.h index 92f032c..87e9a05 100644 --- a/BBGE/Precacher.h +++ b/BBGE/Precacher.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef PRECACHER_H +#define PRECACHER_H #include "Quad.h" @@ -37,3 +38,5 @@ private: bool cleaned; void (*loadProgressCallback)(); }; + +#endif diff --git a/BBGE/QuadTrail.h b/BBGE/QuadTrail.h index 5051e47..9f21c6b 100644 --- a/BBGE/QuadTrail.h +++ b/BBGE/QuadTrail.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef QUADTRAIL_H +#define QUADTRAIL_H #include "RenderObject.h" @@ -60,3 +61,5 @@ protected: void onRender(); void onUpdate(float dt); }; + +#endif diff --git a/BBGE/Rect.h b/BBGE/Rect.h index efd1f58..8b3b67b 100644 --- a/BBGE/Rect.h +++ b/BBGE/Rect.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef BBGE_RECT_H +#define BBGE_RECT_H #include "Vector.h" @@ -70,3 +71,5 @@ public: } int x1, y1, x2, y2; }; + +#endif diff --git a/BBGE/RenderObjectLayer.cpp b/BBGE/RenderObjectLayer.cpp index 6e37049..cd63ae8 100644 --- a/BBGE/RenderObjectLayer.cpp +++ b/BBGE/RenderObjectLayer.cpp @@ -314,7 +314,8 @@ void RenderObjectLayer::moveToBack(RenderObject *r) for (int i = newSize - 1; i >= sizeDiff; i--) { renderObjects[i] = renderObjects[i - sizeDiff]; - renderObjects[i]->setIdx(i); // Known to be non-NULL. + if(renderObjects[i]) + renderObjects[i]->setIdx(i); } for (int i = 0; i < newIdx; i++) renderObjects[i] = 0; diff --git a/BBGE/RenderObject_inline.h b/BBGE/RenderObject_inline.h index f4b6916..2e7af29 100644 --- a/BBGE/RenderObject_inline.h +++ b/BBGE/RenderObject_inline.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef RENDEROBJECT_INLINE_H +#define RENDEROBJECT_INLINE_H inline bool RenderObject::isOnScreen() { @@ -70,3 +71,5 @@ Vector RenderObject::getFollowCameraPosition() const return pos; } } + +#endif diff --git a/BBGE/RoundedRect.h b/BBGE/RoundedRect.h index c494a6c..5a4309b 100644 --- a/BBGE/RoundedRect.h +++ b/BBGE/RoundedRect.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef ROUNDEDRECT_H +#define ROUNDEDRECT_H #include "RenderObject.h" #include "Event.h" @@ -67,3 +68,5 @@ protected: bool mbd; bool noNested; }; + +#endif diff --git a/BBGE/ScreenTransition.h b/BBGE/ScreenTransition.h index 23e3087..c4adc14 100644 --- a/BBGE/ScreenTransition.h +++ b/BBGE/ScreenTransition.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef SCREENTRANSITION_H +#define SCREENTRANSITION_H #include "RenderObject.h" @@ -46,3 +47,4 @@ protected: #endif }; +#endif diff --git a/BBGE/ScriptObject.h b/BBGE/ScriptObject.h index 7847501..08cd693 100644 --- a/BBGE/ScriptObject.h +++ b/BBGE/ScriptObject.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef SCRIPTOBJECT_H +#define SCRIPTOBJECT_H enum ScriptObjectType { @@ -79,3 +80,5 @@ public: // public to allow the static compile check in ScriptInterface.cpp to work ScriptObjectType _objtype; }; + +#endif diff --git a/BBGE/Shader.h b/BBGE/Shader.h index d3cd105..1eb4cd9 100644 --- a/BBGE/Shader.h +++ b/BBGE/Shader.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef BBGE_SHADER_H +#define BBGE_SHADER_H #include "Base.h" @@ -52,3 +53,5 @@ protected: static bool _wasInited; static bool _useShaders; }; + +#endif diff --git a/BBGE/SimpleIStringStream.h b/BBGE/SimpleIStringStream.h index f323c04..25aa210 100644 --- a/BBGE/SimpleIStringStream.h +++ b/BBGE/SimpleIStringStream.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef SIMPLEISTRINGSTREAM_H +#define SIMPLEISTRINGSTREAM_H /* * This class implements a lightweight version of the std::istringstream @@ -730,6 +731,8 @@ inline SimpleIStringStream &SimpleIStringStream::operator>>(std::string &target) #undef VERIFY_SETUP #undef VERIFY +#endif // SIMPLEISTRINGSTREAM_H + /*************************************************************************/ /*************************************************************************/ diff --git a/BBGE/SkeletalSprite.h b/BBGE/SkeletalSprite.h index 6d2165f..518f687 100644 --- a/BBGE/SkeletalSprite.h +++ b/BBGE/SkeletalSprite.h @@ -18,7 +18,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef SKELETALSPRITE_H +#define SKELETALSPRITE_H + #include "Quad.h" #include "SimpleIStringStream.h" // for 2d system only @@ -273,4 +275,4 @@ protected: void onUpdate(float dt); }; - +#endif diff --git a/BBGE/SoundManager.cpp b/BBGE/SoundManager.cpp index e35c419..4dfa57c 100644 --- a/BBGE/SoundManager.cpp +++ b/BBGE/SoundManager.cpp @@ -90,6 +90,7 @@ namespace SoundCore bool stopMusicOnFadeOut=false; bool wasPlayingVoice=false; + bool playingMusicOnce=false; typedef std::list FadeChs; FadeChs fadeChs; @@ -466,7 +467,7 @@ void SoundManager::toggleEffectMusic(SoundEffectType effect, bool on) std::string SoundManager::getVolumeString() { std::ostringstream os; - os << "sfxFader: " << this->sfxFader << " sfxVol: " << this->sfxVol << std::endl; + os << "sfxFader: " << this->sfxFader << " sfxVol: " << this->sfxVol << " [" << lastMusic << "]" << std::endl; os << "musVol: " << musVol.y << " voxVol: " << voxVol.y << std::endl; float musicChannelVol = -1; @@ -657,21 +658,17 @@ void SoundManager::update(float dt) if (musicChannel) { - bool _isplaying = false; - result = musicChannel->isPlaying(&_isplaying); - checkError(); - if (!_isplaying) + if (!isPlayingMusic()) { - result = musicChannel->stop(); - checkError(); - musicChannel = 0; - - if (musicStream) + if(!playingMusicOnce && lastMusic.size()) { - result = musicStream->release(); - checkError(); - musicStream = 0; - } + debugLog("music not playing, but it should be - force restart"); + playMusic(lastMusic, SLT_LOOP, SFT_IN, 1, SCT_NORMAL); // FIXME: make sure this works with playMusicOnce() + } + else + { + stopMusic(); + } } } @@ -685,17 +682,7 @@ void SoundManager::update(float dt) if (musVol.y <= 0 && stopMusicOnFadeOut) { - result = musicChannel->stop(); - checkError(); - musicChannel = 0; - - if (musicStream) - { - result = musicStream->release(); - checkError(); - musicStream = 0; - } - + stopMusic(); stopMusicOnFadeOut = false; } } @@ -791,7 +778,6 @@ void SoundManager::fadeMusic(SoundFadeType sft, float t) case SFT_CROSS: { #ifdef BBGE_BUILD_FMODEX - if (musicChannel2) { musicChannel2->stop(); @@ -926,13 +912,17 @@ bool SoundManager::playVoice(const std::string &name, SoundVoiceType svt, float if (!voicePath2.empty()) { - fn = core->adjustFilenameCase(voicePath2 + name + fileType); + fn = voicePath2 + name + fileType; + fn = localisePathInternalModpath(fn); + fn = core->adjustFilenameCase(fn); if (exists(fn)) checkOther = false; } if (checkOther) { - fn = core->adjustFilenameCase(voicePath + name + fileType); + fn = voicePath + name + fileType; + fn = localisePath(fn); + fn = core->adjustFilenameCase(fn); if (!exists(fn)) { debugLog("Could not find voice file [" + fn + "]"); @@ -1338,9 +1328,11 @@ bool SoundManager::playMusic(const std::string &name, SoundLoopType slt, SoundFa case SLT_OFF: case SLT_NONE: mode |= FMOD_LOOP_OFF; + playingMusicOnce = true; break; default: mode |= FMOD_LOOP_NORMAL; + playingMusicOnce = false; break; } @@ -1384,18 +1376,20 @@ bool SoundManager::playMusic(const std::string &name, SoundLoopType slt, SoundFa result = musicChannel->setPaused(false); // This is where the sound really starts. checkError(); + debugLog("music play: " + fn); + } + else + { + debugLog("Failed to create music stream: " + fn); } #endif - debugLog("playmusic end"); - return true; } void SoundManager::stopMusic() { - #ifdef BBGE_BUILD_FMODEX if (musicChannel) { @@ -1410,7 +1404,7 @@ void SoundManager::stopMusic() musicChannel = 0; } #endif - + playingMusicOnce = false; lastMusic = ""; } @@ -1514,27 +1508,32 @@ Buffer SoundManager::loadSoundIntoBank(const std::string &filename, const std::s std::string f = filename, name; + // HACK: proper sound looping + bool loop = false; + stringToLower(f); + if (f.find("loop")!=std::string::npos) + loop = true; + // WARNING: local sounds should go here! debugLog(filename); if (slt == SFXLOAD_LOCAL && !audioPath2.empty()) { - f = core->adjustFilenameCase(audioPath2 + filename + format); + f = audioPath2 + filename + format; + f = localisePathInternalModpath(f); + f = core->adjustFilenameCase(f); if (!exists(f)) { - f = core->adjustFilenameCase(path + filename + format); + f = path + filename + format; + f = localisePath(f); + f = core->adjustFilenameCase(f); } } else { - f = core->adjustFilenameCase(path + filename + format); - } - - bool loop = false; - - if (f.find("loop")!=std::string::npos) - { - loop = true; + f = path + filename + format; + f = localisePath(f); + f = core->adjustFilenameCase(f); } int loc = f.find_last_of('/'); @@ -1545,7 +1544,7 @@ Buffer SoundManager::loadSoundIntoBank(const std::string &filename, const std::s } else { - debugLog("returning 0"); + debugLog("returning 0"); return Buffer(); } diff --git a/BBGE/SoundManager.h b/BBGE/SoundManager.h index 00da847..eb9646f 100644 --- a/BBGE/SoundManager.h +++ b/BBGE/SoundManager.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef SOUNDMANAGER_H +#define SOUNDMANAGER_H #include #include @@ -212,8 +213,6 @@ public: void update(float dt); - std::string currentMusic; - bool enabled; bool checkError(); @@ -250,3 +249,5 @@ private: }; extern SoundManager *sound; + +#endif diff --git a/BBGE/Strings.cpp b/BBGE/Strings.cpp index 2c27bfe..6b1a398 100644 --- a/BBGE/Strings.cpp +++ b/BBGE/Strings.cpp @@ -138,6 +138,8 @@ std::string getInputCodeToString(int key) return ""; } +// FIXME: Move stringbank to BBGE and move these strings into it. -- fg + std::string getInputCodeToUserString(int key) { for (InputCodeMap::iterator i = inputCodeMap.begin(); i != inputCodeMap.end(); i++) diff --git a/BBGE/TTFFont.h b/BBGE/TTFFont.h index c2fef01..48c1791 100644 --- a/BBGE/TTFFont.h +++ b/BBGE/TTFFont.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef BBGE_TTFFONT_H +#define BBGE_TTFFONT_H #include "Base.h" #include "RenderObject.h" @@ -69,3 +70,5 @@ protected: TTFFont *font; int hw,h; }; + +#endif diff --git a/BBGE/Texture.cpp b/BBGE/Texture.cpp index bb74f46..a15e69c 100644 --- a/BBGE/Texture.cpp +++ b/BBGE/Texture.cpp @@ -281,6 +281,9 @@ void Texture::load(std::string file) return; } + stringToLowerUserData(file); + file = core->adjustFilenameCase(file); + loadName = file; repeating = false; @@ -315,7 +318,8 @@ void Texture::load(std::string file) if (found) { - file = localisePath(file); + file = localisePathInternalModpath(file); + file = core->adjustFilenameCase(file); /* std::ostringstream os; @@ -606,7 +610,7 @@ ImageTGA *Texture::TGAloadMem(void *mem, int size) // Read the width, height and bits per pixel (16, 24 or 32) bb >> width >> height >> bits; - + /* std::ostringstream os; os << "TGALoad: width: " << width << " height: " << height << " bits: " << bits; diff --git a/BBGE/Vector.h b/BBGE/Vector.h index b3be3ed..9cb705b 100644 --- a/BBGE/Vector.h +++ b/BBGE/Vector.h @@ -18,7 +18,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#pragma once +#ifndef BBGE_VECTOR_H +#define BBGE_VECTOR_H #include #include @@ -64,13 +65,13 @@ public: } // vecector equality - const bool operator==(const Vector &vec) const + bool operator==(const Vector &vec) const { return ((x == vec.x) && (y == vec.y) && (z == vec.z)); } // vecector inequality - const bool operator!=(const Vector &vec) const + bool operator!=(const Vector &vec) const { return !(*this == vec); } @@ -106,10 +107,6 @@ public: { return Vector(-x, -y, -z); } - bool isZero() - { - return x == 0 && y == 0 && z == 0; - } // vector decrement const Vector &operator-=(const Vector& vec) @@ -201,12 +198,12 @@ public: return Vector(y*vec.z - z*vec.y, z*vec.x - x*vec.z, x*vec.y - y*vec.x); } - Vector inline getPerpendicularLeft() + inline Vector getPerpendicularLeft() { return Vector(-y, x); } - Vector inline getPerpendicularRight() + inline Vector getPerpendicularRight() { return Vector(y, -x); } @@ -218,41 +215,41 @@ public: } // dot product - const scalar_t inline dot(const Vector &vec) const + inline scalar_t dot(const Vector &vec) const { return x*vec.x + y*vec.y + z*vec.z; } - const scalar_t inline dot2D(const Vector &vec) const + inline scalar_t dot2D(const Vector &vec) const { return x*vec.x + y*vec.y; } // dot product - const scalar_t operator%(const Vector &vec) const + scalar_t operator%(const Vector &vec) const { return x*vec.x + y*vec.x + z*vec.z; } // length of vector - const scalar_t inline getLength3D() const + inline scalar_t getLength3D() const { return (scalar_t)sqrtf(x*x + y*y + z*z); } - const scalar_t inline getLength2D() const + inline scalar_t getLength2D() const { return (scalar_t)sqrtf(x*x + y*y); } // return the unit vector - const Vector inline unitVector3D() const + inline const Vector unitVector3D() const { return (*this) * (1/getLength3D()); } // normalize this vector - void inline normalize3D() + inline void normalize3D() { if (x == 0 && y == 0 && z == 0) { @@ -264,7 +261,7 @@ public: (*this) *= 1/getLength3D(); } } - void inline normalize2D() + inline void normalize2D() { if (x == 0 && y == 0) { @@ -277,7 +274,7 @@ public: } } - const scalar_t operator!() const + scalar_t operator!() const { return sqrtf(x*x + y*y + z*z); } @@ -297,7 +294,7 @@ public: } */ - void inline setLength3D(const float l) + inline void setLength3D(const float l) { // IGNORE !! if (l == 0) @@ -312,7 +309,7 @@ public: this->z *= (l/len); } } - void inline setLength2D(const float l) + inline void setLength2D(const float l) { float len = getLength2D(); if (len == 0) @@ -328,24 +325,24 @@ public: } // return angle between two vectors - const float inline Angle(const Vector& normal) const + inline scalar_t Angle(const Vector& normal) const { return acosf(*this % normal); } /* - const scalar_t inline cheatLen() const + inline scalar_t cheatLen() const { return (x*x + y*y + z*z); } - const scalar_t inline cheatLen2D() const + inline scalar_t cheatLen2D() const { return (x*x + y*y); } - const scalar_t inline getCheatLength3D() const; + inline scalar_t getCheatLength3D() const; */ - const bool inline isLength2DIn(float radius) const + inline bool isLength2DIn(float radius) const { return (x*x + y*y) <= (radius*radius); } @@ -359,20 +356,20 @@ public: } */ - const void inline setZero() + inline void setZero() { this->x = this->y = this->z = 0; } - const float inline getSquaredLength2D() const + inline scalar_t getSquaredLength2D() const { return (x*x) + (y*y); } - const bool inline isZero() const + inline bool isZero() const { return x==0 && y==0 && z==0; } - const bool inline isNan() const + inline bool isNan() const { #ifdef BBGE_BUILD_WINDOWS return _isnan(x) || _isnan(y) || _isnan(z); @@ -383,11 +380,11 @@ public: #endif } - void inline capLength2D(const float l) + inline void capLength2D(const float l) { if (!isLength2DIn(l)) setLength2D(l); } - void inline capRotZ360() + inline void capRotZ360() { while (z > 360) z -= 360; @@ -573,3 +570,5 @@ public: Vector getRotatedVector(const Vector &vec, float rot); Vector lerp(const Vector &v1, const Vector &v2, float dt, int lerpType); + +#endif // BBGE_VECTOR_H diff --git a/CMakeLists.txt b/CMakeLists.txt index aba0839..204c987 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,10 @@ IF(APPLE) SET(MACOSX TRUE) ENDIF(APPLE) +IF(CMAKE_SYSTEM_NAME STREQUAL "Haiku") + SET(HAIKU TRUE) +ENDIF() + OPTION(AQUARIA_DEVELOPER_BUILD "Developer Build?" FALSE) OPTION(AQUARIA_DEMO_BUILD "Demo Build?" FALSE) OPTION(AQUARIA_USE_VFS "Use Virtual File System? Required for some additional features." TRUE) @@ -30,7 +34,7 @@ SET(FREETYPE2SRCDIR ${FREETYPE2DIR}/src) SET(LUADIR ${EXTLIBDIR}/lua-5.1.4) SET(LUASRCDIR ${LUADIR}/src) SET(LIBOGGDIR ${EXTLIBDIR}/libogg-1.3.0) -SET(LIBVORBISDIR ${EXTLIBDIR}/libvorbis-1.3.2) +SET(LIBVORBISDIR ${EXTLIBDIR}/libvorbis-1.3.3) SET(ZLIBDIR ${EXTLIBDIR}/glpng/zlib) SET(PNGDIR ${EXTLIBDIR}/glpng/png) @@ -258,9 +262,9 @@ ENDIF(WIN32) # Build Lua with Unix _setjmp/_longjmp support. -IF(UNIX) +IF(UNIX AND NOT HAIKU) ADD_DEFINITIONS(-DLUA_USE_ULONGJMP=1) -ENDIF(UNIX) +ENDIF() IF(CMAKE_COMPILER_IS_GNUCC) ADD_DEFINITIONS(-pipe -fsigned-char) @@ -627,6 +631,10 @@ IF(MACOSX) SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "-framework OpenAL") ENDIF(MACOSX) +IF(HAIKU) + SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "network") +ENDIF() + SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} ${SDL_LIBRARY}) SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} ${OPENAL_LIBRARY}) diff --git a/ExternalLibs/ByteBuffer.h b/ExternalLibs/ByteBuffer.h index 377eede..7e172d2 100644 --- a/ExternalLibs/ByteBuffer.h +++ b/ExternalLibs/ByteBuffer.h @@ -5,6 +5,12 @@ #include // for memcpy #include #include +#include + +#if defined(__GNUC__) && __GNUC__ <= 2 +# define BB_OLD_GNUC +#endif + // ** compatibility stuff for BBGE .... ** @@ -26,7 +32,7 @@ namespace ByteBufferTools { - template inline void convert(char *val) + template inline void convert(char *val) { std::swap(*val, *(val + T - 1)); convert(val + 1); @@ -39,12 +45,21 @@ namespace ByteBufferTools convert((char *)(val)); } + inline void EndianConvertRT(char *p, unsigned int size) + { + std::reverse(p, p + size); + } + #if BB_IS_BIG_ENDIAN template inline void ToLittleEndian(T& val) { EndianConvert(&val); } + inline void ToLittleEndianRT(void *p, unsigned int size) { EndianConvertRT((char*)p, size); } template inline void ToBigEndian(T&) { } + inline void ToBigEndianRT(void *p, unsigned int size) { } #else template inline void ToLittleEndian(T&) { } + inline void ToLittleEndianRT(void *p, unsigned int size) { } template inline void ToBigEndian(T& val) { EndianConvert(&val); } + inline void ToBigEndianRT(void *p, unsigned int size) { EndianConvertRT((char*)p, size); } #endif template void ToLittleEndian(T*); // will generate link error @@ -52,8 +67,13 @@ namespace ByteBufferTools }; -#define BB_MAKE_WRITE_OP(T) inline ByteBuffer& operator<<(T val) { append(val); return *this; } -#define BB_MAKE_READ_OP(T) inline ByteBuffer& operator>>(T &val) { val = read(); return *this; } +#ifdef BB_OLD_GNUC +# define BB_MAKE_WRITE_OP(T) inline ByteBuffer& operator<<(T val) { appendT(&val, sizeof(T)); return *this; } +# define BB_MAKE_READ_OP(T) inline ByteBuffer& operator>>(T &val) { readT(&val, sizeof(T)); return *this; } +#else +# define BB_MAKE_WRITE_OP(T) inline ByteBuffer& operator<<(T val) { append(val); return *this; } +# define BB_MAKE_READ_OP(T) inline ByteBuffer& operator>>(T &val) { val = read(); return *this; } +#endif class ByteBuffer { @@ -241,23 +261,17 @@ public: BB_MAKE_WRITE_OP(float); BB_MAKE_WRITE_OP(double); - ByteBuffer &operator<<(bool value) - { - append((char)value); - return *this; - } - ByteBuffer &operator<<(const char *str) { append((uint8 *)str, str ? strlen(str) : 0); - append((uint8)0); + appendByte(0); return *this; } ByteBuffer &operator<<(const std::string &value) { append((uint8 *)value.c_str(), value.length()); - append((uint8)0); + appendByte(0); return *this; } @@ -271,22 +285,18 @@ public: BB_MAKE_READ_OP(float); BB_MAKE_READ_OP(double); - ByteBuffer &operator>>(bool &value) + inline uint8 operator[](uint32 pos) const { - value = read() > 0 ? true : false; - return *this; - } - - uint8 operator[](uint32 pos) - { - return read(pos); + if(pos >= size()) + BYTEBUFFER_EXCEPT(this, "operator[]", 1); + return _buf[pos]; } ByteBuffer &operator>>(std::string& value) { value.clear(); char c; - while(readable() && (c = read())) + while(readable() && (c = readByte())) value += c; return *this; } @@ -313,6 +323,7 @@ public: _rpos += sizeof(T); return r; } + template T read(uint32 pos) const { if(pos + sizeof(T) > size()) @@ -322,6 +333,20 @@ public: return val; } + inline uint8 readByte() + { + if (_rpos < size()) + return _buf[_rpos++]; + BYTEBUFFER_EXCEPT(this, "readByte", 1); + return 0; + } + + void readT(void *dest, uint32 len) + { + read(dest, len); + ByteBufferTools::ToLittleEndianRT(dest, len); + } + void read(void *dest, uint32 len) { if (_rpos + len <= size()) @@ -352,7 +377,7 @@ public: inline uint32 readable(void) const { return size() - rpos(); } inline uint32 writable(void) const { return size() - wpos(); } // free space left before realloc will occur - template void append(T value) + template inline void append(T value) { ByteBufferTools::ToLittleEndian(value); _enlargeIfReq(_wpos + sizeof(T)); @@ -362,6 +387,21 @@ public: _size = _wpos; } + inline void appendByte(uint8 value) + { + _enlargeIfReq(_wpos + 1); + _buf[_wpos++] = value; + if(_size < _wpos) + _size = _wpos; + } + + // GCC 2.95 fails with an internal error in the template function above + void appendT(const void *src, uint32 bytes) + { + append(src, bytes); + ByteBufferTools::ToLittleEndianRT(_buf + (_wpos - bytes), bytes); + } + void append(const void *src, uint32 bytes) { if (!bytes) return; @@ -382,7 +422,7 @@ public: memcpy(_buf + pos, src, bytes); } - template void put(uint32 pos, T value) + template void put(uint32 pos, const T& value) { if(pos >= size()) BYTEBUFFER_EXCEPT(this, "put", sizeof(T)); diff --git a/ExternalLibs/FileAPI.cpp b/ExternalLibs/FileAPI.cpp index 6e8ae82..02b0378 100644 --- a/ExternalLibs/FileAPI.cpp +++ b/ExternalLibs/FileAPI.cpp @@ -118,7 +118,7 @@ bool InStream::open(const char *fn) vf->dropBuf(true); return true; } - setstate(std::ios_base::failbit); + setstate(std::ios::failbit); return false; } diff --git a/ExternalLibs/glfont2/glfont2.cpp b/ExternalLibs/glfont2/glfont2.cpp index 56b5abe..7cff0ff 100644 --- a/ExternalLibs/glfont2/glfont2.cpp +++ b/ExternalLibs/glfont2/glfont2.cpp @@ -195,7 +195,7 @@ int GLFont::GetEndChar (void) return header.end_char; } //******************************************************************* -void GLFont::GetCharSize (unsigned int c, std::pair *size) +void GLFont::GetCharSize (unsigned char c, std::pair *size) { //Make sure character is in range if (c < header.start_char || c > header.end_char) @@ -216,7 +216,7 @@ void GLFont::GetCharSize (unsigned int c, std::pair *size) } } //******************************************************************* -int GLFont::GetCharWidth (unsigned int c) +int GLFont::GetCharWidth (unsigned char c) { //Make sure in range if (c < header.start_char || c > header.end_char) @@ -240,7 +240,7 @@ int GLFont::GetCharWidth (unsigned int c) } } //******************************************************************* -int GLFont::GetCharHeight (unsigned int c) +int GLFont::GetCharHeight (unsigned char c) { //Make sure in range if (c < header.start_char || c > header.end_char) @@ -266,7 +266,7 @@ void GLFont::Begin (void) void GLFont::GetStringSize (const std::string &text, std::pair *size) { unsigned int i; - unsigned char c; + unsigned int c; GLFontChar *glfont_char; float width; diff --git a/ExternalLibs/glfont2/glfont2.h b/ExternalLibs/glfont2/glfont2.h index b2dc491..235869b 100644 --- a/ExternalLibs/glfont2/glfont2.h +++ b/ExternalLibs/glfont2/glfont2.h @@ -70,9 +70,9 @@ public: int GetEndChar (void); //Character size retrieval methods - void GetCharSize (unsigned int c, std::pair *size); - int GetCharWidth (unsigned int c); - int GetCharHeight (unsigned int c); + void GetCharSize (unsigned char c, std::pair *size); + int GetCharWidth (unsigned char c); + int GetCharHeight (unsigned char c); void GetStringSize (const std::string &text, std::pair *size); @@ -86,21 +86,20 @@ public: float y, const float *top_color, const float *bottom_color, float alpha, float lastAlpha) { unsigned int i; - T c; GLFontChar *glfont_char; float width, height; //Begin rendering quads glBegin(GL_QUADS); - int sz = text.size(); + unsigned int sz = text.size(); float a = 0; //Loop through characters for (i = 0; i < sz; i++) { //Make sure character is in range - c = text[i]; + unsigned int c = (unsigned char)text[i]; if (c < header.start_char || c > header.end_char) continue; diff --git a/ExternalLibs/glpng/png/png.c b/ExternalLibs/glpng/png/png.c index b8cfca7..4a17bda 100644 --- a/ExternalLibs/glpng/png/png.c +++ b/ExternalLibs/glpng/png/png.c @@ -1,8 +1,8 @@ /* png.c - location for general purpose libpng functions * - * Last changed in libpng 1.5.7 [December 15, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.5.11 [June 14, 2012] + * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -14,7 +14,7 @@ #include "pngpriv.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_5_7 Your_png_h_is_not_version_1_5_7; +typedef png_libpng_version_1_5_12 Your_png_h_is_not_version_1_5_12; /* Tells libpng that we have already handled the first "num_bytes" bytes * of the PNG file signature. If the PNG data is embedded into another @@ -655,14 +655,14 @@ png_get_copyright(png_const_structp png_ptr) #else # ifdef __STDC__ return PNG_STRING_NEWLINE \ - "libpng version 1.5.7 - December 15, 2011" PNG_STRING_NEWLINE \ - "Copyright (c) 1998-2011 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ + "libpng version 1.5.12 - July 11, 2012" PNG_STRING_NEWLINE \ + "Copyright (c) 1998-2012 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ PNG_STRING_NEWLINE; # else - return "libpng version 1.5.7 - December 15, 2011\ - Copyright (c) 1998-2011 Glenn Randers-Pehrson\ + return "libpng version 1.5.12 - July 11, 2012\ + Copyright (c) 1998-2012 Glenn Randers-Pehrson\ Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; # endif @@ -969,8 +969,8 @@ int png_XYZ_from_xy(png_XYZ *XYZ, png_xy xy) * and it is certain that it becomes unstable where the end points are close * together. * - * So this code uses the perhaps slighly less optimal but more understandable - * and totally obvious approach of calculating color-scale. + * So this code uses the perhaps slightly less optimal but more + * understandable and totally obvious approach of calculating color-scale. * * This algorithm depends on the precision in white-scale and that is * (1/white-y), so we can immediately see that as white-y approaches 0 the @@ -1467,7 +1467,7 @@ static double png_pow10(int power) { int recip = 0; - double d = 1; + double d = 1.0; /* Handle negative exponent with a reciprocal at the end because * 10 is exact whereas .1 is inexact in base 2 @@ -1481,7 +1481,7 @@ png_pow10(int power) if (power > 0) { /* Decompose power bitwise. */ - double mult = 10; + double mult = 10.0; do { if (power & 1) d *= mult; @@ -1600,7 +1600,8 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size, { double d; - fp *= 10; + fp *= 10.0; + /* Use modf here, not floor and subtract, so that * the separation is done in one step. At the end * of the loop don't break the number into parts so @@ -1613,7 +1614,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size, { d = floor(fp + .5); - if (d > 9) + if (d > 9.0) { /* Rounding up to 10, handle that here. */ if (czero > 0) @@ -1621,9 +1622,10 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size, --czero, d = 1; if (cdigits == 0) --clead; } + else { - while (cdigits > 0 && d > 9) + while (cdigits > 0 && d > 9.0) { int ch = *--ascii; @@ -1648,7 +1650,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size, * exponent but take into account the leading * decimal point. */ - if (d > 9) /* cdigits == 0 */ + if (d > 9.0) /* cdigits == 0 */ { if (exp_b10 == (-1)) { @@ -1669,18 +1671,19 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size, ++exp_b10; /* In all cases we output a '1' */ - d = 1; + d = 1.0; } } } fp = 0; /* Guarantees termination below. */ } - if (d == 0) + if (d == 0.0) { ++czero; if (cdigits == 0) ++clead; } + else { /* Included embedded zeros in the digit count. */ @@ -1708,6 +1711,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size, above */ --exp_b10; } + *ascii++ = (char)(48 + (int)d), ++cdigits; } } @@ -2040,7 +2044,7 @@ png_muldiv_warn(png_structp png_ptr, png_fixed_point a, png_int_32 times, } #endif -#ifdef PNG_READ_GAMMA_SUPPORTED /* more fixed point functions for gammma */ +#ifdef PNG_READ_GAMMA_SUPPORTED /* more fixed point functions for gamma */ /* Calculate a reciprocal, return 0 on div-by-zero or overflow. */ png_fixed_point png_reciprocal(png_fixed_point a) diff --git a/ExternalLibs/glpng/png/png.h b/ExternalLibs/glpng/png/png.h index 657aa5a..0106214 100644 --- a/ExternalLibs/glpng/png/png.h +++ b/ExternalLibs/glpng/png/png.h @@ -1,8 +1,8 @@ /* png.h - header file for PNG reference library * - * libpng version 1.5.7 - December 15, 2011 - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * libpng version 1.5.12 - July 11, 2012 + * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -11,7 +11,7 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.5.7 - December 15, 2011: Glenn + * libpng versions 0.97, January 1998, through 1.5.12 - July 11, 2012: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: @@ -166,6 +166,18 @@ * 1.5.7beta01-05 15 10507 15.so.15.7[.0] * 1.5.7rc01-03 15 10507 15.so.15.7[.0] * 1.5.7 15 10507 15.so.15.7[.0] + * 1.5.8beta01 15 10508 15.so.15.8[.0] + * 1.5.8rc01 15 10508 15.so.15.8[.0] + * 1.5.8 15 10508 15.so.15.8[.0] + * 1.5.9beta01-02 15 10509 15.so.15.9[.0] + * 1.5.9rc01 15 10509 15.so.15.9[.0] + * 1.5.9 15 10509 15.so.15.9[.0] + * 1.5.10beta01-05 15 10510 15.so.15.10[.0] + * 1.5.10 15 10510 15.so.15.10[.0] + * 1.5.11beta01 15 10511 15.so.15.11[.0] + * 1.5.11rc01-05 15 10511 15.so.15.11[.0] + * 1.5.11 15 10511 15.so.15.11[.0] + * 1.5.12 15 10512 15.so.15.12[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be @@ -175,7 +187,7 @@ * to the source version x.y.z (leading zeros in y and z). Beta versions * were given the previous public release number plus a letter, until * version 1.0.6j; from then on they were given the upcoming public - * release number plus "betaNN" or "rcN". + * release number plus "betaNN" or "rcNN". * * Binary incompatibility exists only when applications make direct access * to the info_ptr or png_ptr members through png.h, and the compiled @@ -197,8 +209,8 @@ * * This code is released under the libpng license. * - * libpng versions 1.2.6, August 15, 2004, through 1.5.7, December 15, 2011, are - * Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are + * libpng versions 1.2.6, August 15, 2004, through 1.5.12, July 11, 2012, are + * Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson, and are * distributed according to the same disclaimer and license as libpng-1.2.5 * with the following individual added to the list of Contributing Authors: * @@ -309,13 +321,13 @@ * Y2K compliance in libpng: * ========================= * - * December 15, 2011 + * July 11, 2012 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. * * This is your unofficial assurance that libpng from version 0.71 and - * upward through 1.5.7 are Y2K compliant. It is my belief that + * upward through 1.5.12 are Y2K compliant. It is my belief that * earlier versions were also Y2K compliant. * * Libpng only has two year fields. One is a 2-byte unsigned integer @@ -326,7 +338,8 @@ * "png_uint_16 year" in png_time_struct. * * The string is - * "png_char time_buffer" in png_struct + * "char time_buffer[29]" in png_struct. This will be no + * longer used in libpng-1.6.0 and will be removed from libpng-1.7.0. * * There are seven time-related functions: * png.c: png_convert_to_rfc_1123() in png.c @@ -373,9 +386,9 @@ */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.5.7" +#define PNG_LIBPNG_VER_STRING "1.5.12" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.5.7 - December 15, 2011\n" + " libpng version 1.5.12 - July 11, 2012\n" #define PNG_LIBPNG_VER_SONUM 15 #define PNG_LIBPNG_VER_DLLNUM 15 @@ -383,7 +396,7 @@ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 5 -#define PNG_LIBPNG_VER_RELEASE 7 +#define PNG_LIBPNG_VER_RELEASE 12 /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: @@ -406,7 +419,7 @@ #define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with PNG_LIBPNG_BUILD_PRIVATE */ -#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_BETA +#define PNG_LIBPNG_BUILD_BASE_TYPE PNG_LIBPNG_BUILD_STABLE /* Careful here. At one time, Guy wanted to use 082, but that would be octal. * We must not include leading zeros. @@ -414,7 +427,7 @@ * version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ -#define PNG_LIBPNG_VER 10507 /* 1.5.7 */ +#define PNG_LIBPNG_VER 10512 /* 1.5.12 */ /* Library configuration: these options cannot be changed after * the library has been built. @@ -536,7 +549,7 @@ extern "C" { /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ -typedef char* png_libpng_version_1_5_7; +typedef char* png_libpng_version_1_5_12; /* Three color definitions. The order of the red, green, and blue, (and the * exact size) is not important, although the size of the fields need to @@ -2631,6 +2644,12 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); : (png_int_32)png_get_uint_32(buf))) #endif +#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \ + defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED) +PNG_EXPORT(234, void, png_set_check_for_invalid_index, (png_structp png_ptr, + int allowed)); +#endif + /* Maintainer: Put new public prototypes here ^, in libpng.3, and project * defs */ @@ -2640,7 +2659,7 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i)); * scripts/symbols.def as well. */ #ifdef PNG_EXPORT_LAST_ORDINAL - PNG_EXPORT_LAST_ORDINAL(233); + PNG_EXPORT_LAST_ORDINAL(234); #endif #ifdef __cplusplus diff --git a/ExternalLibs/glpng/png/pngconf.h b/ExternalLibs/glpng/png/pngconf.h index 0ff169e..aee7915 100644 --- a/ExternalLibs/glpng/png/pngconf.h +++ b/ExternalLibs/glpng/png/pngconf.h @@ -1,9 +1,9 @@ /* pngconf.h - machine configurable file for libpng * - * libpng version 1.5.7 - December 15, 2011 + * libpng version 1.5.12 - July 11, 2012 * - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -25,7 +25,7 @@ #ifndef PNG_BUILDING_SYMBOL_TABLE /* PNG_NO_LIMITS_H may be used to turn off the use of the standard C * definition file for machine specific limits, this may impact the - * correctness of the definitons below (see uses of INT_MAX). + * correctness of the definitions below (see uses of INT_MAX). */ # ifndef PNG_NO_LIMITS_H # include @@ -51,8 +51,8 @@ /* This controls optimization of the reading of 16 and 32 bit values * from PNG files. It can be set on a per-app-file basis - it - * just changes whether a macro is used to the function is called. - * The library builder sets the default, if read functions are not + * just changes whether a macro is used when the function is called. + * The library builder sets the default; if read functions are not * built into the library the macro implementation is forced on. */ #ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED diff --git a/ExternalLibs/glpng/png/pngerror.c b/ExternalLibs/glpng/png/pngerror.c index 6494a0c..ef60d55 100644 --- a/ExternalLibs/glpng/png/pngerror.c +++ b/ExternalLibs/glpng/png/pngerror.c @@ -1,7 +1,7 @@ /* pngerror.c - stub functions for i/o and memory allocation * - * Last changed in libpng 1.5.7 [December 15, 2011] + * Last changed in libpng 1.5.8 [February 1, 2011] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -281,35 +281,40 @@ void png_formatted_warning(png_structp png_ptr, png_warning_parameters p, png_const_charp message) { - /* The internal buffer is just 128 bytes - enough for all our messages, - * overflow doesn't happen because this code checks! + /* The internal buffer is just 192 bytes - enough for all our messages, + * overflow doesn't happen because this code checks! If someone figures + * out how to send us a message longer than 192 bytes, all that will + * happen is that the message will be truncated appropriately. */ - size_t i; - char msg[128]; + size_t i = 0; /* Index in the msg[] buffer: */ + char msg[192]; - for (i=0; i<(sizeof msg)-1 && *message != '\0'; ++i) + /* Each iteration through the following loop writes at most one character + * to msg[i++] then returns here to validate that there is still space for + * the trailing '\0'. It may (in the case of a parameter) read more than + * one character from message[]; it must check for '\0' and continue to the + * test if it finds the end of string. + */ + while (i<(sizeof msg)-1 && *message != '\0') { - if (*message == '@') + /* '@' at end of string is now just printed (previously it was skipped); + * it is an error in the calling code to terminate the string with @. + */ + if (p != NULL && *message == '@' && message[1] != '\0') { - int parameter = -1; - switch (*++message) - { - case '1': - parameter = 0; - break; + int parameter_char = *++message; /* Consume the '@' */ + static const char valid_parameters[] = "123456789"; + int parameter = 0; - case '2': - parameter = 1; - break; + /* Search for the parameter digit, the index in the string is the + * parameter to use. + */ + while (valid_parameters[parameter] != parameter_char && + valid_parameters[parameter] != '\0') + ++parameter; - case '\0': - continue; /* To break out of the for loop above. */ - - default: - break; - } - - if (parameter >= 0 && parameter < PNG_WARNING_PARAMETER_COUNT) + /* If the parameter digit is out of range it will just get printed. */ + if (parameter < PNG_WARNING_PARAMETER_COUNT) { /* Append this parameter */ png_const_charp parm = p[parameter]; @@ -319,28 +324,32 @@ png_formatted_warning(png_structp png_ptr, png_warning_parameters p, * that parm[] has been initialized, so there is no guarantee of a * trailing '\0': */ - for (; i<(sizeof msg)-1 && parm != '\0' && parm < pend; ++i) - msg[i] = *parm++; + while (i<(sizeof msg)-1 && *parm != '\0' && parm < pend) + msg[i++] = *parm++; + /* Consume the parameter digit too: */ ++message; continue; } /* else not a parameter and there is a character after the @ sign; just - * copy that. + * copy that. This is known not to be '\0' because of the test above. */ } /* At this point *message can't be '\0', even in the bad parameter case * above where there is a lone '@' at the end of the message string. */ - msg[i] = *message++; + msg[i++] = *message++; } /* i is always less than (sizeof msg), so: */ msg[i] = '\0'; - /* And this is the formatted message: */ + /* And this is the formatted message, it may be larger than + * PNG_MAX_ERROR_TEXT, but that is only used for 'chunk' errors and these are + * not (currently) formatted. + */ png_warning(png_ptr, msg); } #endif /* PNG_WARNINGS_SUPPORTED */ diff --git a/ExternalLibs/glpng/png/pnglibconf.h b/ExternalLibs/glpng/png/pnglibconf.h index a19053a..6c14dd6 100644 --- a/ExternalLibs/glpng/png/pnglibconf.h +++ b/ExternalLibs/glpng/png/pnglibconf.h @@ -1,189 +1,180 @@ +/* pnglibconf.h - library build configuration */ -/* libpng STANDARD API DEFINITION */ +/* libpng version 1.5.12 - July 11, 2012 */ -/* pnglibconf.h - library build configuration */ +/* Copyright (c) 1998-2011 Glenn Randers-Pehrson */ -/* Libpng 1.5.7 - December 15, 2011 */ - -/* Copyright (c) 1998-2011 Glenn Randers-Pehrson */ - -/* This code is released under the libpng license. */ -/* For conditions of distribution and use, see the disclaimer */ -/* and license in png.h */ +/* This code is released under the libpng license. */ +/* For conditions of distribution and use, see the disclaimer */ +/* and license in png.h */ /* pnglibconf.h */ +/* Machine generated file: DO NOT EDIT */ /* Derived from: scripts/pnglibconf.dfa */ -/* If you edit this file by hand you must obey the rules expressed in */ -/* pnglibconf.dfa with respect to the dependencies between the following */ -/* symbols. It is much better to generate a new file using */ -/* scripts/libpngconf.mak */ - #ifndef PNGLCONF_H #define PNGLCONF_H /* settings */ -#define PNG_API_RULE 0 -#define PNG_CALLOC_SUPPORTED -#define PNG_COST_SHIFT 3 -#define PNG_DEFAULT_READ_MACROS 1 -#define PNG_GAMMA_THRESHOLD_FIXED 5000 #define PNG_MAX_GAMMA_8 11 -#define PNG_QUANTIZE_BLUE_BITS 5 -#define PNG_QUANTIZE_GREEN_BITS 5 +#define PNG_CALLOC_SUPPORTED #define PNG_QUANTIZE_RED_BITS 5 +#define PNG_QUANTIZE_GREEN_BITS 5 +#define PNG_API_RULE 0 +#define PNG_QUANTIZE_BLUE_BITS 5 #define PNG_sCAL_PRECISION 5 -#define PNG_USER_CHUNK_CACHE_MAX 0 -#define PNG_USER_CHUNK_MALLOC_MAX 0 -#define PNG_USER_HEIGHT_MAX 1000000 -#define PNG_USER_WIDTH_MAX 1000000 +#define PNG_COST_SHIFT 3 #define PNG_WEIGHT_SHIFT 8 +#define PNG_DEFAULT_READ_MACROS 1 #define PNG_ZBUF_SIZE 8192 +#define PNG_GAMMA_THRESHOLD_FIXED 5000 /* end of settings */ /* options */ -#define PNG_16BIT_SUPPORTED -#define PNG_ALIGN_MEMORY_SUPPORTED -#define PNG_BENIGN_ERRORS_SUPPORTED -#define PNG_bKGD_SUPPORTED -#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED -#define PNG_CHECK_cHRM_SUPPORTED -#define PNG_cHRM_SUPPORTED -#define PNG_CONSOLE_IO_SUPPORTED -#define PNG_CONVERT_tIME_SUPPORTED -#define PNG_EASY_ACCESS_SUPPORTED +#define PNG_INFO_IMAGE_SUPPORTED 1 +#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED 1 +#define PNG_POINTER_INDEXING_SUPPORTED 1 +#define PNG_WARNINGS_SUPPORTED 1 +#define PNG_FLOATING_ARITHMETIC_SUPPORTED 1 +#define PNG_WRITE_SUPPORTED 1 +#define PNG_WRITE_INTERLACING_SUPPORTED 1 +#define PNG_WRITE_16BIT_SUPPORTED 1 +#define PNG_EASY_ACCESS_SUPPORTED 1 +#define PNG_ALIGN_MEMORY_SUPPORTED 1 +#define PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED 1 +#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED 1 +#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED 1 +#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED 1 +#define PNG_FIXED_POINT_SUPPORTED 1 /*#undef PNG_ERROR_NUMBERS_SUPPORTED*/ -#define PNG_ERROR_TEXT_SUPPORTED -#define PNG_FIXED_POINT_SUPPORTED -#define PNG_FLOATING_ARITHMETIC_SUPPORTED -#define PNG_FLOATING_POINT_SUPPORTED -#define PNG_FORMAT_AFIRST_SUPPORTED -#define PNG_FORMAT_BGR_SUPPORTED -#define PNG_gAMA_SUPPORTED -#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED -#define PNG_hIST_SUPPORTED -#define PNG_iCCP_SUPPORTED -#define PNG_INCH_CONVERSIONS_SUPPORTED -#define PNG_INFO_IMAGE_SUPPORTED -#define PNG_IO_STATE_SUPPORTED -#define PNG_iTXt_SUPPORTED -#define PNG_MNG_FEATURES_SUPPORTED -#define PNG_oFFs_SUPPORTED -#define PNG_pCAL_SUPPORTED -#define PNG_pHYs_SUPPORTED -#define PNG_POINTER_INDEXING_SUPPORTED -#define PNG_PROGRESSIVE_READ_SUPPORTED -#define PNG_READ_16BIT_SUPPORTED -#define PNG_READ_ALPHA_MODE_SUPPORTED -#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED -#define PNG_READ_BACKGROUND_SUPPORTED -#define PNG_READ_BGR_SUPPORTED -#define PNG_READ_bKGD_SUPPORTED -#define PNG_READ_cHRM_SUPPORTED -#define PNG_READ_COMPOSITE_NODIV_SUPPORTED -#define PNG_READ_COMPRESSED_TEXT_SUPPORTED -#define PNG_READ_EXPAND_16_SUPPORTED -#define PNG_READ_EXPAND_SUPPORTED -#define PNG_READ_FILLER_SUPPORTED -#define PNG_READ_gAMA_SUPPORTED -#define PNG_READ_GAMMA_SUPPORTED -#define PNG_READ_GRAY_TO_RGB_SUPPORTED -#define PNG_READ_hIST_SUPPORTED -#define PNG_READ_iCCP_SUPPORTED -#define PNG_READ_INTERLACING_SUPPORTED -#define PNG_READ_INT_FUNCTIONS_SUPPORTED -#define PNG_READ_INVERT_ALPHA_SUPPORTED -#define PNG_READ_INVERT_SUPPORTED -#define PNG_READ_iTXt_SUPPORTED -#define PNG_READ_oFFs_SUPPORTED -#define PNG_READ_OPT_PLTE_SUPPORTED -#define PNG_READ_PACK_SUPPORTED -#define PNG_READ_PACKSWAP_SUPPORTED -#define PNG_READ_pCAL_SUPPORTED -#define PNG_READ_pHYs_SUPPORTED -#define PNG_READ_QUANTIZE_SUPPORTED -#define PNG_READ_RGB_TO_GRAY_SUPPORTED -#define PNG_READ_sBIT_SUPPORTED -#define PNG_READ_SCALE_16_TO_8_SUPPORTED -#define PNG_READ_sCAL_SUPPORTED -#define PNG_READ_SHIFT_SUPPORTED -#define PNG_READ_sPLT_SUPPORTED -#define PNG_READ_sRGB_SUPPORTED -#define PNG_READ_STRIP_16_TO_8_SUPPORTED -#define PNG_READ_STRIP_ALPHA_SUPPORTED -#define PNG_READ_SUPPORTED -#define PNG_READ_SWAP_ALPHA_SUPPORTED -#define PNG_READ_SWAP_SUPPORTED -#define PNG_READ_tEXt_SUPPORTED -#define PNG_READ_TEXT_SUPPORTED -#define PNG_READ_tIME_SUPPORTED -#define PNG_READ_TRANSFORMS_SUPPORTED -#define PNG_READ_tRNS_SUPPORTED -#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED -#define PNG_READ_USER_CHUNKS_SUPPORTED -#define PNG_READ_USER_TRANSFORM_SUPPORTED -#define PNG_READ_zTXt_SUPPORTED -#define PNG_SAVE_INT_32_SUPPORTED -#define PNG_sBIT_SUPPORTED -#define PNG_sCAL_SUPPORTED -#define PNG_SEQUENTIAL_READ_SUPPORTED -#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED -#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED -#define PNG_SETJMP_SUPPORTED -#define PNG_SET_USER_LIMITS_SUPPORTED -#define PNG_sPLT_SUPPORTED -#define PNG_sRGB_SUPPORTED -#define PNG_STDIO_SUPPORTED -#define PNG_tEXt_SUPPORTED -#define PNG_TEXT_SUPPORTED -#define PNG_TIME_RFC1123_SUPPORTED -#define PNG_tIME_SUPPORTED -#define PNG_tRNS_SUPPORTED -#define PNG_UNKNOWN_CHUNKS_SUPPORTED -#define PNG_USER_CHUNKS_SUPPORTED -#define PNG_USER_LIMITS_SUPPORTED -#define PNG_USER_MEM_SUPPORTED -#define PNG_USER_TRANSFORM_INFO_SUPPORTED -#define PNG_USER_TRANSFORM_PTR_SUPPORTED -#define PNG_WARNINGS_SUPPORTED -#define PNG_WRITE_16BIT_SUPPORTED -#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED -#define PNG_WRITE_BGR_SUPPORTED -#define PNG_WRITE_bKGD_SUPPORTED -#define PNG_WRITE_cHRM_SUPPORTED -#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED -#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED -#define PNG_WRITE_FILLER_SUPPORTED -#define PNG_WRITE_FILTER_SUPPORTED -#define PNG_WRITE_FLUSH_SUPPORTED -#define PNG_WRITE_gAMA_SUPPORTED -#define PNG_WRITE_hIST_SUPPORTED -#define PNG_WRITE_iCCP_SUPPORTED -#define PNG_WRITE_INTERLACING_SUPPORTED -#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED -#define PNG_WRITE_INVERT_ALPHA_SUPPORTED -#define PNG_WRITE_INVERT_SUPPORTED -#define PNG_WRITE_iTXt_SUPPORTED -#define PNG_WRITE_oFFs_SUPPORTED -#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED -#define PNG_WRITE_PACK_SUPPORTED -#define PNG_WRITE_PACKSWAP_SUPPORTED -#define PNG_WRITE_pCAL_SUPPORTED -#define PNG_WRITE_pHYs_SUPPORTED -#define PNG_WRITE_sBIT_SUPPORTED -#define PNG_WRITE_sCAL_SUPPORTED -#define PNG_WRITE_SHIFT_SUPPORTED -#define PNG_WRITE_sPLT_SUPPORTED -#define PNG_WRITE_sRGB_SUPPORTED -#define PNG_WRITE_SUPPORTED -#define PNG_WRITE_SWAP_ALPHA_SUPPORTED -#define PNG_WRITE_SWAP_SUPPORTED -#define PNG_WRITE_tEXt_SUPPORTED -#define PNG_WRITE_TEXT_SUPPORTED -#define PNG_WRITE_tIME_SUPPORTED -#define PNG_WRITE_TRANSFORMS_SUPPORTED -#define PNG_WRITE_tRNS_SUPPORTED -#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED -#define PNG_WRITE_USER_TRANSFORM_SUPPORTED -#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED -#define PNG_WRITE_zTXt_SUPPORTED -#define PNG_zTXt_SUPPORTED +#define PNG_ERROR_TEXT_SUPPORTED 1 +#define PNG_READ_SUPPORTED 1 +#define PNG_BENIGN_ERRORS_SUPPORTED 1 +#define PNG_SETJMP_SUPPORTED 1 +#define PNG_TIME_RFC1123_SUPPORTED 1 +#define PNG_WRITE_FLUSH_SUPPORTED 1 +#define PNG_MNG_FEATURES_SUPPORTED 1 +/*#undef PNG_SAFE_LIMITS_SUPPORTED*/ +#define PNG_FLOATING_POINT_SUPPORTED 1 +#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED 1 +#define PNG_INCH_CONVERSIONS_SUPPORTED 1 +#define PNG_STDIO_SUPPORTED 1 +#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED 1 +#define PNG_USER_MEM_SUPPORTED 1 +#define PNG_IO_STATE_SUPPORTED 1 +#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED 1 +#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED 1 +#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED 1 +#define PNG_WRITE_FILTER_SUPPORTED 1 +#define PNG_WRITE_zTXt_SUPPORTED 1 +#define PNG_WRITE_iCCP_SUPPORTED 1 +#define PNG_READ_TRANSFORMS_SUPPORTED 1 +#define PNG_READ_bKGD_SUPPORTED 1 +#define PNG_UNKNOWN_CHUNKS_SUPPORTED 1 +#define PNG_READ_sCAL_SUPPORTED 1 +#define PNG_WRITE_hIST_SUPPORTED 1 +#define PNG_READ_OPT_PLTE_SUPPORTED 1 +#define PNG_WRITE_gAMA_SUPPORTED 1 +#define PNG_READ_GRAY_TO_RGB_SUPPORTED 1 +#define PNG_WRITE_pCAL_SUPPORTED 1 +#define PNG_READ_INVERT_ALPHA_SUPPORTED 1 +#define PNG_WRITE_TRANSFORMS_SUPPORTED 1 +#define PNG_READ_ALPHA_MODE_SUPPORTED 1 +#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED 1 +#define PNG_READ_sBIT_SUPPORTED 1 +#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED 1 +#define PNG_READ_PACK_SUPPORTED 1 +#define PNG_WRITE_iTXt_SUPPORTED 1 +#define PNG_WRITE_SWAP_SUPPORTED 1 +#define PNG_READ_cHRM_SUPPORTED 1 +#define PNG_READ_STRIP_16_TO_8_SUPPORTED 1 +#define PNG_WRITE_tIME_SUPPORTED 1 +#define PNG_READ_INTERLACING_SUPPORTED 1 +#define PNG_READ_tRNS_SUPPORTED 1 +#define PNG_WRITE_pHYs_SUPPORTED 1 +#define PNG_WRITE_INVERT_SUPPORTED 1 +#define PNG_READ_RGB_TO_GRAY_SUPPORTED 1 +#define PNG_WRITE_sRGB_SUPPORTED 1 +#define PNG_READ_oFFs_SUPPORTED 1 +#define PNG_WRITE_FILLER_SUPPORTED 1 +#define PNG_WRITE_SHIFT_SUPPORTED 1 +#define PNG_PROGRESSIVE_READ_SUPPORTED 1 +#define PNG_READ_SHIFT_SUPPORTED 1 +#define PNG_CONVERT_tIME_SUPPORTED 1 +#define PNG_READ_USER_TRANSFORM_SUPPORTED 1 +#define PNG_READ_INT_FUNCTIONS_SUPPORTED 1 +#define PNG_READ_USER_CHUNKS_SUPPORTED 1 +#define PNG_READ_hIST_SUPPORTED 1 +#define PNG_READ_16BIT_SUPPORTED 1 +#define PNG_READ_SWAP_ALPHA_SUPPORTED 1 +#define PNG_READ_COMPOSITE_NODIV_SUPPORTED 1 +#define PNG_SEQUENTIAL_READ_SUPPORTED 1 +#define PNG_READ_BACKGROUND_SUPPORTED 1 +#define PNG_READ_QUANTIZE_SUPPORTED 1 +#define PNG_READ_zTXt_SUPPORTED 1 +#define PNG_USER_LIMITS_SUPPORTED 1 +#define PNG_READ_iCCP_SUPPORTED 1 +#define PNG_READ_STRIP_ALPHA_SUPPORTED 1 +#define PNG_READ_PACKSWAP_SUPPORTED 1 +#define PNG_READ_sRGB_SUPPORTED 1 +#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED 1 +#define PNG_READ_pCAL_SUPPORTED 1 +#define PNG_WRITE_sPLT_SUPPORTED 1 +#define PNG_READ_iTXt_SUPPORTED 1 +#define PNG_READ_SWAP_SUPPORTED 1 +#define PNG_READ_tIME_SUPPORTED 1 +#define PNG_READ_pHYs_SUPPORTED 1 +#define PNG_WRITE_SWAP_ALPHA_SUPPORTED 1 +#define PNG_READ_SCALE_16_TO_8_SUPPORTED 1 +#define PNG_WRITE_BGR_SUPPORTED 1 +#define PNG_USER_CHUNKS_SUPPORTED 1 +#define PNG_CONSOLE_IO_SUPPORTED 1 +#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED 1 +#define PNG_WRITE_PACK_SUPPORTED 1 +#define PNG_READ_FILLER_SUPPORTED 1 +#define PNG_WRITE_bKGD_SUPPORTED 1 +#define PNG_WRITE_tRNS_SUPPORTED 1 +#define PNG_READ_sPLT_SUPPORTED 1 +#define PNG_WRITE_sCAL_SUPPORTED 1 +#define PNG_WRITE_oFFs_SUPPORTED 1 +#define PNG_SET_USER_LIMITS_SUPPORTED 1 +#define PNG_WRITE_sBIT_SUPPORTED 1 +#define PNG_READ_INVERT_SUPPORTED 1 +#define PNG_WRITE_cHRM_SUPPORTED 1 +#define PNG_16BIT_SUPPORTED 1 +#define PNG_WRITE_USER_TRANSFORM_SUPPORTED 1 +#define PNG_READ_BGR_SUPPORTED 1 +#define PNG_WRITE_PACKSWAP_SUPPORTED 1 +#define PNG_WRITE_INVERT_ALPHA_SUPPORTED 1 +#define PNG_sCAL_SUPPORTED 1 +#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED 1 +#define PNG_READ_GAMMA_SUPPORTED 1 +#define PNG_USER_TRANSFORM_INFO_SUPPORTED 1 +#define PNG_sBIT_SUPPORTED 1 +#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED 1 +#define PNG_cHRM_SUPPORTED 1 +#define PNG_bKGD_SUPPORTED 1 +#define PNG_tRNS_SUPPORTED 1 +#define PNG_oFFs_SUPPORTED 1 +#define PNG_READ_EXPAND_16_SUPPORTED 1 +#define PNG_USER_TRANSFORM_PTR_SUPPORTED 1 +#define PNG_WRITE_TEXT_SUPPORTED 1 +#define PNG_READ_COMPRESSED_TEXT_SUPPORTED 1 +#define PNG_hIST_SUPPORTED 1 +#define PNG_zTXt_SUPPORTED 1 +#define PNG_iCCP_SUPPORTED 1 +#define PNG_sRGB_SUPPORTED 1 +#define PNG_pCAL_SUPPORTED 1 +#define PNG_WRITE_tEXt_SUPPORTED 1 +#define PNG_CHECK_cHRM_SUPPORTED 1 +#define PNG_READ_gAMA_SUPPORTED 1 +#define PNG_iTXt_SUPPORTED 1 +#define PNG_tIME_SUPPORTED 1 +#define PNG_READ_EXPAND_SUPPORTED 1 +#define PNG_pHYs_SUPPORTED 1 +#define PNG_READ_TEXT_SUPPORTED 1 +#define PNG_SAVE_INT_32_SUPPORTED 1 +#define PNG_sPLT_SUPPORTED 1 +#define PNG_READ_tEXt_SUPPORTED 1 +#define PNG_gAMA_SUPPORTED 1 +#define PNG_TEXT_SUPPORTED 1 +#define PNG_tEXt_SUPPORTED 1 /* end of options */ #endif /* PNGLCONF_H */ diff --git a/ExternalLibs/glpng/png/pngpread.c b/ExternalLibs/glpng/png/pngpread.c index ca7607a..39f8f6f 100644 --- a/ExternalLibs/glpng/png/pngpread.c +++ b/ExternalLibs/glpng/png/pngpread.c @@ -1,8 +1,8 @@ /* pngpread.c - read a png file in push mode * - * Last changed in libpng 1.5.7 [December 15, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.5.11 [June 14, 2012] + * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -128,30 +128,6 @@ png_process_some_data(png_structp png_ptr, png_infop info_ptr) break; } -#ifdef PNG_READ_tEXt_SUPPORTED - case PNG_READ_tEXt_MODE: - { - png_push_read_tEXt(png_ptr, info_ptr); - break; - } - -#endif -#ifdef PNG_READ_zTXt_SUPPORTED - case PNG_READ_zTXt_MODE: - { - png_push_read_zTXt(png_ptr, info_ptr); - break; - } - -#endif -#ifdef PNG_READ_iTXt_SUPPORTED - case PNG_READ_iTXt_MODE: - { - png_push_read_iTXt(png_ptr, info_ptr); - break; - } - -#endif case PNG_SKIP_MODE: { png_push_crc_finish(png_ptr); @@ -176,7 +152,7 @@ void /* PRIVATE */ png_push_read_sig(png_structp png_ptr, png_infop info_ptr) { png_size_t num_checked = png_ptr->sig_bytes, - num_to_check = 8 - num_checked; + num_to_check = 8 - num_checked; if (png_ptr->buffer_size < num_to_check) { @@ -196,6 +172,7 @@ png_push_read_sig(png_structp png_ptr, png_infop info_ptr) else png_error(png_ptr, "PNG file corrupted by ASCII conversion"); } + else { if (png_ptr->sig_bytes >= 8) @@ -305,8 +282,8 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) png_error(png_ptr, "Missing PLTE before IDAT"); } } - #endif + else if (chunk_name == png_PLTE) { if (png_ptr->push_length + 4 > png_ptr->buffer_size) @@ -543,7 +520,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) return; } - png_push_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length); + png_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length); } #endif @@ -556,7 +533,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) return; } - png_push_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length); + png_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length); } #endif @@ -569,10 +546,11 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) return; } - png_push_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); + png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); } #endif + else { if (png_ptr->push_length + 4 > png_ptr->buffer_size) @@ -580,7 +558,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr) png_push_save_buffer(png_ptr); return; } - png_push_handle_unknown(png_ptr, info_ptr, png_ptr->push_length); + png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length); } png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; @@ -620,6 +598,7 @@ png_push_crc_finish(png_structp png_ptr) png_ptr->save_buffer_size -= save_size; png_ptr->save_buffer_ptr += save_size; } + if (png_ptr->skip_length && png_ptr->current_buffer_size) { png_size_t save_size = png_ptr->current_buffer_size; @@ -641,6 +620,7 @@ png_push_crc_finish(png_structp png_ptr) png_ptr->current_buffer_size -= save_size; png_ptr->current_buffer_ptr += save_size; } + if (!png_ptr->skip_length) { if (png_ptr->buffer_size < 4) @@ -663,6 +643,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length) return; ptr = buffer; + if (png_ptr->save_buffer_size) { png_size_t save_size; @@ -680,6 +661,7 @@ png_push_fill_buffer(png_structp png_ptr, png_bytep buffer, png_size_t length) png_ptr->save_buffer_size -= save_size; png_ptr->save_buffer_ptr += save_size; } + if (length && png_ptr->current_buffer_size) { png_size_t save_size; @@ -709,6 +691,7 @@ png_push_save_buffer(png_structp png_ptr) png_bytep dp; istop = png_ptr->save_buffer_size; + for (i = 0, sp = png_ptr->save_buffer_ptr, dp = png_ptr->save_buffer; i < istop; i++, sp++, dp++) { @@ -716,6 +699,7 @@ png_push_save_buffer(png_structp png_ptr) } } } + if (png_ptr->save_buffer_size + png_ptr->current_buffer_size > png_ptr->save_buffer_max) { @@ -730,8 +714,7 @@ png_push_save_buffer(png_structp png_ptr) new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256; old_buffer = png_ptr->save_buffer; - png_ptr->save_buffer = (png_bytep)png_malloc_warn(png_ptr, - (png_size_t)new_max); + png_ptr->save_buffer = (png_bytep)png_malloc_warn(png_ptr, new_max); if (png_ptr->save_buffer == NULL) { @@ -743,6 +726,7 @@ png_push_save_buffer(png_structp png_ptr) png_free(png_ptr, old_buffer); png_ptr->save_buffer_max = new_max; } + if (png_ptr->current_buffer_size) { png_memcpy(png_ptr->save_buffer + png_ptr->save_buffer_size, @@ -750,6 +734,7 @@ png_push_save_buffer(png_structp png_ptr) png_ptr->save_buffer_size += png_ptr->current_buffer_size; png_ptr->current_buffer_size = 0; } + png_ptr->save_buffer_ptr = png_ptr->save_buffer; png_ptr->buffer_size = 0; } @@ -851,6 +836,7 @@ png_push_read_IDAT(png_structp png_ptr) png_ptr->current_buffer_size -= save_size; png_ptr->current_buffer_ptr += save_size; } + if (!png_ptr->idat_size) { if (png_ptr->buffer_size < 4) @@ -1201,6 +1187,7 @@ png_push_process_row(png_structp png_ptr) void /* PRIVATE */ png_read_push_finish_row(png_structp png_ptr) { +#ifdef PNG_READ_INTERLACING_SUPPORTED /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Start of interlace block */ @@ -1219,6 +1206,7 @@ png_read_push_finish_row(png_structp png_ptr) * it, uncomment it here and in png.h static PNG_CONST png_byte FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1}; */ +#endif png_ptr->row_number++; if (png_ptr->row_number < png_ptr->num_rows) @@ -1262,525 +1250,6 @@ png_read_push_finish_row(png_structp png_ptr) #endif /* PNG_READ_INTERLACING_SUPPORTED */ } -#ifdef PNG_READ_tEXt_SUPPORTED -void /* PRIVATE */ -png_push_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 - length) -{ - if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) - { - PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */ - png_error(png_ptr, "Out of place tEXt"); - /* NOT REACHED */ - } - -#ifdef PNG_MAX_MALLOC_64K - png_ptr->skip_length = 0; /* This may not be necessary */ - - if (length > (png_uint_32)65535L) /* Can't hold entire string in memory */ - { - png_warning(png_ptr, "tEXt chunk too large to fit in memory"); - png_ptr->skip_length = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_size_t)(length + 1)); - png_ptr->current_text[length] = '\0'; - png_ptr->current_text_ptr = png_ptr->current_text; - png_ptr->current_text_size = (png_size_t)length; - png_ptr->current_text_left = (png_size_t)length; - png_ptr->process_mode = PNG_READ_tEXt_MODE; -} - -void /* PRIVATE */ -png_push_read_tEXt(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr->buffer_size && png_ptr->current_text_left) - { - png_size_t text_size; - - if (png_ptr->buffer_size < png_ptr->current_text_left) - text_size = png_ptr->buffer_size; - - else - text_size = png_ptr->current_text_left; - - png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size); - png_ptr->current_text_left -= text_size; - png_ptr->current_text_ptr += text_size; - } - if (!(png_ptr->current_text_left)) - { - png_textp text_ptr; - png_charp text; - png_charp key; - int ret; - - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_crc_finish(png_ptr); - -#ifdef PNG_MAX_MALLOC_64K - if (png_ptr->skip_length) - return; -#endif - - key = png_ptr->current_text; - - for (text = key; *text; text++) - /* Empty loop */ ; - - if (text < key + png_ptr->current_text_size) - text++; - - text_ptr = (png_textp)png_malloc(png_ptr, png_sizeof(png_text)); - text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; - text_ptr->key = key; - text_ptr->itxt_length = 0; - text_ptr->lang = NULL; - text_ptr->lang_key = NULL; - text_ptr->text = text; - - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_free(png_ptr, key); - png_free(png_ptr, text_ptr); - png_ptr->current_text = NULL; - - if (ret) - png_warning(png_ptr, "Insufficient memory to store text chunk"); - } -} -#endif - -#ifdef PNG_READ_zTXt_SUPPORTED -void /* PRIVATE */ -png_push_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 - length) -{ - if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) - { - PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */ - png_error(png_ptr, "Out of place zTXt"); - /* NOT REACHED */ - } - -#ifdef PNG_MAX_MALLOC_64K - /* We can't handle zTXt chunks > 64K, since we don't have enough space - * to be able to store the uncompressed data. Actually, the threshold - * is probably around 32K, but it isn't as definite as 64K is. - */ - if (length > (png_uint_32)65535L) - { - png_warning(png_ptr, "zTXt chunk too large to fit in memory"); - png_push_crc_skip(png_ptr, length); - return; - } -#endif - - png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_size_t)(length + 1)); - png_ptr->current_text[length] = '\0'; - png_ptr->current_text_ptr = png_ptr->current_text; - png_ptr->current_text_size = (png_size_t)length; - png_ptr->current_text_left = (png_size_t)length; - png_ptr->process_mode = PNG_READ_zTXt_MODE; -} - -void /* PRIVATE */ -png_push_read_zTXt(png_structp png_ptr, png_infop info_ptr) -{ - if (png_ptr->buffer_size && png_ptr->current_text_left) - { - png_size_t text_size; - - if (png_ptr->buffer_size < (png_uint_32)png_ptr->current_text_left) - text_size = png_ptr->buffer_size; - - else - text_size = png_ptr->current_text_left; - - png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size); - png_ptr->current_text_left -= text_size; - png_ptr->current_text_ptr += text_size; - } - if (!(png_ptr->current_text_left)) - { - png_textp text_ptr; - png_charp text; - png_charp key; - int ret; - png_size_t text_size, key_size; - - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_crc_finish(png_ptr); - - key = png_ptr->current_text; - - for (text = key; *text; text++) - /* Empty loop */ ; - - /* zTXt can't have zero text */ - if (text >= key + png_ptr->current_text_size) - { - png_ptr->current_text = NULL; - png_free(png_ptr, key); - return; - } - - text++; - - if (*text != PNG_TEXT_COMPRESSION_zTXt) /* Check compression byte */ - { - png_ptr->current_text = NULL; - png_free(png_ptr, key); - return; - } - - text++; - - png_ptr->zstream.next_in = (png_bytep)text; - png_ptr->zstream.avail_in = (uInt)(png_ptr->current_text_size - - (text - key)); - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - - key_size = text - key; - text_size = 0; - text = NULL; - ret = Z_STREAM_END; - - while (png_ptr->zstream.avail_in) - { - ret = inflate(&png_ptr->zstream, Z_PARTIAL_FLUSH); - if (ret != Z_OK && ret != Z_STREAM_END) - { - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; - png_ptr->current_text = NULL; - png_free(png_ptr, key); - png_free(png_ptr, text); - return; - } - - if (!(png_ptr->zstream.avail_out) || ret == Z_STREAM_END) - { - if (text == NULL) - { - text = (png_charp)png_malloc(png_ptr, - (png_ptr->zbuf_size - - png_ptr->zstream.avail_out + key_size + 1)); - - png_memcpy(text + key_size, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); - - png_memcpy(text, key, key_size); - - text_size = key_size + png_ptr->zbuf_size - - png_ptr->zstream.avail_out; - - *(text + text_size) = '\0'; - } - - else - { - png_charp tmp; - - tmp = text; - text = (png_charp)png_malloc(png_ptr, text_size + - (png_ptr->zbuf_size - - png_ptr->zstream.avail_out + 1)); - - png_memcpy(text, tmp, text_size); - png_free(png_ptr, tmp); - - png_memcpy(text + text_size, png_ptr->zbuf, - png_ptr->zbuf_size - png_ptr->zstream.avail_out); - - text_size += png_ptr->zbuf_size - png_ptr->zstream.avail_out; - *(text + text_size) = '\0'; - } - - if (ret != Z_STREAM_END) - { - png_ptr->zstream.next_out = png_ptr->zbuf; - png_ptr->zstream.avail_out = (uInt)png_ptr->zbuf_size; - } - } - else - { - break; - } - - if (ret == Z_STREAM_END) - break; - } - - inflateReset(&png_ptr->zstream); - png_ptr->zstream.avail_in = 0; - - if (ret != Z_STREAM_END) - { - png_ptr->current_text = NULL; - png_free(png_ptr, key); - png_free(png_ptr, text); - return; - } - - png_ptr->current_text = NULL; - png_free(png_ptr, key); - key = text; - text += key_size; - - text_ptr = (png_textp)png_malloc(png_ptr, - png_sizeof(png_text)); - text_ptr->compression = PNG_TEXT_COMPRESSION_zTXt; - text_ptr->key = key; - text_ptr->itxt_length = 0; - text_ptr->lang = NULL; - text_ptr->lang_key = NULL; - text_ptr->text = text; - - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_free(png_ptr, key); - png_free(png_ptr, text_ptr); - - if (ret) - png_warning(png_ptr, "Insufficient memory to store text chunk"); - } -} -#endif - -#ifdef PNG_READ_iTXt_SUPPORTED -void /* PRIVATE */ -png_push_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 - length) -{ - if (!(png_ptr->mode & PNG_HAVE_IHDR) || (png_ptr->mode & PNG_HAVE_IEND)) - { - PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */ - png_error(png_ptr, "Out of place iTXt"); - /* NOT REACHED */ - } - -#ifdef PNG_MAX_MALLOC_64K - png_ptr->skip_length = 0; /* This may not be necessary */ - - if (length > (png_uint_32)65535L) /* Can't hold entire string in memory */ - { - png_warning(png_ptr, "iTXt chunk too large to fit in memory"); - png_ptr->skip_length = length - (png_uint_32)65535L; - length = (png_uint_32)65535L; - } -#endif - - png_ptr->current_text = (png_charp)png_malloc(png_ptr, - (png_size_t)(length + 1)); - png_ptr->current_text[length] = '\0'; - png_ptr->current_text_ptr = png_ptr->current_text; - png_ptr->current_text_size = (png_size_t)length; - png_ptr->current_text_left = (png_size_t)length; - png_ptr->process_mode = PNG_READ_iTXt_MODE; -} - -void /* PRIVATE */ -png_push_read_iTXt(png_structp png_ptr, png_infop info_ptr) -{ - - if (png_ptr->buffer_size && png_ptr->current_text_left) - { - png_size_t text_size; - - if (png_ptr->buffer_size < png_ptr->current_text_left) - text_size = png_ptr->buffer_size; - - else - text_size = png_ptr->current_text_left; - - png_crc_read(png_ptr, (png_bytep)png_ptr->current_text_ptr, text_size); - png_ptr->current_text_left -= text_size; - png_ptr->current_text_ptr += text_size; - } - - if (!(png_ptr->current_text_left)) - { - png_textp text_ptr; - png_charp key; - int comp_flag; - png_charp lang; - png_charp lang_key; - png_charp text; - int ret; - - if (png_ptr->buffer_size < 4) - { - png_push_save_buffer(png_ptr); - return; - } - - png_push_crc_finish(png_ptr); - -#ifdef PNG_MAX_MALLOC_64K - if (png_ptr->skip_length) - return; -#endif - - key = png_ptr->current_text; - - for (lang = key; *lang; lang++) - /* Empty loop */ ; - - if (lang < key + png_ptr->current_text_size - 3) - lang++; - - comp_flag = *lang++; - lang++; /* Skip comp_type, always zero */ - - for (lang_key = lang; *lang_key; lang_key++) - /* Empty loop */ ; - - lang_key++; /* Skip NUL separator */ - - text=lang_key; - - if (lang_key < key + png_ptr->current_text_size - 1) - { - for (; *text; text++) - /* Empty loop */ ; - } - - if (text < key + png_ptr->current_text_size) - text++; - - text_ptr = (png_textp)png_malloc(png_ptr, - png_sizeof(png_text)); - - text_ptr->compression = comp_flag + 2; - text_ptr->key = key; - text_ptr->lang = lang; - text_ptr->lang_key = lang_key; - text_ptr->text = text; - text_ptr->text_length = 0; - text_ptr->itxt_length = png_strlen(text); - - ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); - - png_ptr->current_text = NULL; - - png_free(png_ptr, text_ptr); - if (ret) - png_warning(png_ptr, "Insufficient memory to store iTXt chunk"); - } -} -#endif - -/* This function is called when we haven't found a handler for this - * chunk. If there isn't a problem with the chunk itself (ie a bad chunk - * name or a critical chunk), the chunk is (currently) silently ignored. - */ -void /* PRIVATE */ -png_push_handle_unknown(png_structp png_ptr, png_infop info_ptr, png_uint_32 - length) -{ - png_uint_32 skip = 0; - png_uint_32 chunk_name = png_ptr->chunk_name; - - if (PNG_CHUNK_CRITICAL(chunk_name)) - { -#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED - if (png_chunk_unknown_handling(png_ptr, chunk_name) != - PNG_HANDLE_CHUNK_ALWAYS -#ifdef PNG_READ_USER_CHUNKS_SUPPORTED - && png_ptr->read_user_chunk_fn == NULL -#endif - ) -#endif - png_chunk_error(png_ptr, "unknown critical chunk"); - - PNG_UNUSED(info_ptr) /* To quiet some compiler warnings */ - } - -#ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED - /* TODO: the code below is apparently just using the - * png_struct::unknown_chunk member as a temporarily variable, it should be - * possible to eliminate both it and the temporary buffer. - */ - if (png_ptr->flags & PNG_FLAG_KEEP_UNKNOWN_CHUNKS) - { -#ifdef PNG_MAX_MALLOC_64K - if (length > 65535) - { - png_warning(png_ptr, "unknown chunk too large to fit in memory"); - skip = length - 65535; - length = 65535; - } -#endif - /* This is just a record for the user; libpng doesn't use the character - * form of the name. - */ - PNG_CSTRING_FROM_CHUNK(png_ptr->unknown_chunk.name, png_ptr->chunk_name); - - /* The following cast should be safe because of the check above. */ - png_ptr->unknown_chunk.size = (png_size_t)length; - - if (length == 0) - png_ptr->unknown_chunk.data = NULL; - - else - { - png_ptr->unknown_chunk.data = (png_bytep)png_malloc(png_ptr, - png_ptr->unknown_chunk.size); - png_crc_read(png_ptr, (png_bytep)png_ptr->unknown_chunk.data, - png_ptr->unknown_chunk.size); - } - -#ifdef PNG_READ_USER_CHUNKS_SUPPORTED - if (png_ptr->read_user_chunk_fn != NULL) - { - /* Callback to user unknown chunk handler */ - int ret; - ret = (*(png_ptr->read_user_chunk_fn)) - (png_ptr, &png_ptr->unknown_chunk); - - if (ret < 0) - png_chunk_error(png_ptr, "error in user chunk"); - - if (ret == 0) - { - if (PNG_CHUNK_CRITICAL(png_ptr->chunk_name)) - if (png_chunk_unknown_handling(png_ptr, chunk_name) != - PNG_HANDLE_CHUNK_ALWAYS) - png_chunk_error(png_ptr, "unknown critical chunk"); - png_set_unknown_chunks(png_ptr, info_ptr, - &png_ptr->unknown_chunk, 1); - } - } - - else -#endif - png_set_unknown_chunks(png_ptr, info_ptr, &png_ptr->unknown_chunk, 1); - png_free(png_ptr, png_ptr->unknown_chunk.data); - png_ptr->unknown_chunk.data = NULL; - } - - else -#endif - skip=length; - png_push_crc_skip(png_ptr, skip); -} - void /* PRIVATE */ png_push_have_info(png_structp png_ptr, png_infop info_ptr) { diff --git a/ExternalLibs/glpng/png/pngpriv.h b/ExternalLibs/glpng/png/pngpriv.h index 5f751de..a76c262 100644 --- a/ExternalLibs/glpng/png/pngpriv.h +++ b/ExternalLibs/glpng/png/pngpriv.h @@ -2,11 +2,11 @@ /* pngpriv.h - private declarations for use inside libpng * * For conditions of distribution and use, see copyright notice in png.h - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * - * Last changed in libpng 1.5.7 [December 15, 2011] + * Last changed in libpng 1.5.10 [March 29, 2012] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -133,6 +133,46 @@ # define PNG_DLL_EXPORT #endif +/* SECURITY and SAFETY: + * + * By default libpng is built without any internal limits on image size, + * individual heap (png_malloc) allocations or the total amount of memory used. + * If PNG_SAFE_LIMITS_SUPPORTED is defined, however, the limits below are used + * (unless individually overridden). These limits are believed to be fairly + * safe, but builders of secure systems should verify the values against the + * real system capabilities. + */ + +#ifdef PNG_SAFE_LIMITS_SUPPORTED + /* 'safe' limits */ +# ifndef PNG_USER_WIDTH_MAX +# define PNG_USER_WIDTH_MAX 1000000 +# endif +# ifndef PNG_USER_HEIGHT_MAX +# define PNG_USER_HEIGHT_MAX 1000000 +# endif +# ifndef PNG_USER_CHUNK_CACHE_MAX +# define PNG_USER_CHUNK_CACHE_MAX 128 +# endif +# ifndef PNG_USER_CHUNK_MALLOC_MAX +# define PNG_USER_CHUNK_MALLOC_MAX 8000000 +# endif +#else + /* values for no limits */ +# ifndef PNG_USER_WIDTH_MAX +# define PNG_USER_WIDTH_MAX 0x7fffffff +# endif +# ifndef PNG_USER_HEIGHT_MAX +# define PNG_USER_HEIGHT_MAX 0x7fffffff +# endif +# ifndef PNG_USER_CHUNK_CACHE_MAX +# define PNG_USER_CHUNK_CACHE_MAX 0 +# endif +# ifndef PNG_USER_CHUNK_MALLOC_MAX +# define PNG_USER_CHUNK_MALLOC_MAX 0 +# endif +#endif + /* This is used for 16 bit gamma tables - only the top level pointers are const, * this could be changed: */ @@ -426,6 +466,7 @@ typedef PNG_CONST png_uint_16p FAR * png_const_uint_16pp; #define PNG_BACKGROUND_IS_GRAY 0x800 #define PNG_HAVE_PNG_SIGNATURE 0x1000 #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ +#define PNG_HAVE_iCCP 0x4000 /* Flags for the transformations the PNG library does on the image data */ #define PNG_BGR 0x0001 @@ -1218,10 +1259,8 @@ PNG_EXTERN void png_handle_zTXt PNGARG((png_structp png_ptr, png_infop info_ptr, png_uint_32 length)); #endif -#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr, png_infop info_ptr, png_uint_32 length)); -#endif PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr, png_uint_32 chunk_name)); @@ -1355,6 +1394,13 @@ PNG_EXTERN void png_check_IHDR PNGARG((png_structp png_ptr, int color_type, int interlace_type, int compression_type, int filter_type)); +/* Added at libpng version 1.5.10 */ +#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \ + defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED) +PNG_EXTERN void png_do_check_palette_indexes PNGARG((png_structp png_ptr, + png_row_infop row_info)); +#endif + /* Free all memory used by the read (old method - NOT DLL EXPORTED) */ PNG_EXTERN void png_read_destroy PNGARG((png_structp png_ptr, png_infop info_ptr, png_infop end_info_ptr)); @@ -1536,7 +1582,7 @@ PNG_EXTERN void png_ascii_from_fixed PNGARG((png_structp png_ptr, #define PNG_FP_IS_ZERO(state) (((state) & PNG_FP_Z_MASK) == PNG_FP_SAW_DIGIT) #define PNG_FP_IS_POSITIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_Z_MASK) #define PNG_FP_IS_NEGATIVE(state) (((state) & PNG_FP_NZ_MASK) == PNG_FP_NZ_MASK) - + /* The actual parser. This can be called repeatedly, it updates * the index into the string and the state variable (which must * be initialzed to 0). It returns a result code, as above. There diff --git a/ExternalLibs/glpng/png/pngread.c b/ExternalLibs/glpng/png/pngread.c index e2641d5..96a2a56 100644 --- a/ExternalLibs/glpng/png/pngread.c +++ b/ExternalLibs/glpng/png/pngread.c @@ -1,8 +1,8 @@ /* pngread.c - read a PNG file * - * Last changed in libpng 1.5.7 [December 15, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.5.10 [March 8, 2012] + * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -67,15 +67,11 @@ png_create_read_struct_2,(png_const_charp user_png_ver, png_voidp error_ptr, png_ptr->user_width_max = PNG_USER_WIDTH_MAX; png_ptr->user_height_max = PNG_USER_HEIGHT_MAX; -# ifdef PNG_USER_CHUNK_CACHE_MAX /* Added at libpng-1.2.43 and 1.4.0 */ png_ptr->user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX; -# endif -# ifdef PNG_SET_USER_CHUNK_MALLOC_MAX /* Added at libpng-1.2.43 and 1.4.1 */ png_ptr->user_chunk_malloc_max = PNG_USER_CHUNK_MALLOC_MAX; -# endif #endif #ifdef PNG_SETJMP_SUPPORTED @@ -805,6 +801,13 @@ png_read_end(png_structp png_ptr, png_infop info_ptr) png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */ +#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED + /* Report invalid palette index; added at libng-1.5.10 */ + if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && + png_ptr->num_palette_max > png_ptr->num_palette) + png_benign_error(png_ptr, "Read palette index exceeding num_palette"); +#endif + do { png_uint_32 length = png_read_chunk_header(png_ptr); @@ -1070,12 +1073,6 @@ png_read_destroy(png_structp png_ptr, png_infop info_ptr, png_free(png_ptr, png_ptr->save_buffer); #endif -#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -#ifdef PNG_TEXT_SUPPORTED - png_free(png_ptr, png_ptr->current_text); -#endif /* PNG_TEXT_SUPPORTED */ -#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ - /* Save the important info out of the png_struct, in case it is * being used again. */ diff --git a/ExternalLibs/glpng/png/pngrtran.c b/ExternalLibs/glpng/png/pngrtran.c index 26083a0..8fe6dad 100644 --- a/ExternalLibs/glpng/png/pngrtran.c +++ b/ExternalLibs/glpng/png/pngrtran.c @@ -1,8 +1,8 @@ /* pngrtran.c - transforms the data in a row for PNG readers * - * Last changed in libpng 1.5.7 [December 15, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.5.11 [June 14, 2012] + * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -1770,8 +1770,8 @@ png_init_read_transformations(png_structp png_ptr) int num_palette = png_ptr->num_palette; int i; - /*NOTE: there are other transformations that should probably be in here - * too. + /* NOTE: there are other transformations that should probably be in + * here too. */ for (i = 0; i < num_palette; i++) { @@ -1830,12 +1830,15 @@ png_init_read_transformations(png_structp png_ptr) #ifdef PNG_READ_SHIFT_SUPPORTED if ((png_ptr->transformations & PNG_SHIFT) && + !(png_ptr->transformations & PNG_EXPAND) && (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)) { int i; int istop = png_ptr->num_palette; int shift = 8 - png_ptr->sig_bit.red; + png_ptr->transformations &= ~PNG_SHIFT; + /* significant bits can be in the range 1 to 7 for a meaninful result, if * the number of significant bits is 0 then no shift is done (this is an * error condition which is silently ignored.) @@ -2274,7 +2277,7 @@ png_do_read_transformations(png_structp png_ptr, png_row_infop row_info) #endif #ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED - /*NOTE: moved here in 1.5.4 (from much later in this list.) */ + /* NOTE: moved here in 1.5.4 (from much later in this list.) */ if ((png_ptr->transformations & PNG_GRAY_TO_RGB) && (png_ptr->mode & PNG_BACKGROUND_IS_GRAY)) png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1); @@ -2296,6 +2299,13 @@ png_do_read_transformations(png_structp png_ptr, png_row_infop row_info) png_do_unpack(row_info, png_ptr->row_buf + 1); #endif +#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED + /* Added at libpng-1.5.10 */ + if (row_info->color_type == PNG_COLOR_TYPE_PALETTE && + png_ptr->num_palette_max >= 0) + png_do_check_palette_indexes(png_ptr, row_info); +#endif + #ifdef PNG_READ_BGR_SUPPORTED if (png_ptr->transformations & PNG_BGR) png_do_bgr(row_info, png_ptr->row_buf + 1); @@ -3293,7 +3303,7 @@ png_do_rgb_to_gray(png_structp png_ptr, png_row_infop row_info, png_bytep row) if (red != green || red != blue) { rgb_error |= 1; - /*NOTE: this is the historical approach which simply + /* NOTE: this is the historical approach which simply * truncates the results. */ *(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15); diff --git a/ExternalLibs/glpng/png/pngrutil.c b/ExternalLibs/glpng/png/pngrutil.c index 62e9632..b9c3905 100644 --- a/ExternalLibs/glpng/png/pngrutil.c +++ b/ExternalLibs/glpng/png/pngrutil.c @@ -1,8 +1,8 @@ /* pngrutil.c - utilities to read a PNG file * - * Last changed in libpng 1.5.7 [December 15, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.5.10 [March 8, 2012] + * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -432,15 +432,16 @@ png_decompress_chunk(png_structp png_ptr, int comp_type, /* Now check the limits on this chunk - if the limit fails the * compressed data will be removed, the prefix will remain. */ -#ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED - if (png_ptr->user_chunk_malloc_max && + if (prefix_size >= (~(png_size_t)0) - 1 || + expanded_size >= (~(png_size_t)0) - 1 - prefix_size +#ifdef PNG_USER_LIMITS_SUPPORTED + || (png_ptr->user_chunk_malloc_max && (prefix_size + expanded_size >= png_ptr->user_chunk_malloc_max - 1)) #else -# ifdef PNG_USER_CHUNK_MALLOC_MAX - if ((PNG_USER_CHUNK_MALLOC_MAX > 0) && + || ((PNG_USER_CHUNK_MALLOC_MAX > 0) && prefix_size + expanded_size >= PNG_USER_CHUNK_MALLOC_MAX - 1) -# endif #endif + ) png_warning(png_ptr, "Exceeded size limit while expanding chunk"); /* If the size is zero either there was an error and a message @@ -448,12 +449,7 @@ png_decompress_chunk(png_structp png_ptr, int comp_type, * and we have nothing to do - the code will exit through the * error case below. */ -#if defined(PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED) || \ - defined(PNG_USER_CHUNK_MALLOC_MAX) else if (expanded_size > 0) -#else - if (expanded_size > 0) -#endif { /* Success (maybe) - really uncompress the chunk. */ png_size_t new_size = 0; @@ -1261,13 +1257,16 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) /* Should be an error, but we can cope with it */ png_warning(png_ptr, "Out of place iCCP chunk"); - if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP)) + if ((png_ptr->mode & PNG_HAVE_iCCP) || (info_ptr != NULL && + (info_ptr->valid & (PNG_INFO_iCCP|PNG_INFO_sRGB)))) { png_warning(png_ptr, "Duplicate iCCP chunk"); png_crc_finish(png_ptr, length); return; } + png_ptr->mode |= PNG_HAVE_iCCP; + #ifdef PNG_MAX_MALLOC_64K if (length > (png_uint_32)65535L) { @@ -1279,7 +1278,7 @@ png_handle_iCCP(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = (png_charp)png_malloc(png_ptr, length + 1); - slength = (png_size_t)length; + slength = length; png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); if (png_crc_finish(png_ptr, skip)) @@ -1429,7 +1428,7 @@ png_handle_sPLT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) * that the PNG_MAX_MALLOC_64K test is enabled in this case, but this is a * potential breakage point if the types in pngconf.h aren't exactly right. */ - slength = (png_size_t)length; + slength = length; png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); if (png_crc_finish(png_ptr, skip)) @@ -1797,16 +1796,16 @@ png_handle_hIST(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) return; } - num = length / 2 ; - - if (num != (unsigned int)png_ptr->num_palette || num > - (unsigned int)PNG_MAX_PALETTE_LENGTH) + if (length > 2*PNG_MAX_PALETTE_LENGTH || + length != (unsigned int) (2*png_ptr->num_palette)) { png_warning(png_ptr, "Incorrect hIST chunk length"); png_crc_finish(png_ptr, length); return; } + num = length / 2 ; + for (i = 0; i < num; i++) { png_byte buf[2]; @@ -1956,7 +1955,7 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) return; } - slength = (png_size_t)length; + slength = length; png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); if (png_crc_finish(png_ptr, 0)) @@ -2105,7 +2104,7 @@ png_handle_sCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) return; } - slength = (png_size_t)length; + slength = length; png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); png_ptr->chunkdata[slength] = 0x00; /* Null terminate the last string */ @@ -2265,7 +2264,7 @@ png_handle_tEXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) return; } - slength = (png_size_t)length; + slength = length; png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); if (png_crc_finish(png_ptr, skip)) @@ -2373,7 +2372,7 @@ png_handle_zTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) return; } - slength = (png_size_t)length; + slength = length; png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); if (png_crc_finish(png_ptr, 0)) @@ -2504,7 +2503,7 @@ png_handle_iTXt(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) return; } - slength = (png_size_t)length; + slength = length; png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); if (png_crc_finish(png_ptr, 0)) @@ -3707,7 +3706,7 @@ png_init_filter_functions_neon(png_structp pp, unsigned int bpp) { pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_neon; pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_neon; - pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = + pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_neon; } diff --git a/ExternalLibs/glpng/png/pngset.c b/ExternalLibs/glpng/png/pngset.c index e753ca8..fc99f5f 100644 --- a/ExternalLibs/glpng/png/pngset.c +++ b/ExternalLibs/glpng/png/pngset.c @@ -1,8 +1,8 @@ /* pngset.c - storage of image information into info struct * - * Last changed in libpng 1.5.7 [December 15, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.5.11 [June 14, 2012] + * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -149,7 +149,7 @@ png_set_gAMA_fixed(png_structp png_ptr, png_infop info_ptr, png_fixed_point * possible for 1/gamma to overflow the limit of 21474 and this means the * gamma value must be at least 5/100000 and hence at most 20000.0. For * safety the limits here are a little narrower. The values are 0.00016 to - * 6250.0, which are truly ridiculous gammma values (and will produce + * 6250.0, which are truly ridiculous gamma values (and will produce * displays that are all black or all white.) */ if (file_gamma < 16 || file_gamma > 625000000) @@ -692,24 +692,28 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, */ if (info_ptr->num_text + num_text > info_ptr->max_text) { + int old_max_text = info_ptr->max_text; + int old_num_text = info_ptr->num_text; + if (info_ptr->text != NULL) { png_textp old_text; - int old_max; - old_max = info_ptr->max_text; info_ptr->max_text = info_ptr->num_text + num_text + 8; old_text = info_ptr->text; + info_ptr->text = (png_textp)png_malloc_warn(png_ptr, (png_size_t)(info_ptr->max_text * png_sizeof(png_text))); if (info_ptr->text == NULL) { - png_free(png_ptr, old_text); + /* Restore to previous condition */ + info_ptr->max_text = old_max_text; + info_ptr->text = old_text; return(1); } - png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max * + png_memcpy(info_ptr->text, old_text, (png_size_t)(old_max_text * png_sizeof(png_text))); png_free(png_ptr, old_text); } @@ -721,7 +725,12 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, info_ptr->text = (png_textp)png_malloc_warn(png_ptr, (png_size_t)(info_ptr->max_text * png_sizeof(png_text))); if (info_ptr->text == NULL) + { + /* Restore to previous condition */ + info_ptr->num_text = old_num_text; + info_ptr->max_text = old_max_text; return(1); + } info_ptr->free_me |= PNG_FREE_TEXT; } @@ -1281,4 +1290,22 @@ png_set_benign_errors(png_structp png_ptr, int allowed) png_ptr->flags &= ~PNG_FLAG_BENIGN_ERRORS_WARN; } #endif /* PNG_BENIGN_ERRORS_SUPPORTED */ + +#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED +/* Whether to report invalid palette index; added at libng-1.5.10 + * allowed - one of 0: disable; 1: enable + */ +void PNGAPI +png_set_check_for_invalid_index(png_structp png_ptr, int allowed) +{ + png_debug(1, "in png_set_check_for_invalid_index"); + + if (allowed) + png_ptr->num_palette_max = 0; + + else + png_ptr->num_palette_max = -1; +} +#endif + #endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */ diff --git a/ExternalLibs/glpng/png/pngstruct.h b/ExternalLibs/glpng/png/pngstruct.h index 4466b04..73d7114 100644 --- a/ExternalLibs/glpng/png/pngstruct.h +++ b/ExternalLibs/glpng/png/pngstruct.h @@ -1,11 +1,11 @@ /* pngstruct.h - header file for PNG reference library * - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * - * Last changed in libpng 1.5.5 [September 22, 2011] + * Last changed in libpng 1.5.9 [February 18, 2012] * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -121,6 +121,12 @@ struct png_struct_def png_uint_32 crc; /* current chunk CRC value */ png_colorp palette; /* palette from the input file */ png_uint_16 num_palette; /* number of color entries in palette */ + +/* Added at libpng-1.5.10 */ +#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED + int num_palette_max; /* maximum palette index found in IDAT */ +#endif + png_uint_16 num_trans; /* number of transparency values */ png_byte compression; /* file compression type (always 0) */ png_byte filter; /* file filter type (always 0) */ @@ -211,13 +217,6 @@ struct png_struct_def int process_mode; /* what push library is currently doing */ int cur_palette; /* current push library palette index */ -# ifdef PNG_TEXT_SUPPORTED - png_size_t current_text_size; /* current size of text input data */ - png_size_t current_text_left; /* how much text left to read in input */ - png_charp current_text; /* current text chunk buffer */ - png_charp current_text_ptr; /* current location in current_text */ -# endif /* PNG_PROGRESSIVE_READ_SUPPORTED && PNG_TEXT_SUPPORTED */ - #endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ #if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__) @@ -249,6 +248,7 @@ struct png_struct_def #endif #ifdef PNG_TIME_RFC1123_SUPPORTED + /* This is going to be unused in libpng16 and removed from libpng17 */ char time_buffer[29]; /* String to hold RFC 1123 time text */ #endif @@ -283,9 +283,7 @@ struct png_struct_def #endif /* New member added in libpng-1.0.4 (renamed in 1.0.9) */ -#if defined(PNG_MNG_FEATURES_SUPPORTED) || \ - defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \ - defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED) +#if defined(PNG_MNG_FEATURES_SUPPORTED) /* Changed from png_byte to png_uint_32 at version 1.2.0 */ png_uint_32 mng_features_permitted; #endif diff --git a/ExternalLibs/glpng/png/pngtrans.c b/ExternalLibs/glpng/png/pngtrans.c index 53d9a25..d562eb0 100644 --- a/ExternalLibs/glpng/png/pngtrans.c +++ b/ExternalLibs/glpng/png/pngtrans.c @@ -1,8 +1,8 @@ /* pngtrans.c - transforms the data in a row (used by both readers and writers) * - * Last changed in libpng 1.5.4 [July 7, 2011] - * Copyright (c) 1998-2011 Glenn Randers-Pehrson + * Last changed in libpng 1.5.11 [June 14, 2012] + * Copyright (c) 1998-2012 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * @@ -619,6 +619,109 @@ png_do_bgr(png_row_infop row_info, png_bytep row) } #endif /* PNG_READ_BGR_SUPPORTED or PNG_WRITE_BGR_SUPPORTED */ +#if defined(PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED) || \ + defined(PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED) +/* Added at libpng-1.5.10 */ +void /* PRIVATE */ +png_do_check_palette_indexes(png_structp png_ptr, png_row_infop row_info) +{ + if (png_ptr->num_palette < (1 << row_info->bit_depth) && + png_ptr->num_palette > 0) /* num_palette can be 0 in MNG files */ + { + /* Calculations moved outside switch in an attempt to stop different + * compiler warnings. 'padding' is in *bits* within the last byte, it is + * an 'int' because pixel_depth becomes an 'int' in the expression below, + * and this calculation is used because it avoids warnings that other + * forms produced on either GCC or MSVC. + */ + int padding = (-row_info->pixel_depth * row_info->width) & 7; + png_bytep rp = png_ptr->row_buf + row_info->rowbytes; + + switch (row_info->bit_depth) + { + case 1: + { + /* in this case, all bytes must be 0 so we don't need + * to unpack the pixels except for the rightmost one. + */ + for (; rp > png_ptr->row_buf; rp--) + { + if (*rp >> padding != 0) + png_ptr->num_palette_max = 1; + padding = 0; + } + + break; + } + + case 2: + { + for (; rp > png_ptr->row_buf; rp--) + { + int i = ((*rp >> padding) & 0x03); + + if (i > png_ptr->num_palette_max) + png_ptr->num_palette_max = i; + + i = (((*rp >> padding) >> 2) & 0x03); + + if (i > png_ptr->num_palette_max) + png_ptr->num_palette_max = i; + + i = (((*rp >> padding) >> 4) & 0x03); + + if (i > png_ptr->num_palette_max) + png_ptr->num_palette_max = i; + + i = (((*rp >> padding) >> 6) & 0x03); + + if (i > png_ptr->num_palette_max) + png_ptr->num_palette_max = i; + + padding = 0; + } + + break; + } + + case 4: + { + for (; rp > png_ptr->row_buf; rp--) + { + int i = ((*rp >> padding) & 0x0f); + + if (i > png_ptr->num_palette_max) + png_ptr->num_palette_max = i; + + i = (((*rp >> padding) >> 4) & 0x0f); + + if (i > png_ptr->num_palette_max) + png_ptr->num_palette_max = i; + + padding = 0; + } + + break; + } + + case 8: + { + for (; rp > png_ptr->row_buf; rp--) + { + if (*rp > png_ptr->num_palette_max) + png_ptr->num_palette_max = (int) *rp; + } + + break; + } + + default: + break; + } + } +} +#endif /* PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED */ + #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \ defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED) #ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED diff --git a/ExternalLibs/libvorbis-1.3.2/include/Makefile.am b/ExternalLibs/libvorbis-1.3.2/include/Makefile.am deleted file mode 100644 index 0f34fab..0000000 --- a/ExternalLibs/libvorbis-1.3.2/include/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS = vorbis diff --git a/ExternalLibs/libvorbis-1.3.2/include/Makefile.in b/ExternalLibs/libvorbis-1.3.2/include/Makefile.in deleted file mode 100644 index 76cf058..0000000 --- a/ExternalLibs/libvorbis-1.3.2/include/Makefile.in +++ /dev/null @@ -1,514 +0,0 @@ -# Makefile.in generated by automake 1.10.2 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = include -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/add_cflags.m4 \ - $(top_srcdir)/m4/ogg.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -ETAGS = etags -CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -ALLOCA = @ALLOCA@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG = @DEBUG@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -HAVE_DOXYGEN = @HAVE_DOXYGEN@ -HTLATEX = @HTLATEX@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PDFLATEX = @PDFLATEX@ -PKG_CONFIG = @PKG_CONFIG@ -PROFILE = @PROFILE@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -VE_LIB_AGE = @VE_LIB_AGE@ -VE_LIB_CURRENT = @VE_LIB_CURRENT@ -VE_LIB_REVISION = @VE_LIB_REVISION@ -VF_LIB_AGE = @VF_LIB_AGE@ -VF_LIB_CURRENT = @VF_LIB_CURRENT@ -VF_LIB_REVISION = @VF_LIB_REVISION@ -VORBIS_LIBS = @VORBIS_LIBS@ -V_LIB_AGE = @V_LIB_AGE@ -V_LIB_CURRENT = @V_LIB_CURRENT@ -V_LIB_REVISION = @V_LIB_REVISION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pthread_lib = @pthread_lib@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -SUBDIRS = vorbis -all: all-recursive - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu include/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -# This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" - -$(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - distdir) \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-recursive -all-am: Makefile -installdirs: installdirs-recursive -installdirs-am: -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-recursive -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-recursive - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-recursive - -dvi-am: - -html: html-recursive - -info: info-recursive - -info-am: - -install-data-am: - -install-dvi: install-dvi-recursive - -install-exec-am: - -install-html: install-html-recursive - -install-info: install-info-recursive - -install-man: - -install-pdf: install-pdf-recursive - -install-ps: install-ps-recursive - -installcheck-am: - -maintainer-clean: maintainer-clean-recursive - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-recursive - -pdf-am: - -ps: ps-recursive - -ps-am: - -uninstall-am: - -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic clean-libtool \ - ctags ctags-recursive distclean distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/ExternalLibs/libvorbis-1.3.2/include/vorbis/Makefile.am b/ExternalLibs/libvorbis-1.3.2/include/vorbis/Makefile.am deleted file mode 100644 index dbba34e..0000000 --- a/ExternalLibs/libvorbis-1.3.2/include/vorbis/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -## Process this file with automake to produce Makefile.in - -vorbisincludedir = $(includedir)/vorbis - -vorbisinclude_HEADERS = codec.h vorbisfile.h vorbisenc.h - - diff --git a/ExternalLibs/libvorbis-1.3.2/include/vorbis/Makefile.in b/ExternalLibs/libvorbis-1.3.2/include/vorbis/Makefile.in deleted file mode 100644 index 64a5042..0000000 --- a/ExternalLibs/libvorbis-1.3.2/include/vorbis/Makefile.in +++ /dev/null @@ -1,434 +0,0 @@ -# Makefile.in generated by automake 1.10.2 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -target_triplet = @target@ -subdir = include/vorbis -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(vorbisinclude_HEADERS) -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/add_cflags.m4 \ - $(top_srcdir)/m4/ogg.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -SOURCES = -DIST_SOURCES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -am__installdirs = "$(DESTDIR)$(vorbisincludedir)" -vorbisincludeHEADERS_INSTALL = $(INSTALL_HEADER) -HEADERS = $(vorbisinclude_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ -ALLOCA = @ALLOCA@ -AMTAR = @AMTAR@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEBUG = @DEBUG@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DLLTOOL = @DLLTOOL@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -HAVE_DOXYGEN = @HAVE_DOXYGEN@ -HTLATEX = @HTLATEX@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIBTOOL_DEPS = @LIBTOOL_DEPS@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OGG_CFLAGS = @OGG_CFLAGS@ -OGG_LIBS = @OGG_LIBS@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PDFLATEX = @PDFLATEX@ -PKG_CONFIG = @PKG_CONFIG@ -PROFILE = @PROFILE@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -VE_LIB_AGE = @VE_LIB_AGE@ -VE_LIB_CURRENT = @VE_LIB_CURRENT@ -VE_LIB_REVISION = @VE_LIB_REVISION@ -VF_LIB_AGE = @VF_LIB_AGE@ -VF_LIB_CURRENT = @VF_LIB_CURRENT@ -VF_LIB_REVISION = @VF_LIB_REVISION@ -VORBIS_LIBS = @VORBIS_LIBS@ -V_LIB_AGE = @V_LIB_AGE@ -V_LIB_CURRENT = @V_LIB_CURRENT@ -V_LIB_REVISION = @V_LIB_REVISION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -pthread_lib = @pthread_lib@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -vorbisincludedir = $(includedir)/vorbis -vorbisinclude_HEADERS = codec.h vorbisfile.h vorbisenc.h -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/vorbis/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu include/vorbis/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-vorbisincludeHEADERS: $(vorbisinclude_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(vorbisincludedir)" || $(MKDIR_P) "$(DESTDIR)$(vorbisincludedir)" - @list='$(vorbisinclude_HEADERS)'; for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(vorbisincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(vorbisincludedir)/$$f'"; \ - $(vorbisincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(vorbisincludedir)/$$f"; \ - done - -uninstall-vorbisincludeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(vorbisinclude_HEADERS)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(vorbisincludedir)/$$f'"; \ - rm -f "$(DESTDIR)$(vorbisincludedir)/$$f"; \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(vorbisincludedir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: install-vorbisincludeHEADERS - -install-dvi: install-dvi-am - -install-exec-am: - -install-html: install-html-am - -install-info: install-info-am - -install-man: - -install-pdf: install-pdf-am - -install-ps: install-ps-am - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-vorbisincludeHEADERS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool ctags distclean distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip \ - install-vorbisincludeHEADERS installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ - ps ps-am tags uninstall uninstall-am \ - uninstall-vorbisincludeHEADERS - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/ExternalLibs/libvorbis-1.3.2/lib/lookups.pl b/ExternalLibs/libvorbis-1.3.2/lib/lookups.pl deleted file mode 100755 index bd92df7..0000000 --- a/ExternalLibs/libvorbis-1.3.2/lib/lookups.pl +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin/perl -print <<'EOD'; -/******************************************************************** - * * - * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. * - * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * - * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * - * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * - * * - * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2007 * - * by the Xiph.Org Foundation http://www.xiph.org/ * - * * - ******************************************************************** - - function: lookup data; generated by lookups.pl; edit there - last mod: $Id: lookups.pl 13293 2007-07-24 00:09:47Z xiphmont $ - - ********************************************************************/ - -#ifndef _V_LOOKUP_DATA_H_ - -#ifdef FLOAT_LOOKUP -EOD - -$cos_sz=128; -$invsq_sz=32; -$invsq2exp_min=-32; -$invsq2exp_max=32; - -$fromdB_sz=35; -$fromdB_shift=5; -$fromdB2_shift=3; - -$invsq_i_shift=10; -$cos_i_shift=9; -$delta_shift=6; - -print "#define COS_LOOKUP_SZ $cos_sz\n"; -print "static float COS_LOOKUP[COS_LOOKUP_SZ+1]={\n"; - -for($i=0;$i<=$cos_sz;){ - print "\t"; - for($j=0;$j<4 && $i<=$cos_sz;$j++){ - printf "%+.13f,", cos(3.14159265358979323846*($i++)/$cos_sz) ; - } - print "\n"; -} -print "};\n\n"; - -print "#define INVSQ_LOOKUP_SZ $invsq_sz\n"; -print "static float INVSQ_LOOKUP[INVSQ_LOOKUP_SZ+1]={\n"; - -for($i=0;$i<=$invsq_sz;){ - print "\t"; - for($j=0;$j<4 && $i<=$invsq_sz;$j++){ - my$indexmap=$i++/$invsq_sz*.5+.5; - printf "%.12f,", 1./sqrt($indexmap); - } - print "\n"; -} -print "};\n\n"; - -print "#define INVSQ2EXP_LOOKUP_MIN $invsq2exp_min\n"; -print "#define INVSQ2EXP_LOOKUP_MAX $invsq2exp_max\n"; -print "static float INVSQ2EXP_LOOKUP[INVSQ2EXP_LOOKUP_MAX-\\\n". - " INVSQ2EXP_LOOKUP_MIN+1]={\n"; - -for($i=$invsq2exp_min;$i<=$invsq2exp_max;){ - print "\t"; - for($j=0;$j<4 && $i<=$invsq2exp_max;$j++){ - printf "%15.10g,", 2**($i++*-.5); - } - print "\n"; -} -print "};\n\n#endif\n\n"; - - -# 0 to -140 dB -$fromdB2_sz=1<<$fromdB_shift; -$fromdB_gran=1<<($fromdB_shift-$fromdB2_shift); -print "#define FROMdB_LOOKUP_SZ $fromdB_sz\n"; -print "#define FROMdB2_LOOKUP_SZ $fromdB2_sz\n"; -print "#define FROMdB_SHIFT $fromdB_shift\n"; -print "#define FROMdB2_SHIFT $fromdB2_shift\n"; -print "#define FROMdB2_MASK ".((1<<$fromdB_shift)-1)."\n"; - -print "static float FROMdB_LOOKUP[FROMdB_LOOKUP_SZ]={\n"; - -for($i=0;$i<$fromdB_sz;){ - print "\t"; - for($j=0;$j<4 && $i<$fromdB_sz;$j++){ - printf "%15.10g,", 10**(.05*(-$fromdB_gran*$i++)); - } - print "\n"; -} -print "};\n\n"; - -print "static float FROMdB2_LOOKUP[FROMdB2_LOOKUP_SZ]={\n"; - -for($i=0;$i<$fromdB2_sz;){ - print "\t"; - for($j=0;$j<4 && $i<$fromdB_sz;$j++){ - printf "%15.10g,", 10**(.05*(-$fromdB_gran/$fromdB2_sz*(.5+$i++))); - } - print "\n"; -} -print "};\n\n#ifdef INT_LOOKUP\n\n"; - - -$iisz=0x10000>>$invsq_i_shift; -print "#define INVSQ_LOOKUP_I_SHIFT $invsq_i_shift\n"; -print "#define INVSQ_LOOKUP_I_MASK ".(0x0ffff>>(16-$invsq_i_shift))."\n"; -print "static long INVSQ_LOOKUP_I[$iisz+1]={\n"; -for($i=0;$i<=$iisz;){ - print "\t"; - for($j=0;$j<4 && $i<=$iisz;$j++){ - my$indexmap=$i++/$iisz*.5+.5; - printf "%8d,", int(1./sqrt($indexmap)*65536.+.5); - } - print "\n"; -} -print "};\n\n"; - -$cisz=0x10000>>$cos_i_shift; -print "#define COS_LOOKUP_I_SHIFT $cos_i_shift\n"; -print "#define COS_LOOKUP_I_MASK ".(0x0ffff>>(16-$cos_i_shift))."\n"; -print "#define COS_LOOKUP_I_SZ $cisz\n"; -print "static long COS_LOOKUP_I[COS_LOOKUP_I_SZ+1]={\n"; - -for($i=0;$i<=$cisz;){ - print "\t"; - for($j=0;$j<4 && $i<=$cisz;$j++){ - printf "%8d,", int(cos(3.14159265358979323846*($i++)/$cos_sz)*16384.+.5) ; - } - print "\n"; -} -print "};\n\n"; - - -print "#endif\n\n#endif\n"; - - diff --git a/ExternalLibs/libvorbis-1.3.2/COPYING b/ExternalLibs/libvorbis-1.3.3/COPYING similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/COPYING rename to ExternalLibs/libvorbis-1.3.3/COPYING diff --git a/ExternalLibs/libvorbis-1.3.2/include/vorbis/codec.h b/ExternalLibs/libvorbis-1.3.3/include/vorbis/codec.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/include/vorbis/codec.h rename to ExternalLibs/libvorbis-1.3.3/include/vorbis/codec.h diff --git a/ExternalLibs/libvorbis-1.3.2/include/vorbis/vorbisenc.h b/ExternalLibs/libvorbis-1.3.3/include/vorbis/vorbisenc.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/include/vorbis/vorbisenc.h rename to ExternalLibs/libvorbis-1.3.3/include/vorbis/vorbisenc.h diff --git a/ExternalLibs/libvorbis-1.3.2/include/vorbis/vorbisfile.h b/ExternalLibs/libvorbis-1.3.3/include/vorbis/vorbisfile.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/include/vorbis/vorbisfile.h rename to ExternalLibs/libvorbis-1.3.3/include/vorbis/vorbisfile.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/analysis.c b/ExternalLibs/libvorbis-1.3.3/lib/analysis.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/analysis.c rename to ExternalLibs/libvorbis-1.3.3/lib/analysis.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/backends.h b/ExternalLibs/libvorbis-1.3.3/lib/backends.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/backends.h rename to ExternalLibs/libvorbis-1.3.3/lib/backends.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/barkmel.c b/ExternalLibs/libvorbis-1.3.3/lib/barkmel.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/barkmel.c rename to ExternalLibs/libvorbis-1.3.3/lib/barkmel.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/bitrate.c b/ExternalLibs/libvorbis-1.3.3/lib/bitrate.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/bitrate.c rename to ExternalLibs/libvorbis-1.3.3/lib/bitrate.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/bitrate.h b/ExternalLibs/libvorbis-1.3.3/lib/bitrate.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/bitrate.h rename to ExternalLibs/libvorbis-1.3.3/lib/bitrate.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/block.c b/ExternalLibs/libvorbis-1.3.3/lib/block.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/block.c rename to ExternalLibs/libvorbis-1.3.3/lib/block.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/books/coupled/res_books_51.h b/ExternalLibs/libvorbis-1.3.3/lib/books/coupled/res_books_51.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/books/coupled/res_books_51.h rename to ExternalLibs/libvorbis-1.3.3/lib/books/coupled/res_books_51.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/books/coupled/res_books_stereo.h b/ExternalLibs/libvorbis-1.3.3/lib/books/coupled/res_books_stereo.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/books/coupled/res_books_stereo.h rename to ExternalLibs/libvorbis-1.3.3/lib/books/coupled/res_books_stereo.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/books/floor/floor_books.h b/ExternalLibs/libvorbis-1.3.3/lib/books/floor/floor_books.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/books/floor/floor_books.h rename to ExternalLibs/libvorbis-1.3.3/lib/books/floor/floor_books.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/books/uncoupled/res_books_uncoupled.h b/ExternalLibs/libvorbis-1.3.3/lib/books/uncoupled/res_books_uncoupled.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/books/uncoupled/res_books_uncoupled.h rename to ExternalLibs/libvorbis-1.3.3/lib/books/uncoupled/res_books_uncoupled.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/codebook.c b/ExternalLibs/libvorbis-1.3.3/lib/codebook.c similarity index 96% rename from ExternalLibs/libvorbis-1.3.2/lib/codebook.c rename to ExternalLibs/libvorbis-1.3.3/lib/codebook.c index 759d7b4..ecb8b68 100644 --- a/ExternalLibs/libvorbis-1.3.2/lib/codebook.c +++ b/ExternalLibs/libvorbis-1.3.3/lib/codebook.c @@ -11,7 +11,7 @@ ******************************************************************** function: basic codebook pack/unpack/code/decode operations - last mod: $Id: codebook.c 17553 2010-10-21 17:54:26Z tterribe $ + last mod: $Id: codebook.c 18183 2012-02-03 20:51:27Z xiphmont $ ********************************************************************/ @@ -248,7 +248,7 @@ static_codebook *vorbis_staticbook_unpack(oggpack_buffer *opb){ } /* quantized values */ - if((quantvals*s->q_quant+7>>3)>opb->storage-oggpack_bytes(opb)) + if(((quantvals*s->q_quant+7)>>3)>opb->storage-oggpack_bytes(opb)) goto _eofout; s->quantlist=_ogg_malloc(sizeof(*s->quantlist)*quantvals); for(i=0;iused_entries>0){ int step=n/book->dim; @@ -386,6 +387,7 @@ long vorbis_book_decodevs_add(codebook *book,float *a,oggpack_buffer *b,int n){ return(0); } +/* decode vector / dim granularity gaurding is done in the upper layer */ long vorbis_book_decodev_add(codebook *book,float *a,oggpack_buffer *b,int n){ if(book->used_entries>0){ int i,j,entry; @@ -431,6 +433,9 @@ long vorbis_book_decodev_add(codebook *book,float *a,oggpack_buffer *b,int n){ return(0); } +/* unlike the others, we guard against n not being an integer number + of internally rather than in the upper layer (called only by + floor0) */ long vorbis_book_decodev_set(codebook *book,float *a,oggpack_buffer *b,int n){ if(book->used_entries>0){ int i,j,entry; @@ -440,15 +445,15 @@ long vorbis_book_decodev_set(codebook *book,float *a,oggpack_buffer *b,int n){ entry = decode_packed_entry_number(book,b); if(entry==-1)return(-1); t = book->valuelist+entry*book->dim; - for (j=0;jdim;) + for (j=0;idim;){ a[i++]=t[j++]; + } } }else{ int i,j; for(i=0;idim;) - a[i++]=0.f; + a[i++]=0.f; } } return(0); diff --git a/ExternalLibs/libvorbis-1.3.2/lib/codebook.h b/ExternalLibs/libvorbis-1.3.3/lib/codebook.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/codebook.h rename to ExternalLibs/libvorbis-1.3.3/lib/codebook.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/codec_internal.h b/ExternalLibs/libvorbis-1.3.3/lib/codec_internal.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/codec_internal.h rename to ExternalLibs/libvorbis-1.3.3/lib/codec_internal.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/envelope.c b/ExternalLibs/libvorbis-1.3.3/lib/envelope.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/envelope.c rename to ExternalLibs/libvorbis-1.3.3/lib/envelope.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/envelope.h b/ExternalLibs/libvorbis-1.3.3/lib/envelope.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/envelope.h rename to ExternalLibs/libvorbis-1.3.3/lib/envelope.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/floor0.c b/ExternalLibs/libvorbis-1.3.3/lib/floor0.c similarity index 96% rename from ExternalLibs/libvorbis-1.3.2/lib/floor0.c rename to ExternalLibs/libvorbis-1.3.3/lib/floor0.c index 4c32e91..8e1985c 100644 --- a/ExternalLibs/libvorbis-1.3.2/lib/floor0.c +++ b/ExternalLibs/libvorbis-1.3.3/lib/floor0.c @@ -11,7 +11,7 @@ ******************************************************************** function: floor backend 0 implementation - last mod: $Id: floor0.c 17558 2010-10-22 00:24:41Z tterribe $ + last mod: $Id: floor0.c 18184 2012-02-03 20:55:12Z xiphmont $ ********************************************************************/ @@ -177,10 +177,9 @@ static void *floor0_inverse1(vorbis_block *vb,vorbis_look_floor *i){ vector */ float *lsp=_vorbis_block_alloc(vb,sizeof(*lsp)*(look->m+b->dim+1)); - for(j=0;jm;j+=b->dim) - if(vorbis_book_decodev_set(b,lsp+j,&vb->opb,b->dim)==-1)goto eop; + if(vorbis_book_decodev_set(b,lsp,&vb->opb,look->m)==-1)goto eop; for(j=0;jm;){ - for(k=0;kdim;k++,j++)lsp[j]+=last; + for(k=0;jm && kdim;k++,j++)lsp[j]+=last; last=lsp[j-1]; } diff --git a/ExternalLibs/libvorbis-1.3.2/lib/floor1.c b/ExternalLibs/libvorbis-1.3.3/lib/floor1.c similarity index 99% rename from ExternalLibs/libvorbis-1.3.2/lib/floor1.c rename to ExternalLibs/libvorbis-1.3.3/lib/floor1.c index 9f3154a..d5c7ebf 100644 --- a/ExternalLibs/libvorbis-1.3.2/lib/floor1.c +++ b/ExternalLibs/libvorbis-1.3.3/lib/floor1.c @@ -11,7 +11,7 @@ ******************************************************************** function: floor backend 1 implementation - last mod: $Id: floor1.c 17555 2010-10-21 18:14:51Z tterribe $ + last mod: $Id: floor1.c 18151 2012-01-20 07:35:26Z xiphmont $ ********************************************************************/ @@ -167,6 +167,7 @@ static vorbis_info_floor *floor1_unpack (vorbis_info *vi,oggpack_buffer *opb){ for(j=0,k=0;jpartitions;j++){ count+=info->class_dim[info->partitionclass[j]]; + if(count>VIF_POSIT) goto err_out; for(;kpostlist[k+2]=oggpack_read(opb,rangebits); if(t<0 || t>=(1<loneighbor[i-2]]&=0x7fff; fit_value[look->hineighbor[i-2]]&=0x7fff; diff --git a/ExternalLibs/libvorbis-1.3.2/lib/highlevel.h b/ExternalLibs/libvorbis-1.3.3/lib/highlevel.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/highlevel.h rename to ExternalLibs/libvorbis-1.3.3/lib/highlevel.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/info.c b/ExternalLibs/libvorbis-1.3.3/lib/info.c similarity index 98% rename from ExternalLibs/libvorbis-1.3.2/lib/info.c rename to ExternalLibs/libvorbis-1.3.3/lib/info.c index 3932480..9e944c3 100644 --- a/ExternalLibs/libvorbis-1.3.2/lib/info.c +++ b/ExternalLibs/libvorbis-1.3.3/lib/info.c @@ -11,7 +11,7 @@ ******************************************************************** function: maintain the info structure, info <-> header packets - last mod: $Id: info.c 17584 2010-11-01 19:26:16Z xiphmont $ + last mod: $Id: info.c 18186 2012-02-03 22:08:44Z xiphmont $ ********************************************************************/ @@ -31,8 +31,8 @@ #include "misc.h" #include "os.h" -#define GENERAL_VENDOR_STRING "Xiph.Org libVorbis 1.3.2" -#define ENCODE_VENDOR_STRING "Xiph.Org libVorbis I 20101101 (Schaufenugget)" +#define GENERAL_VENDOR_STRING "Xiph.Org libVorbis 1.3.3" +#define ENCODE_VENDOR_STRING "Xiph.Org libVorbis I 20120203 (Omnipresent)" /* helpers */ static int ilog2(unsigned int v){ @@ -550,7 +550,10 @@ int vorbis_commentheader_out(vorbis_comment *vc, oggpack_buffer opb; oggpack_writeinit(&opb); - if(_vorbis_pack_comment(&opb,vc)) return OV_EIMPL; + if(_vorbis_pack_comment(&opb,vc)){ + oggpack_writeclear(&opb); + return OV_EIMPL; + } op->packet = _ogg_malloc(oggpack_bytes(&opb)); memcpy(op->packet, opb.buffer, oggpack_bytes(&opb)); @@ -561,6 +564,7 @@ int vorbis_commentheader_out(vorbis_comment *vc, op->granulepos=0; op->packetno=1; + oggpack_writeclear(&opb); return 0; } diff --git a/ExternalLibs/libvorbis-1.3.2/lib/lookup.c b/ExternalLibs/libvorbis-1.3.3/lib/lookup.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/lookup.c rename to ExternalLibs/libvorbis-1.3.3/lib/lookup.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/lookup.h b/ExternalLibs/libvorbis-1.3.3/lib/lookup.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/lookup.h rename to ExternalLibs/libvorbis-1.3.3/lib/lookup.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/lookup_data.h b/ExternalLibs/libvorbis-1.3.3/lib/lookup_data.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/lookup_data.h rename to ExternalLibs/libvorbis-1.3.3/lib/lookup_data.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/lpc.c b/ExternalLibs/libvorbis-1.3.3/lib/lpc.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/lpc.c rename to ExternalLibs/libvorbis-1.3.3/lib/lpc.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/lpc.h b/ExternalLibs/libvorbis-1.3.3/lib/lpc.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/lpc.h rename to ExternalLibs/libvorbis-1.3.3/lib/lpc.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/lsp.c b/ExternalLibs/libvorbis-1.3.3/lib/lsp.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/lsp.c rename to ExternalLibs/libvorbis-1.3.3/lib/lsp.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/lsp.h b/ExternalLibs/libvorbis-1.3.3/lib/lsp.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/lsp.h rename to ExternalLibs/libvorbis-1.3.3/lib/lsp.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/mapping0.c b/ExternalLibs/libvorbis-1.3.3/lib/mapping0.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/mapping0.c rename to ExternalLibs/libvorbis-1.3.3/lib/mapping0.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/masking.h b/ExternalLibs/libvorbis-1.3.3/lib/masking.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/masking.h rename to ExternalLibs/libvorbis-1.3.3/lib/masking.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/mdct.c b/ExternalLibs/libvorbis-1.3.3/lib/mdct.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/mdct.c rename to ExternalLibs/libvorbis-1.3.3/lib/mdct.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/mdct.h b/ExternalLibs/libvorbis-1.3.3/lib/mdct.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/mdct.h rename to ExternalLibs/libvorbis-1.3.3/lib/mdct.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/misc.h b/ExternalLibs/libvorbis-1.3.3/lib/misc.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/misc.h rename to ExternalLibs/libvorbis-1.3.3/lib/misc.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/floor_all.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/floor_all.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/floor_all.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/floor_all.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/psych_11.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/psych_11.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/psych_11.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/psych_11.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/psych_16.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/psych_16.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/psych_16.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/psych_16.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/psych_44.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/psych_44.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/psych_44.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/psych_44.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/psych_8.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/psych_8.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/psych_8.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/psych_8.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/residue_16.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/residue_16.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/residue_16.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/residue_16.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/residue_44.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/residue_44.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/residue_44.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/residue_44.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/residue_44p51.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/residue_44p51.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/residue_44p51.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/residue_44p51.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/residue_44u.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/residue_44u.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/residue_44u.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/residue_44u.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/residue_8.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/residue_8.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/residue_8.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/residue_8.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/setup_11.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/setup_11.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/setup_11.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/setup_11.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/setup_16.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/setup_16.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/setup_16.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/setup_16.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/setup_22.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/setup_22.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/setup_22.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/setup_22.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/setup_32.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/setup_32.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/setup_32.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/setup_32.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/setup_44.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/setup_44.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/setup_44.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/setup_44.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/setup_44p51.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/setup_44p51.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/setup_44p51.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/setup_44p51.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/setup_44u.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/setup_44u.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/setup_44u.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/setup_44u.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/setup_8.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/setup_8.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/setup_8.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/setup_8.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/modes/setup_X.h b/ExternalLibs/libvorbis-1.3.3/lib/modes/setup_X.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/modes/setup_X.h rename to ExternalLibs/libvorbis-1.3.3/lib/modes/setup_X.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/os.h b/ExternalLibs/libvorbis-1.3.3/lib/os.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/os.h rename to ExternalLibs/libvorbis-1.3.3/lib/os.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/psy.c b/ExternalLibs/libvorbis-1.3.3/lib/psy.c similarity index 99% rename from ExternalLibs/libvorbis-1.3.2/lib/psy.c rename to ExternalLibs/libvorbis-1.3.3/lib/psy.c index 9a86151..f7a44c6 100644 --- a/ExternalLibs/libvorbis-1.3.2/lib/psy.c +++ b/ExternalLibs/libvorbis-1.3.3/lib/psy.c @@ -11,7 +11,7 @@ ******************************************************************** function: psychoacoustics not including preecho - last mod: $Id: psy.c 17569 2010-10-26 17:09:47Z xiphmont $ + last mod: $Id: psy.c 18077 2011-09-02 02:49:00Z giles $ ********************************************************************/ @@ -1020,7 +1020,9 @@ void _vp_couple_quantize_normalize(int blobno, int limit = g->coupling_pointlimit[p->vi->blockflag][blobno]; float prepoint=stereo_threshholds[g->coupling_prepointamp[blobno]]; float postpoint=stereo_threshholds[g->coupling_postpointamp[blobno]]; +#if 0 float de=0.1*p->m_val; /* a blend of the AoTuV M2 and M3 code here and below */ +#endif /* mdct is our raw mdct output, floor not removed. */ /* inout passes in the ifloor, passes back quantized result */ @@ -1154,27 +1156,28 @@ void _vp_couple_quantize_normalize(int blobno, reM[j] += reA[j]; qeM[j] = fabs(reM[j]); }else{ +#if 0 /* AoTuV */ /** @ M2 ** The boost problem by the combination of noise normalization and point stereo is eased. However, this is a temporary patch. by Aoyumi @ 2004/04/18 */ - /*float derate = (1.0 - de*((float)(j-limit+i) / (float)(n-limit))); - /* elliptical + float derate = (1.0 - de*((float)(j-limit+i) / (float)(n-limit))); + /* elliptical */ if(reM[j]+reA[j]<0){ reM[j] = - (qeM[j] = (fabs(reM[j])+fabs(reA[j]))*derate*derate); }else{ reM[j] = (qeM[j] = (fabs(reM[j])+fabs(reA[j]))*derate*derate); - }*/ - + } +#else /* elliptical */ if(reM[j]+reA[j]<0){ reM[j] = - (qeM[j] = fabs(reM[j])+fabs(reA[j])); }else{ reM[j] = (qeM[j] = fabs(reM[j])+fabs(reA[j])); } - +#endif } reA[j]=qeA[j]=0.f; diff --git a/ExternalLibs/libvorbis-1.3.2/lib/psy.h b/ExternalLibs/libvorbis-1.3.3/lib/psy.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/psy.h rename to ExternalLibs/libvorbis-1.3.3/lib/psy.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/psytune.c b/ExternalLibs/libvorbis-1.3.3/lib/psytune.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/psytune.c rename to ExternalLibs/libvorbis-1.3.3/lib/psytune.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/registry.c b/ExternalLibs/libvorbis-1.3.3/lib/registry.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/registry.c rename to ExternalLibs/libvorbis-1.3.3/lib/registry.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/registry.h b/ExternalLibs/libvorbis-1.3.3/lib/registry.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/registry.h rename to ExternalLibs/libvorbis-1.3.3/lib/registry.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/res0.c b/ExternalLibs/libvorbis-1.3.3/lib/res0.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/res0.c rename to ExternalLibs/libvorbis-1.3.3/lib/res0.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/scales.h b/ExternalLibs/libvorbis-1.3.3/lib/scales.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/scales.h rename to ExternalLibs/libvorbis-1.3.3/lib/scales.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/sharedbook.c b/ExternalLibs/libvorbis-1.3.3/lib/sharedbook.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/sharedbook.c rename to ExternalLibs/libvorbis-1.3.3/lib/sharedbook.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/smallft.c b/ExternalLibs/libvorbis-1.3.3/lib/smallft.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/smallft.c rename to ExternalLibs/libvorbis-1.3.3/lib/smallft.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/smallft.h b/ExternalLibs/libvorbis-1.3.3/lib/smallft.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/smallft.h rename to ExternalLibs/libvorbis-1.3.3/lib/smallft.h diff --git a/ExternalLibs/libvorbis-1.3.2/lib/synthesis.c b/ExternalLibs/libvorbis-1.3.3/lib/synthesis.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/synthesis.c rename to ExternalLibs/libvorbis-1.3.3/lib/synthesis.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/tone.c b/ExternalLibs/libvorbis-1.3.3/lib/tone.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/tone.c rename to ExternalLibs/libvorbis-1.3.3/lib/tone.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/vorbisenc.c b/ExternalLibs/libvorbis-1.3.3/lib/vorbisenc.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/vorbisenc.c rename to ExternalLibs/libvorbis-1.3.3/lib/vorbisenc.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/vorbisfile.c b/ExternalLibs/libvorbis-1.3.3/lib/vorbisfile.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/vorbisfile.c rename to ExternalLibs/libvorbis-1.3.3/lib/vorbisfile.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/window.c b/ExternalLibs/libvorbis-1.3.3/lib/window.c similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/window.c rename to ExternalLibs/libvorbis-1.3.3/lib/window.c diff --git a/ExternalLibs/libvorbis-1.3.2/lib/window.h b/ExternalLibs/libvorbis-1.3.3/lib/window.h similarity index 100% rename from ExternalLibs/libvorbis-1.3.2/lib/window.h rename to ExternalLibs/libvorbis-1.3.3/lib/window.h diff --git a/ExternalLibs/ttvfs/VFSTools.cpp b/ExternalLibs/ttvfs/VFSTools.cpp index 5bb5e03..6a34e28 100644 --- a/ExternalLibs/ttvfs/VFSTools.cpp +++ b/ExternalLibs/ttvfs/VFSTools.cpp @@ -17,8 +17,12 @@ # define WIN32_LEAN_AND_MEAN # include #else +# ifdef __HAIKU__ +# include +# else # include -# include +# endif +# include #endif #include @@ -49,6 +53,7 @@ void makeUppercase(std::string& s) } #if !_WIN32 +#ifdef DT_DIR static bool _IsFile(const char *path, dirent *dp) { switch(dp->d_type) @@ -93,6 +98,35 @@ static bool _IsDir(const char *path, dirent *dp) } return false; } + +#else // No DT_DIR, assume plain POSIX + +static bool _IsDir(const char *path, dirent *dp) +{ + const int len1 = strlen(path); + const int len2 = strlen(dp->d_name); + + char *pathname = (char*)alloca(len1 + 1 + len2 + 1 + 13); + strcpy (pathname, path); + + /* Avoid UNC-path "//name" on Cygwin. */ + if (len1 > 0 && pathname[len1 - 1] != '/') + strcat (pathname, "/"); + + strcat (pathname, dp->d_name); + + struct stat st; + if (stat (pathname, &st)) + return false; + return S_ISDIR (st.st_mode); +} + +static bool _IsFile(const char *path, dirent *dp) +{ + return !_IsDir(path, dp); +} +#endif + #endif // returns list of *plain* file names in given directory, diff --git a/files/data/achievements.txt b/files/data/achievements.txt new file mode 100644 index 0000000..e1a2182 --- /dev/null +++ b/files/data/achievements.txt @@ -0,0 +1,54 @@ +Super Chef +Find all the recipes in the game. +Mass Transit +Find all the Ancient Turtles. +Explorer +Travel to all the areas of Aquaria. +Healthy +Find all the health eggs. +Songstress +Learn all the songs in Aquaria. +Spirit Battle +Defeat the Priests. +Octogone +Defeat Octomun. +Rock Crab Rocked +Defeat the Rock Crab. +Boom Shrimp +Defeat the Mantis Shrimp. +Dethroned King Jelly +Defeat the King Jelly. +A New Chapter... +Reach Open Waters. +Dance Of The Forest Sprites +Reach the Sprite Cave. +Passed Through +Reach the Veil. +Romance +??? +Gullet +Enter the belly of the Whale. +Weird Fish +Discover two peculiar-looking fish... +North Pole +Reach the Frozen Veil. +Divorce +Defeat Mom and Dad. +Uniter +Rescue all the lost souls. +Bucking Bronco +Ride Ekkrit for a minute. +Combo Eater +Devour 6 creatues in a row. +Feather-mouth +Devour a Parrot. +Monkey Flinger +Fling a Monkey. +No Escape +Kill the Coward. +High Dive +Dive into the water from a certain high location... +Speed Racer +Beat the Arnassi race in less than a minute. +Mergog Defeated +Defeat Mergog diff --git a/files/data/stringbank.txt b/files/data/stringbank.txt index 21df031..55fc6b0 100644 --- a/files/data/stringbank.txt +++ b/files/data/stringbank.txt @@ -205,4 +205,34 @@ 2029 |Browse mods online 2030 |Return to title 2031 Any -2032 [Achievements] \ No newline at end of file +2032 [Achievements] +2033 Retrieving online mod list... +2100 === for options menu === +2101 Action +2102 Key 1 +2103 Key 2 +2104 Joystick +2105 Left Mouse Equiv. +2106 Right Mouse Equiv. +2107 Action 1: Swim +2108 Action 2: Sing/Ability +2109 Swim Up +2110 Swim Down +2111 Swim Left +2112 Swim Right +2113 Roll +2114 Revert +2115 WorldMap/Recipes +2116 Menu/Escape +2117 Stick 1 X +2118 Stick 1 Y +2119 Stick 2 X +2120 Stick 2 Y +2121 Prev Page +2122 Next Page +2123 Food Menu Cook +2124 Food Left +2125 Food Right +2126 Food Drop +2127 Look +2128 Help \ No newline at end of file diff --git a/files/locales/ru/data/font-small.glf b/files/locales/ru/data/font-small.glf index c1a60df..e14cded 100644 Binary files a/files/locales/ru/data/font-small.glf and b/files/locales/ru/data/font-small.glf differ diff --git a/files/locales/ru/data/songs.xml b/files/locales/ru/data/songs.xml new file mode 100644 index 0000000..76a5322 --- /dev/null +++ b/files/locales/ru/data/songs.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/files/locales/ru/data/stringbank.txt b/files/locales/ru/data/stringbank.txt index 444a55f..d02df06 100644 --- a/files/locales/ru/data/stringbank.txt +++ b/files/locales/ru/data/stringbank.txt @@ -181,27 +181,48 @@ 2005 'S' - пропустить 2006 Стр. 2007 Рецепты -2008 error -2009 No Description -2010 Stopped Recording -2011 Stopped Playback -2013 health -2014 Enter Flag to Set -2015 Enter Value to Set Flag To -2016 Entity data not found! Aborting... -2017 Variables data not found! Aborting... -2018 Particle Name: -2019 Saved worldmap data to -2020 Unable to save worldmap to -2021 Unable to retrieve online mod list.|Check your connection and try again. -2022 Server error!|Bad XML, please contact server admin.|URL: -2023 Finished downloading mod -2024 Download update? -2025 Mod already exists. Re-download? -2026 This mod was installed manually,|not messing with it. -2027 |Browse installed mods -2028 |Browse & enable/disable installed patches -2029 |Browse mods online -2030 |Return to title -2031 Что -2032 [Achievements] \ No newline at end of file +2008 ошибка +2009 Нет описания +2013 здоровье +2021 Не удается получить онлайн список модов.|Проверьте ваше соединение и попробуйте снова. +2022 Ошибка на сервере! Неправильный XML, пожалуйста, обратитесь к администратору сервера.|Ссылка: +2023 Загрузка мода завершена +2024 Загрузить обновление? +2025 Мод уже скачан. Перекачать? +2026 Мод установлен вручную,|ничего не изменено +2027 |Просмотреть установленные моды +2028 |Просмотр и включение/выключение установленных патчей +2029 |Просмотреть моды онлайн +2030 |Вернуться в главное меню +2031 Любой(е) +2032 [Достижения] +2033 Получение списка модов онлайн... +2100 === для меню настроек === +2101 Действие +2102 Клавиша 1 +2103 Клавиша 2 +2104 Джойстик +2105 Аналог левой кнопки мыши +2106 Аналог правой кнопки мыши +2107 Действие 1: Плавание +2108 Действие 2: Пение/Умение +2109 Плыть вверх +2110 Плыть вниз +2111 Плыть влево +2112 Плыть вправо +2113 Вращение +2114 Первоначальная форма +2115 Карта мира/Рецепты +2116 Меню/Выход +2117 Стик 1 X +2118 Стик 1 Y +2119 Стик 2 X +2120 Стик 2 Y +2121 Предыдущая страница +2122 Следующая страница +2123 Меню приготовления еды +2124 Положить ингредиент +2125 Убрать ингредиент +2126 Выбросить ингредиент +2127 Осмотреться +2128 Помощь \ No newline at end of file diff --git a/files/locales/ru/gfx/font.png b/files/locales/ru/gfx/font.png index e9372b1..9adae9f 100644 Binary files a/files/locales/ru/gfx/font.png and b/files/locales/ru/gfx/font.png differ diff --git a/tools/Makefile b/tools/Makefile new file mode 100644 index 0000000..0e27b27 --- /dev/null +++ b/tools/Makefile @@ -0,0 +1,10 @@ +CC=gcc + +CFLAGS=-Wall -pedantic -pipe -O2 + +.PHONY: all + +all: glfpatch + +glfpatch: glfpatch.c + ${CC} ${CFLAGS} -o $@ $< diff --git a/tools/glfpatch.c b/tools/glfpatch.c new file mode 100644 index 0000000..76e2b2c --- /dev/null +++ b/tools/glfpatch.c @@ -0,0 +1,70 @@ +/* Conversion utility to hackpatch glf files. */ + +#include +#include +#include + +typedef struct +{ + float dx, dy; + float tx1, ty1; + float tx2, ty2; +} GLFontChar; + +typedef struct +{ + unsigned int tex; /* tex id, unused */ + unsigned int tw; /* tex width */ + unsigned int th; /* tex height */ + unsigned int sc; /* start char number */ + unsigned int ec; /* end char number */ + unsigned int chrs; /* chars cound, unused*/ +} GLFontHeader; + +#define CHR_SIZE_KOEFF_X 8.8f/256.0f +#define CHR_SIZE_KOEFF_Y 10.0f/256.0f + +int main(int argc, char **argv) +{ + unsigned int i, num_chars; + GLFontChar cc; + GLFontHeader h; + FILE *in, *out; + + + in = fopen("in.glf", "rb"); + out = fopen("out.glf", "wb"); + + if(!(in && out)) + return 1; + + fread(&h, 1, sizeof(h), in); + + /* Fix it. */ + h.tw *= 2; + h.th *= 2; + + fwrite(&h, 1, sizeof(h), out); + + num_chars = h.ec - h.sc + 1; + + + for(i = 0; i < num_chars; ++i) + { + fread(&cc, 1, sizeof(cc), in); + + /* Fix it. */ + cc.dx *= CHR_SIZE_KOEFF_X; + cc.dy *= CHR_SIZE_KOEFF_Y; + + fwrite(&cc, 1, sizeof(cc), out); + } + + /* We don't write actual image data. */ + + fclose(in); + fclose(out); + + return 0; +} + diff --git a/win/vc90/Aquaria.vcproj b/win/vc90/Aquaria.vcproj index ccd1d17..70f7568 100644 --- a/win/vc90/Aquaria.vcproj +++ b/win/vc90/Aquaria.vcproj @@ -41,10 +41,10 @@ @@ -1347,15 +1347,15 @@ Name="libvorbis" >