mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-07-03 06:24:32 +00:00
Merge branch 'master' of file:///Users/User/code/coding/Aquaria_fg_clean
This commit is contained in:
commit
ecbf727078
181 changed files with 1508 additions and 2384 deletions
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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/BitmapFont.h"
|
||||||
#include "../BBGE/Quad.h"
|
#include "../BBGE/Quad.h"
|
||||||
|
@ -257,3 +258,4 @@ protected:
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef AQUARIAPROGRESSBAR_H
|
||||||
|
#define AQUARIAPROGRESSBAR_H
|
||||||
|
|
||||||
#include "../BBGE/Quad.h"
|
#include "../BBGE/Quad.h"
|
||||||
|
|
||||||
|
@ -34,3 +35,4 @@ protected:
|
||||||
float perc;
|
float perc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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/ActionMapper.h"
|
||||||
#include "../BBGE/RenderObject.h"
|
#include "../BBGE/RenderObject.h"
|
||||||
|
|
||||||
|
@ -47,3 +49,4 @@ protected:
|
||||||
void onRender();
|
void onRender();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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/Particles.h"
|
||||||
#include "../BBGE/BitmapFont.h"
|
#include "../BBGE/BitmapFont.h"
|
||||||
|
@ -544,6 +545,4 @@ protected:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef COLLIDEENTITY_H
|
||||||
|
#define COLLIDEENTITY_H
|
||||||
|
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
|
|
||||||
|
@ -41,3 +42,5 @@ protected:
|
||||||
void bounce(float ba);
|
void bounce(float ba);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -871,10 +871,21 @@ void Continuity::loadTreasureData()
|
||||||
{
|
{
|
||||||
treasureData.clear();
|
treasureData.clear();
|
||||||
|
|
||||||
std::string line, gfx;
|
std::string line, gfx, file;
|
||||||
int num, use;
|
int num, use;
|
||||||
float sz;
|
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))
|
while (std::getline(in2, line))
|
||||||
{
|
{
|
||||||
std::istringstream is(line);
|
std::istringstream is(line);
|
||||||
|
@ -2542,12 +2553,25 @@ void Continuity::loadFileData(int slot, TiXmlDocument &doc)
|
||||||
void Continuity::loadFile(int slot)
|
void Continuity::loadFile(int slot)
|
||||||
{
|
{
|
||||||
dsq->user.save();
|
dsq->user.save();
|
||||||
this->reset();
|
|
||||||
knowsSong.clear(); // Adds shield song by default, which interferes with mods that don't start with it
|
|
||||||
|
|
||||||
TiXmlDocument doc;
|
TiXmlDocument doc;
|
||||||
loadFileData(slot, 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;
|
int versionMajor=-1, versionMinor=-1, versionRevision=-1;
|
||||||
TiXmlElement *xmlVersion = doc.FirstChildElement("Version");
|
TiXmlElement *xmlVersion = doc.FirstChildElement("Version");
|
||||||
if (xmlVersion)
|
if (xmlVersion)
|
||||||
|
@ -2786,7 +2810,6 @@ void Continuity::loadFile(int slot)
|
||||||
e2 = e2->NextSiblingElement("StringFlag");
|
e2 = e2->NextSiblingElement("StringFlag");
|
||||||
}
|
}
|
||||||
|
|
||||||
TiXmlElement *startData = doc.FirstChildElement("StartData");
|
|
||||||
if (startData)
|
if (startData)
|
||||||
{
|
{
|
||||||
int x = atoi(startData->Attribute("x"));
|
int x = atoi(startData->Attribute("x"));
|
||||||
|
@ -2800,15 +2823,6 @@ void Continuity::loadFile(int slot)
|
||||||
//dsq->continuity.naijaModel = startData->Attribute("naijaModel");
|
//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"))
|
if (startData->Attribute("form"))
|
||||||
{
|
{
|
||||||
dsq->continuity.form = FormType(atoi(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->sceneToLoad = startData->Attribute("scene");
|
||||||
//dsq->game->transitionToScene();
|
//dsq->game->transitionToScene();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Possibly mod-specific data the the continuity reset didn't catch
|
|
||||||
loadSongBank();
|
|
||||||
this->worldMap.load();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Continuity::setNaijaModel(std::string model)
|
void Continuity::setNaijaModel(std::string model)
|
||||||
|
@ -3238,6 +3248,7 @@ void Continuity::reset()
|
||||||
worldMap.load();
|
worldMap.load();
|
||||||
|
|
||||||
ingredients.clear();
|
ingredients.clear();
|
||||||
|
naijaEats.clear();
|
||||||
|
|
||||||
foodSortType = 0;
|
foodSortType = 0;
|
||||||
|
|
||||||
|
|
|
@ -300,7 +300,18 @@ void DSQ::newGame()
|
||||||
|
|
||||||
void DSQ::loadElementEffects()
|
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();
|
elementEffects.clear();
|
||||||
std::string line;
|
std::string line;
|
||||||
while (std::getline(inFile, 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);
|
float asp = float(user.video.resx)/float(user.video.resy);
|
||||||
|
|
||||||
|
if(asp < 1.0f)
|
||||||
if (asp >= 1.0f && asp < 1.8f)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << "Aspect ratio for resolution [" << user.video.resx << ", " << user.video.resy << "] not supported.";
|
os << "Aspect ratio for resolution [" << user.video.resx << ", " << user.video.resy << "] not supported.";
|
||||||
|
|
|
@ -177,6 +177,14 @@ enum MenuPage
|
||||||
MENUPAGE_PETS = 3
|
MENUPAGE_PETS = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum WorldMapRevealMethod
|
||||||
|
{
|
||||||
|
REVEAL_UNSPECIFIED = -1,
|
||||||
|
REVEAL_DEFAULT = 0,
|
||||||
|
REVEAL_PARTIAL = 1 // Not visited areas have zero alpha (invisible)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
class Title;
|
class Title;
|
||||||
class GameOver;
|
class GameOver;
|
||||||
|
@ -200,7 +208,7 @@ public:
|
||||||
StringBank();
|
StringBank();
|
||||||
void load();
|
void load();
|
||||||
|
|
||||||
std::string get(int idx);
|
const std::string& get(int idx);
|
||||||
protected:
|
protected:
|
||||||
void _load(const std::string &file);
|
void _load(const std::string &file);
|
||||||
|
|
||||||
|
@ -258,15 +266,15 @@ public:
|
||||||
|
|
||||||
void recache();
|
void recache();
|
||||||
|
|
||||||
std::string getBaseModPath();
|
const std::string& getBaseModPath() const;
|
||||||
|
|
||||||
bool isActive();
|
bool isActive();
|
||||||
bool isDebugMenu();
|
bool isDebugMenu();
|
||||||
bool hasWorldMap();
|
bool hasWorldMap();
|
||||||
bool isEditorBlocked();
|
bool isEditorBlocked();
|
||||||
|
|
||||||
std::string getPath();
|
const std::string& getPath() const;
|
||||||
std::string getName();
|
const std::string& getName() const;
|
||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
bool isShuttingDown();
|
bool isShuttingDown();
|
||||||
|
@ -274,6 +282,8 @@ public:
|
||||||
static bool loadModXML(TiXmlDocument *d, std::string modName);
|
static bool loadModXML(TiXmlDocument *d, std::string modName);
|
||||||
static ModType getTypeFromXML(TiXmlElement *xml);
|
static ModType getTypeFromXML(TiXmlElement *xml);
|
||||||
|
|
||||||
|
WorldMapRevealMethod mapRevealMethod;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool shuttingDown;
|
bool shuttingDown;
|
||||||
bool active;
|
bool active;
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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/AnimatedSprite.h"
|
||||||
#include "../BBGE/StateMachine.h"
|
#include "../BBGE/StateMachine.h"
|
||||||
|
@ -606,3 +607,4 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef FLOCKENTITY_H
|
||||||
|
#define FLOCKENTITY_H
|
||||||
|
|
||||||
#include "CollideEntity.h"
|
#include "CollideEntity.h"
|
||||||
|
|
||||||
|
@ -67,3 +68,5 @@ protected:
|
||||||
FlockEntity *nearestFlockMate;
|
FlockEntity *nearestFlockMate;
|
||||||
float nearestDistance;
|
float nearestDistance;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
107
Aquaria/Game.cpp
107
Aquaria/Game.cpp
|
@ -3577,48 +3577,49 @@ void Game::createInGameMenu()
|
||||||
group_keyConfig->addChild(kcb, PM_POINTER);
|
group_keyConfig->addChild(kcb, PM_POINTER);
|
||||||
|
|
||||||
int offy = -20;
|
int offy = -20;
|
||||||
|
|
||||||
|
#define SB(x) dsq->continuity.stringBank.get(x)
|
||||||
|
|
||||||
TTFText *header_action = new TTFText(&dsq->fontArialSmall);
|
TTFText *header_action = new TTFText(&dsq->fontArialSmall);
|
||||||
header_action->setText("Action");
|
header_action->setText(SB(2101));
|
||||||
header_action->position = Vector(140, 80+offy);
|
header_action->position = Vector(140, 80+offy);
|
||||||
group_keyConfig->addChild(header_action, PM_POINTER);
|
group_keyConfig->addChild(header_action, PM_POINTER);
|
||||||
|
|
||||||
TTFText *header_key1 = new TTFText(&dsq->fontArialSmall);
|
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->position = Vector(350, 80+offy);
|
||||||
header_key1->setAlign(ALIGN_CENTER);
|
header_key1->setAlign(ALIGN_CENTER);
|
||||||
group_keyConfig->addChild(header_key1, PM_POINTER);
|
group_keyConfig->addChild(header_key1, PM_POINTER);
|
||||||
|
|
||||||
TTFText *header_key2 = new TTFText(&dsq->fontArialSmall);
|
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->position = Vector(475, 80+offy);
|
||||||
header_key2->setAlign(ALIGN_CENTER);
|
header_key2->setAlign(ALIGN_CENTER);
|
||||||
group_keyConfig->addChild(header_key2, PM_POINTER);
|
group_keyConfig->addChild(header_key2, PM_POINTER);
|
||||||
|
|
||||||
TTFText *header_joy = new TTFText(&dsq->fontArialSmall);
|
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->position = Vector(600, 80+offy);
|
||||||
header_joy->setAlign(ALIGN_CENTER);
|
header_joy->setAlign(ALIGN_CENTER);
|
||||||
group_keyConfig->addChild(header_joy, PM_POINTER);
|
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);
|
AquariaKeyConfig* s1x = addAxesConfigLine(group_keyConfig, SB(2117), "s1ax", 340+offy, 0);
|
||||||
addKeyConfigLine(group_keyConfig, "Right Mouse Equiv.", "rmb", 120+offy, 0, 0, 0);
|
AquariaKeyConfig* s1y = addAxesConfigLine(group_keyConfig, SB(2118), "s1ay", 340+offy, 130);
|
||||||
addKeyConfigLine(group_keyConfig, "Action 1: Swim", "PrimaryAction", 140+offy);
|
AquariaKeyConfig* s2x = addAxesConfigLine(group_keyConfig, SB(2119), "s2ax", 340+offy, 260);
|
||||||
addKeyConfigLine(group_keyConfig, "Action 2: Sing/Ability", "SecondaryAction", 160+offy);
|
AquariaKeyConfig* s2y = addAxesConfigLine(group_keyConfig, SB(2120), "s2ay", 340+offy, 380);
|
||||||
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);
|
|
||||||
|
|
||||||
s1x->setDirMove(DIR_LEFT, s1x);
|
s1x->setDirMove(DIR_LEFT, s1x);
|
||||||
s1x->setDirMove(DIR_RIGHT, s1y);
|
s1x->setDirMove(DIR_RIGHT, s1y);
|
||||||
|
@ -3634,18 +3635,18 @@ void Game::createInGameMenu()
|
||||||
|
|
||||||
offy += 20;
|
offy += 20;
|
||||||
|
|
||||||
addKeyConfigLine(group_keyConfig, "Prev Page", "PrevPage", 340+offy);
|
addKeyConfigLine(group_keyConfig, SB(2121), "PrevPage", 340+offy);
|
||||||
addKeyConfigLine(group_keyConfig, "Next Page", "NextPage", 360+offy);
|
addKeyConfigLine(group_keyConfig, SB(2122), "NextPage", 360+offy);
|
||||||
addKeyConfigLine(group_keyConfig, "Food Menu Cook", "CookFood", 380+offy);
|
addKeyConfigLine(group_keyConfig, SB(2123), "CookFood", 380+offy);
|
||||||
addKeyConfigLine(group_keyConfig, "Food Left", "FoodLeft", 400+offy);
|
addKeyConfigLine(group_keyConfig, SB(2124), "FoodLeft", 400+offy);
|
||||||
addKeyConfigLine(group_keyConfig, "Food Right", "FoodRight", 420+offy);
|
addKeyConfigLine(group_keyConfig, SB(2125), "FoodRight", 420+offy);
|
||||||
addKeyConfigLine(group_keyConfig, "Food Drop", "FoodDrop", 440+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->shareAlphaWithChildren = 1;
|
||||||
group_keyConfig->followCamera = 1;
|
group_keyConfig->followCamera = 1;
|
||||||
|
@ -4182,7 +4183,9 @@ bool Game::loadSceneXML(std::string scene)
|
||||||
{
|
{
|
||||||
//errorLog("Could not find [" + fn + "]");
|
//errorLog("Could not find [" + fn + "]");
|
||||||
//msg("Could not find map [" + 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;
|
return false;
|
||||||
}
|
}
|
||||||
TiXmlDocument doc;
|
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)
|
if (!this->saveFile)
|
||||||
return;
|
return false;
|
||||||
|
|
||||||
std::string fn = getSceneFilename(scene);
|
std::string fn = getSceneFilename(scene);
|
||||||
|
|
||||||
|
@ -5463,7 +5466,7 @@ void Game::saveScene(std::string scene)
|
||||||
saveFile->InsertEndChild(level);
|
saveFile->InsertEndChild(level);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
std::ostringstream obs, obsBinary;
|
std::ostringstream obs;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (i = 0; i < obsRows.size(); i++)
|
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)
|
void Game::warpToArea(WarpArea *area)
|
||||||
|
@ -6733,6 +6742,11 @@ void Game::applyState()
|
||||||
|
|
||||||
worldMapRender = 0;
|
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;
|
worldMapRender = new WorldMapRender;
|
||||||
addRenderObject(worldMapRender, LR_WORLDMAP);
|
addRenderObject(worldMapRender, LR_WORLDMAP);
|
||||||
// to hide minimap
|
// 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);
|
Vector p = controlHint_mouseLeft->position + Vector(-100,0);
|
||||||
|
|
||||||
os.seekp(0);
|
char sbuf[32];
|
||||||
os << "song/songslot-" << dsq->continuity.getSongSlotByType(songType) << '\0'; // ensure correct string termination across compilers
|
sprintf(sbuf, "song/songslot-%d", dsq->continuity.getSongSlotByType(songType));
|
||||||
Quad *q = new Quad(os.str(), p);
|
Quad *q = new Quad(sbuf, p);
|
||||||
q->followCamera = 1;
|
q->followCamera = 1;
|
||||||
q->scale = Vector(0.7, 0.7);
|
q->scale = Vector(0.7, 0.7);
|
||||||
q->alpha = 0;
|
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];
|
int note = song->notes[i];
|
||||||
|
|
||||||
os.seekp(0);
|
sprintf(sbuf, "song/notebutton-%d", note);
|
||||||
os << "song/notebutton-" << note << '\0';
|
Quad *q = new Quad(sbuf, p);
|
||||||
Quad *q = new Quad(os.str(), p);
|
|
||||||
q->color = dsq->getNoteColor(note)*0.5f + Vector(1, 1, 1)*0.5f;
|
q->color = dsq->getNoteColor(note)*0.5f + Vector(1, 1, 1)*0.5f;
|
||||||
q->followCamera = 1;
|
q->followCamera = 1;
|
||||||
q->scale = Vector(1.0, 1.0);
|
q->scale = Vector(1.0, 1.0);
|
||||||
|
@ -9917,8 +9930,8 @@ void Game::constrainCamera()
|
||||||
cameraOffBounds = 0;
|
cameraOffBounds = 0;
|
||||||
if (cameraConstrained)
|
if (cameraConstrained)
|
||||||
{
|
{
|
||||||
int vw2 = core->getVirtualOffX()*core->invGlobalScale;
|
float vw2 = core->getVirtualOffX()*core->invGlobalScale;
|
||||||
int vh2 = core->getVirtualOffY()*core->invGlobalScale;
|
float vh2 = core->getVirtualOffY()*core->invGlobalScale;
|
||||||
|
|
||||||
if (dsq->cameraPos.x - vw2 < (cameraMin.x+1))
|
if (dsq->cameraPos.x - vw2 < (cameraMin.x+1))
|
||||||
{
|
{
|
||||||
|
@ -9932,9 +9945,11 @@ void Game::constrainCamera()
|
||||||
cameraOffBounds = 1;
|
cameraOffBounds = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int scrw, scrh;
|
// The camera is positioned at (0, 0) screen coordinates, which, on widescreen resolutions,
|
||||||
scrw = core->getVirtualWidth()*core->invGlobalScale;
|
// is *not* the upper left corner. Subtract the offset to get the real position.
|
||||||
scrh = 600*core->invGlobalScale;
|
// 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)
|
if (cameraMax.x != -1 && dsq->cameraPos.x + scrw >= cameraMax.x)
|
||||||
{
|
{
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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 "../ExternalLibs/tinyxml.h"
|
||||||
#include "../BBGE/DebugFont.h"
|
#include "../BBGE/DebugFont.h"
|
||||||
|
@ -693,7 +694,7 @@ public:
|
||||||
|
|
||||||
ElementTemplate *getElementTemplateByIdx(int idx);
|
ElementTemplate *getElementTemplateByIdx(int idx);
|
||||||
|
|
||||||
void saveScene(std::string scene);
|
bool saveScene(std::string scene);
|
||||||
typedef std::vector<WarpArea> WarpAreas;
|
typedef std::vector<WarpArea> WarpAreas;
|
||||||
WarpAreas warpAreas;
|
WarpAreas warpAreas;
|
||||||
|
|
||||||
|
@ -1249,3 +1250,5 @@ bool Game::isObstructed(const TileVector &tile, int t /* = -1 */) const
|
||||||
{
|
{
|
||||||
return (getGrid(tile) & t);
|
return (getGrid(tile) & t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -108,6 +108,8 @@ void GridRender::onRender()
|
||||||
startY = 0;
|
startY = 0;
|
||||||
if (endY >= MAX_GRID)
|
if (endY >= MAX_GRID)
|
||||||
endY = MAX_GRID-1;
|
endY = MAX_GRID-1;
|
||||||
|
if (startY > endY)
|
||||||
|
return;
|
||||||
for (int x = startX; x <= endX; ++x)
|
for (int x = startX; x <= endX; ++x)
|
||||||
{
|
{
|
||||||
const signed char *gridColumn = dsq->game->getGridColumn(x);
|
const signed char *gridColumn = dsq->game->getGridColumn(x);
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef GRIDRENDER_H
|
||||||
|
#define GRIDRENDER_H
|
||||||
|
|
||||||
#include "../BBGE/Quad.h"
|
#include "../BBGE/Quad.h"
|
||||||
|
|
||||||
|
@ -85,6 +86,9 @@ public:
|
||||||
void removeGem(GemMover *gemMover);
|
void removeGem(GemMover *gemMover);
|
||||||
void onToggleHelpScreen();
|
void onToggleHelpScreen();
|
||||||
bool isCursorOffHud();
|
bool isCursorOffHud();
|
||||||
|
|
||||||
|
static void setRevealMethod(WorldMapRevealMethod m);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Quad *addHintQuad1, *addHintQuad2;
|
Quad *addHintQuad1, *addHintQuad2;
|
||||||
AquariaMenuItem *helpButton;
|
AquariaMenuItem *helpButton;
|
||||||
|
@ -150,3 +154,4 @@ protected:
|
||||||
std::vector<SongLinePoint> pts;
|
std::vector<SongLinePoint> pts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -60,6 +60,7 @@ void Mod::clear()
|
||||||
debugMenu = false;
|
debugMenu = false;
|
||||||
hasMap = false;
|
hasMap = false;
|
||||||
blockEditor = false;
|
blockEditor = false;
|
||||||
|
mapRevealMethod = REVEAL_UNSPECIFIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Mod::isDebugMenu()
|
bool Mod::isDebugMenu()
|
||||||
|
@ -82,7 +83,7 @@ bool Mod::loadModXML(TiXmlDocument *d, std::string modName)
|
||||||
return d->LoadFile(baseModPath + modName + ".xml");
|
return d->LoadFile(baseModPath + modName + ".xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Mod::getBaseModPath()
|
const std::string& Mod::getBaseModPath() const
|
||||||
{
|
{
|
||||||
refreshBaseModPath();
|
refreshBaseModPath();
|
||||||
|
|
||||||
|
@ -98,6 +99,8 @@ void Mod::load(const std::string &p)
|
||||||
name = p;
|
name = p;
|
||||||
path = baseModPath + p + "/";
|
path = baseModPath + p + "/";
|
||||||
|
|
||||||
|
setLocalisationModPath(path);
|
||||||
|
|
||||||
setActive(true);
|
setActive(true);
|
||||||
|
|
||||||
TiXmlDocument d;
|
TiXmlDocument d;
|
||||||
|
@ -135,14 +138,15 @@ void Mod::load(const std::string &p)
|
||||||
props->Attribute("blockEditor", &t);
|
props->Attribute("blockEditor", &t);
|
||||||
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/";
|
dsq->secondaryTexturePath = path + "graphics/";
|
||||||
#else
|
|
||||||
dsq->secondaryTexturePath = "./" + path + "graphics/";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
dsq->sound->audioPath2 = path + "audio/";
|
dsq->sound->audioPath2 = path + "audio/";
|
||||||
dsq->sound->setVoicePath2(path + "audio/");
|
dsq->sound->setVoicePath2(path + "audio/");
|
||||||
|
@ -156,12 +160,12 @@ void Mod::load(const std::string &p)
|
||||||
particleManager->loadParticleBank(dsq->particleBank1, dsq->particleBank2);
|
particleManager->loadParticleBank(dsq->particleBank1, dsq->particleBank2);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Mod::getPath()
|
const std::string& Mod::getPath() const
|
||||||
{
|
{
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Mod::getName()
|
const std::string& Mod::getName() const
|
||||||
{
|
{
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
@ -250,6 +254,8 @@ void Mod::setActive(bool a)
|
||||||
{
|
{
|
||||||
if (!active)
|
if (!active)
|
||||||
{
|
{
|
||||||
|
mapRevealMethod = REVEAL_UNSPECIFIED;
|
||||||
|
setLocalisationModPath("");
|
||||||
name = path = "";
|
name = path = "";
|
||||||
dsq->secondaryTexturePath = "";
|
dsq->secondaryTexturePath = "";
|
||||||
dsq->sound->audioPath2 = "";
|
dsq->sound->audioPath2 = "";
|
||||||
|
|
|
@ -157,7 +157,7 @@ void ModDL::GetModlist(const std::string& url, bool allowChaining, bool first)
|
||||||
if(first)
|
if(first)
|
||||||
knownServers.clear();
|
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
|
// In theory, this allows setting up a server network
|
||||||
// where each server links to any servers it knows,
|
// where each server links to any servers it knows,
|
||||||
// without screwing up, but this isn't going to happen anyways.
|
// 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->quad->color.interpolateTo(Vector(1,1,1), 0.3f);
|
||||||
scr->globeIcon->alpha.interpolateTo(0.5f, 0.2f, -1, true, true);
|
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.stopPath();
|
||||||
scr->dlText.alpha.interpolateTo(1, 0.1f);
|
scr->dlText.alpha.interpolateTo(1, 0.1f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,20 +73,20 @@ void ModSelectorScreen::move(int ud, bool instant /* = false */)
|
||||||
v.data->target.y += ch;
|
v.data->target.y += ch;
|
||||||
v.data->timePassed = 0;
|
v.data->timePassed = 0;
|
||||||
|
|
||||||
if(v.data->target.y > 150)
|
if(v.data->target.y > 200)
|
||||||
v.data->target.y = 150;
|
v.data->target.y = 200;
|
||||||
else if(v.data->target.y < -grid->getUsedY() / 2)
|
else if(v.data->target.y < -grid->getUsedY())
|
||||||
v.data->target.y = -grid->getUsedY() / 2;
|
v.data->target.y = -grid->getUsedY();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Vector v2 = grid->position;
|
Vector v2 = grid->position;
|
||||||
v2.y += ch; // scroll down == grid pos y gets negative (grid scrolls up)
|
v2.y += ch; // scroll down == grid pos y gets negative (grid scrolls up)
|
||||||
|
|
||||||
if(v2.y > 150)
|
if(v2.y > 200)
|
||||||
grid->position.interpolateTo(Vector(v2.x, 150), t);
|
grid->position.interpolateTo(Vector(v2.x, 200), t);
|
||||||
else if(v2.y < -grid->getUsedY() / 2)
|
else if(v2.y < -grid->getUsedY())
|
||||||
grid->position.interpolateTo(Vector(v2.x, -grid->getUsedY() / 2), t);
|
grid->position.interpolateTo(Vector(v2.x, -grid->getUsedY()), t);
|
||||||
else
|
else
|
||||||
grid->position.interpolateTo(v2, t, 0, false, true);
|
grid->position.interpolateTo(v2, t, 0, false, true);
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ void ModSelectorScreen::onUpdate(float dt)
|
||||||
// mouse wheel scroll
|
// mouse wheel scroll
|
||||||
if(dsq->mouse.scrollWheelChange)
|
if(dsq->mouse.scrollWheelChange)
|
||||||
{
|
{
|
||||||
move(dsq->mouse.scrollWheelChange);
|
move(dsq->mouse.scrollWheelChange * 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(subFadeT >= 0)
|
if(subFadeT >= 0)
|
||||||
|
@ -369,22 +369,11 @@ static void _FadeOutAll(RenderObject *r, float t)
|
||||||
|
|
||||||
void ModSelectorScreen::close()
|
void ModSelectorScreen::close()
|
||||||
{
|
{
|
||||||
/*for(int i = 0; i < panels.size(); ++i)
|
|
||||||
if(i != currentPanel)
|
|
||||||
panels[i]->setHidden(true);*/
|
|
||||||
|
|
||||||
const float t = 0.5f;
|
const float t = 0.5f;
|
||||||
_FadeOutAll(this, t);
|
_FadeOutAll(this, t);
|
||||||
//panels[currentPanel]->scale.interpolateTo(Vector(0.9f, 0.9f), t); // HMM
|
//panels[currentPanel]->scale.interpolateTo(Vector(0.9f, 0.9f), t); // HMM
|
||||||
dsq->user.save();
|
dsq->user.save();
|
||||||
dsq->toggleVersionLabel(true);
|
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)
|
JuicyProgressBar::JuicyProgressBar() : Quad(), txt(&dsq->smallFont)
|
||||||
|
@ -450,7 +439,7 @@ void BasicIcon::onUpdate(float dt)
|
||||||
dsq->modSelectorScr->move(5, true);
|
dsq->modSelectorScr->move(5, true);
|
||||||
else
|
else
|
||||||
dsq->modSelectorScr->move(-5, true);
|
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
|
setFocus(true); // re-position mouse
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,6 +147,10 @@ static void init()
|
||||||
os << AQUARIA_CUSTOM_BUILD_ID;
|
os << AQUARIA_CUSTOM_BUILD_ID;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
const char *loc = getUsedLocale();
|
||||||
|
if(*loc)
|
||||||
|
os << "; Locale=" << loc;
|
||||||
|
|
||||||
userAgent = os.str();
|
userAgent = os.str();
|
||||||
|
|
||||||
if(!worker)
|
if(!worker)
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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/Base.h"
|
||||||
#include "../BBGE/Particles.h"
|
#include "../BBGE/Particles.h"
|
||||||
|
@ -149,3 +150,4 @@ public:
|
||||||
void parseWarpNodeData(const std::string &dataString);
|
void parseWarpNodeData(const std::string &dataString);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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 "../BBGE/Base.h"
|
||||||
//#include "Astar.h"
|
//#include "Astar.h"
|
||||||
|
@ -803,7 +804,7 @@ private: // data
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2593,12 +2593,15 @@ void SceneEditor::loadScene()
|
||||||
particleManager->loadParticleBank(dsq->particleBank1, dsq->particleBank2);
|
particleManager->loadParticleBank(dsq->particleBank1, dsq->particleBank2);
|
||||||
Shot::loadShotBank(dsq->shotBank1, dsq->shotBank2);
|
Shot::loadShotBank(dsq->shotBank1, dsq->shotBank2);
|
||||||
dsq->game->loadEntityTypeList();
|
dsq->game->loadEntityTypeList();
|
||||||
|
dsq->loadElementEffects();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneEditor::saveScene()
|
void SceneEditor::saveScene()
|
||||||
{
|
{
|
||||||
dsq->screenMessage(dsq->game->sceneName + " Saved!");
|
if(dsq->game->saveScene(dsq->game->sceneName))
|
||||||
dsq->game->saveScene(dsq->game->sceneName);
|
dsq->screenMessage(dsq->game->sceneName + " Saved!");
|
||||||
|
else
|
||||||
|
dsq->screenMessage(dsq->game->sceneName + " FAILED to save!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void SceneEditor::deleteSelectedElement()
|
void SceneEditor::deleteSelectedElement()
|
||||||
|
@ -3104,9 +3107,9 @@ void SceneEditor::selectEnd()
|
||||||
for (int i = 0; i < dsq->game->elementTemplates.size(); i++)
|
for (int i = 0; i < dsq->game->elementTemplates.size(); i++)
|
||||||
{
|
{
|
||||||
ElementTemplate et = dsq->game->elementTemplates[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;
|
curElement = largest;
|
||||||
|
@ -3482,10 +3485,12 @@ void SceneEditor::update(float dt)
|
||||||
autoSaveTimer = 0;
|
autoSaveTimer = 0;
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << "auto/AUTO_" << autoSaveFile << "_" << dsq->game->sceneName;
|
os << "auto/AUTO_" << autoSaveFile << "_" << dsq->game->sceneName;
|
||||||
std::string m = "Map AutoSaved to " + os.str();
|
if(dsq->game->saveScene(os.str()))
|
||||||
dsq->game->saveScene(os.str());
|
{
|
||||||
dsq->debugLog(m);
|
std::string m = "Map AutoSaved to " + os.str();
|
||||||
dsq->screenMessage(m);
|
dsq->debugLog(m);
|
||||||
|
dsq->screenMessage(m);
|
||||||
|
}
|
||||||
|
|
||||||
autoSaveFile++;
|
autoSaveFile++;
|
||||||
if (autoSaveFile > vars->autoSaveFiles)
|
if (autoSaveFile > vars->autoSaveFiles)
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef SCHOOLFISH_H
|
||||||
|
#define SCHOOLFISH_H
|
||||||
|
|
||||||
#include "FlockEntity.h"
|
#include "FlockEntity.h"
|
||||||
|
|
||||||
|
@ -50,3 +51,4 @@ protected:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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.
|
// 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.
|
// - 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 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()
|
void compile_time_assertions()
|
||||||
{
|
{
|
||||||
#define oo(cls) offsetof(cls, _objtype)
|
#define oo(cls) offsetof(cls, _objtype)
|
||||||
|
@ -377,6 +378,7 @@ void compile_time_assertions()
|
||||||
compile_assert(oo(Path) == oo(BaseText));
|
compile_assert(oo(Path) == oo(BaseText));
|
||||||
#undef oo
|
#undef oo
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
static void ensureType(lua_State *L, T *& ptr, ScriptObjectType ty)
|
static void ensureType(lua_State *L, T *& ptr, ScriptObjectType ty)
|
||||||
|
@ -658,7 +660,7 @@ luaFunc(newindexWarnGlobal)
|
||||||
{
|
{
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << "WARNING: script set global "
|
os << "WARNING: script set global "
|
||||||
<< lua_typename(L, -2)
|
<< lua_typename(L, lua_type(L, -2))
|
||||||
<< " " << varname;
|
<< " " << varname;
|
||||||
scriptError(L, os.str());
|
scriptError(L, os.str());
|
||||||
}
|
}
|
||||||
|
@ -700,16 +702,17 @@ static bool findFile_helper(const char *rawname, std::string &fname)
|
||||||
return false;
|
return false;
|
||||||
if (dsq->mod.isActive())
|
if (dsq->mod.isActive())
|
||||||
{
|
{
|
||||||
fname += dsq->mod.getPath();
|
fname = dsq->mod.getPath();
|
||||||
if(fname[fname.length() - 1] != '/')
|
if(fname[fname.length() - 1] != '/')
|
||||||
fname += '/';
|
fname += '/';
|
||||||
fname += rawname;
|
fname += rawname;
|
||||||
|
fname = localisePath(fname, dsq->mod.getPath());
|
||||||
fname = core->adjustFilenameCase(fname);
|
fname = core->adjustFilenameCase(fname);
|
||||||
if (exists(fname))
|
if (exists(fname))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
fname = localisePath(rawname);
|
||||||
fname = core->adjustFilenameCase(rawname);
|
fname = core->adjustFilenameCase(fname);
|
||||||
return exists(fname);
|
return exists(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8951,7 +8954,8 @@ void ScriptInterface::shutdown()
|
||||||
|
|
||||||
Script *ScriptInterface::openScript(const std::string &file, bool ignoremissing /* = false */)
|
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;
|
bool loadedScript = false;
|
||||||
|
|
||||||
lua_getglobal(baseState, "_scriptvars");
|
lua_getglobal(baseState, "_scriptvars");
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef SCRIPTINTERFACE_H
|
||||||
|
#define SCRIPTINTERFACE_H
|
||||||
|
|
||||||
#include "../BBGE/Base.h"
|
#include "../BBGE/Base.h"
|
||||||
|
|
||||||
|
@ -101,3 +102,5 @@ protected:
|
||||||
|
|
||||||
lua_State *baseState;
|
lua_State *baseState;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef SCRIPTEDENTITY_H
|
||||||
|
#define SCRIPTEDENTITY_H
|
||||||
|
|
||||||
#include "CollideEntity.h"
|
#include "CollideEntity.h"
|
||||||
#include "Segmented.h"
|
#include "Segmented.h"
|
||||||
#include "Hair.h"
|
#include "Hair.h"
|
||||||
|
@ -112,3 +114,5 @@ protected:
|
||||||
void onExitState(int action);
|
void onExitState(int action);
|
||||||
virtual void deathNotify(RenderObject *r);
|
virtual void deathNotify(RenderObject *r);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef SEGMENTED_H
|
||||||
|
#define SEGMENTED_H
|
||||||
|
|
||||||
#include "../BBGE/Quad.h"
|
#include "../BBGE/Quad.h"
|
||||||
|
|
||||||
|
@ -53,3 +54,4 @@ protected:
|
||||||
void onRender();
|
void onRender();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef SHOT_H
|
||||||
|
#define SHOT_H
|
||||||
|
|
||||||
#include "CollideEntity.h"
|
#include "CollideEntity.h"
|
||||||
#include "Segmented.h"
|
#include "Segmented.h"
|
||||||
|
@ -192,3 +193,4 @@ protected:
|
||||||
void onEndOfLife();
|
void onEndOfLife();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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
|
#ifdef BBGE_BUILD_ACHIEVEMENTS_INTERNAL
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
@ -172,4 +173,4 @@ private:
|
||||||
*/
|
*/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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];
|
return stringMap[idx];
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef TILEVECTOR_H
|
||||||
|
#define TILEVECTOR_H
|
||||||
|
|
||||||
#include "../BBGE/Vector.h"
|
#include "../BBGE/Vector.h"
|
||||||
|
|
||||||
|
@ -55,3 +56,4 @@ public:
|
||||||
int x,y;
|
int x,y;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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/BitmapFont.h"
|
||||||
#include "../BBGE/Quad.h"
|
#include "../BBGE/Quad.h"
|
||||||
|
@ -51,4 +52,4 @@ protected:
|
||||||
Quad *back;
|
Quad *back;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -144,6 +144,12 @@ void UserSettings::save()
|
||||||
xml_saveSlotScreens.SetAttribute("on", video.saveSlotScreens);
|
xml_saveSlotScreens.SetAttribute("on", video.saveSlotScreens);
|
||||||
}
|
}
|
||||||
xml_video.InsertEndChild(xml_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);
|
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, "SaveSlotScreens", "on", &video.saveSlotScreens);
|
||||||
|
|
||||||
|
readInt(xml_video, "WorldMap", "revealMethod", &video.worldMapRevealMethod);
|
||||||
}
|
}
|
||||||
|
|
||||||
TiXmlElement *xml_control = doc.FirstChildElement("Control");
|
TiXmlElement *xml_control = doc.FirstChildElement("Control");
|
||||||
|
@ -535,6 +543,18 @@ void UserSettings::load(bool doApply, const std::string &overrideFile)
|
||||||
|
|
||||||
//clearInputCodeMap();
|
//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)
|
if (doApply)
|
||||||
apply();
|
apply();
|
||||||
}
|
}
|
||||||
|
@ -574,18 +594,6 @@ void UserSettings::apply()
|
||||||
|
|
||||||
core->settings.prebufferSounds = audio.prebuffer;
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef USERSETTINGS_H
|
||||||
|
#define USERSETTINGS_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -112,6 +113,7 @@ public:
|
||||||
vsync = 1;
|
vsync = 1;
|
||||||
darkbuffersize = 256;
|
darkbuffersize = 256;
|
||||||
displaylists = 0;
|
displaylists = 0;
|
||||||
|
worldMapRevealMethod = 0;
|
||||||
}
|
}
|
||||||
int shader;
|
int shader;
|
||||||
int blur;
|
int blur;
|
||||||
|
@ -122,6 +124,7 @@ public:
|
||||||
int parallaxOn0, parallaxOn1, parallaxOn2;
|
int parallaxOn0, parallaxOn1, parallaxOn2;
|
||||||
int numParticles;
|
int numParticles;
|
||||||
int displaylists;
|
int displaylists;
|
||||||
|
int worldMapRevealMethod;
|
||||||
} video;
|
} video;
|
||||||
|
|
||||||
struct Control
|
struct Control
|
||||||
|
@ -182,3 +185,5 @@ public:
|
||||||
void save();
|
void save();
|
||||||
void apply();
|
void apply();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef WATERFONT_H
|
||||||
|
#define WATERFONT_H
|
||||||
|
|
||||||
#include "../BBGE/BitmapFont.h"
|
#include "../BBGE/BitmapFont.h"
|
||||||
|
|
||||||
|
@ -31,3 +32,4 @@ protected:
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef WATERSURFACERENDER_H
|
||||||
|
#define WATERSURFACERENDER_H
|
||||||
|
|
||||||
#include "../BBGE/Quad.h"
|
#include "../BBGE/Quad.h"
|
||||||
|
|
||||||
|
@ -32,4 +33,4 @@ protected:
|
||||||
void onRender();
|
void onRender();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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 "../BBGE/Quad.h"
|
||||||
#include "Entity.h"
|
#include "Entity.h"
|
||||||
|
@ -44,3 +45,4 @@ protected:
|
||||||
void onRender();
|
void onRender();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -44,11 +44,12 @@ namespace WorldMapRenderNamespace
|
||||||
|
|
||||||
enum VisMethod
|
enum VisMethod
|
||||||
{
|
{
|
||||||
VIS_VERTEX = 0,
|
VIS_VERTEX = 0, // Uses the RenderObject tile grid (RenderObject::setSegs()) to display visited areas
|
||||||
VIS_WRITE = 1
|
VIS_WRITE = 1 // Uses render-to-texture instead
|
||||||
};
|
};
|
||||||
|
|
||||||
VisMethod visMethod = VIS_VERTEX;
|
VisMethod visMethod = VIS_VERTEX;
|
||||||
|
WorldMapRevealMethod revMethod = REVEAL_DEFAULT;
|
||||||
|
|
||||||
std::vector<Quad *> tiles;
|
std::vector<Quad *> tiles;
|
||||||
|
|
||||||
|
@ -61,9 +62,9 @@ namespace WorldMapRenderNamespace
|
||||||
float xMin, yMin, xMax, yMax;
|
float xMin, yMin, xMax, yMax;
|
||||||
|
|
||||||
float zoomMin = 0.2;
|
float zoomMin = 0.2;
|
||||||
float zoomMax = 1;
|
float zoomMax = 3.0;
|
||||||
const float exteriorZoomMax = 1;
|
const float exteriorZoomMax = 3.0;
|
||||||
const float interiorZoomMax = 1.8;
|
const float interiorZoomMax = 3.0;
|
||||||
|
|
||||||
bool editorActive=false;
|
bool editorActive=false;
|
||||||
|
|
||||||
|
@ -84,6 +85,23 @@ WorldMapTile *activeTile=0;
|
||||||
|
|
||||||
const float beaconSpawnBitTime = 0.05;
|
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
|
class WorldMapBoundQuad : public Quad
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -277,6 +295,7 @@ public:
|
||||||
followCamera = 1;
|
followCamera = 1;
|
||||||
blink = false;
|
blink = false;
|
||||||
blinkTimer = 0;
|
blinkTimer = 0;
|
||||||
|
alphaMod = 0.66;
|
||||||
canMove = gemData->canMove;
|
canMove = gemData->canMove;
|
||||||
//canMove = true;
|
//canMove = true;
|
||||||
//gemData->userString = "HI THERE!";
|
//gemData->userString = "HI THERE!";
|
||||||
|
@ -731,8 +750,6 @@ WorldMapRender::WorldMapRender() : RenderObject(), ActionMapper()
|
||||||
q->alphaMod = 0;
|
q->alphaMod = 0;
|
||||||
|
|
||||||
tile->q = q;
|
tile->q = q;
|
||||||
|
|
||||||
setProperTileColor(tile);
|
|
||||||
|
|
||||||
q->setWidthHeight(q->getWidth()*tile->scale, q->getHeight()*tile->scale);
|
q->setWidthHeight(q->getWidth()*tile->scale, q->getHeight()*tile->scale);
|
||||||
q->scale = Vector(0.25f*tile->scale2, 0.25f*tile->scale2);
|
q->scale = Vector(0.25f*tile->scale2, 0.25f*tile->scale2);
|
||||||
|
@ -740,10 +757,18 @@ WorldMapRender::WorldMapRender() : RenderObject(), ActionMapper()
|
||||||
if (tile == activeTile)
|
if (tile == activeTile)
|
||||||
activeQuad = q;
|
activeQuad = q;
|
||||||
|
|
||||||
if (activeQuad == q)
|
if (revMethod == REVEAL_PARTIAL || activeQuad == q)
|
||||||
{
|
{
|
||||||
setVis(tile);
|
setVis(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setProperTileColor(tile);
|
||||||
|
|
||||||
|
if(activeQuad == q)
|
||||||
|
{
|
||||||
|
activeTile->q->color = Vector(1,1,1);
|
||||||
|
activeTile->q->alphaMod = 1;
|
||||||
|
}
|
||||||
|
|
||||||
addChild(q, PM_POINTER);
|
addChild(q, PM_POINTER);
|
||||||
|
|
||||||
|
@ -861,7 +886,13 @@ void WorldMapRender::bindInput()
|
||||||
|
|
||||||
void WorldMapRender::destroy()
|
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();
|
RenderObject::destroy();
|
||||||
delete[] savedTexData;
|
delete[] savedTexData;
|
||||||
}
|
}
|
||||||
|
@ -973,7 +1004,8 @@ void WorldMapRender::onUpdate(float dt)
|
||||||
{
|
{
|
||||||
if ((activeTile != selectedTile) && selectedTile->q)
|
if ((activeTile != selectedTile) && selectedTile->q)
|
||||||
{
|
{
|
||||||
clearVis(activeTile);
|
if(revMethod == REVEAL_DEFAULT)
|
||||||
|
clearVis(activeTile);
|
||||||
|
|
||||||
activeTile = selectedTile;
|
activeTile = selectedTile;
|
||||||
activeQuad = activeTile->q;
|
activeQuad = activeTile->q;
|
||||||
|
@ -1428,8 +1460,11 @@ void WorldMapRender::toggle(bool turnON)
|
||||||
{
|
{
|
||||||
if (activeTile != originalActiveTile)
|
if (activeTile != originalActiveTile)
|
||||||
{
|
{
|
||||||
clearVis(activeTile);
|
if(revMethod == REVEAL_DEFAULT)
|
||||||
setVis(originalActiveTile);
|
{
|
||||||
|
clearVis(activeTile);
|
||||||
|
setVis(originalActiveTile);
|
||||||
|
}
|
||||||
activeTile = originalActiveTile;
|
activeTile = originalActiveTile;
|
||||||
activeQuad = activeTile->q;
|
activeQuad = activeTile->q;
|
||||||
}
|
}
|
||||||
|
@ -1504,7 +1539,7 @@ void WorldMapRender::createGemHint(const std::string &gfx)
|
||||||
doubleClickTimer = 0;
|
doubleClickTimer = 0;
|
||||||
GemData *g = dsq->continuity.pickupGem(gfx, false);
|
GemData *g = dsq->continuity.pickupGem(gfx, false);
|
||||||
g->canMove = 1;
|
g->canMove = 1;
|
||||||
g->pos = getAvatarWorldMapPosition() + Vector(0, -20);
|
g->pos = getAvatarWorldMapPosition();// + Vector(0, -20);
|
||||||
g->userString = useString;
|
g->userString = useString;
|
||||||
addGem(g);
|
addGem(g);
|
||||||
fixGems();
|
fixGems();
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef ACTIONINPUT_H
|
||||||
|
#define ACTIONINPUT_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -53,3 +54,5 @@ enum InputSetType
|
||||||
INPUTSET_MOUSE = 3,
|
INPUTSET_MOUSE = 3,
|
||||||
INPUTSET_OTHER = 4
|
INPUTSET_OTHER = 4
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef ACTIONSET_H
|
||||||
|
#define ACTIONSET_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -47,3 +48,5 @@ public:
|
||||||
|
|
||||||
std::string insertInputIntoString(const std::string &string);
|
std::string insertInputIntoString(const std::string &string);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -232,7 +232,7 @@ void stringToLowerUserData(std::string &s)
|
||||||
const size_t len = userdata.length();
|
const size_t len = userdata.length();
|
||||||
const bool match = (s.length() > len) &&
|
const bool match = (s.length() > len) &&
|
||||||
((s[len] == '/') || (s[len] == '\\')) &&
|
((s[len] == '/') || (s[len] == '\\')) &&
|
||||||
(userdata.compare(0, len, s, 0, len) == 0);
|
!strncmp(userdata.c_str(), s.c_str(), len);
|
||||||
if (!match)
|
if (!match)
|
||||||
stringToLower(s);
|
stringToLower(s);
|
||||||
else
|
else
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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
|
#ifdef BBGE_BUILD_WINDOWS
|
||||||
|
|
||||||
|
@ -296,3 +297,5 @@ void openURL(const std::string &url);
|
||||||
|
|
||||||
std::string underscoresToSpaces(const std::string &str);
|
std::string underscoresToSpaces(const std::string &str);
|
||||||
std::string spacesToUnderscores(const std::string &str);
|
std::string spacesToUnderscores(const std::string &str);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef BITMAPFONT_H
|
||||||
|
#define BITMAPFONT_H
|
||||||
|
|
||||||
//#include "DrawText.h"
|
//#include "DrawText.h"
|
||||||
#include "RenderObject.h"
|
#include "RenderObject.h"
|
||||||
|
@ -101,3 +102,4 @@ protected:
|
||||||
int textWidth;
|
int textWidth;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef BLOOMEFFECT_H
|
||||||
|
#define BLOOMEFFECT_H
|
||||||
|
|
||||||
#include "RenderObject.h"
|
#include "RenderObject.h"
|
||||||
#include "FrameBuffer.h"
|
#include "FrameBuffer.h"
|
||||||
|
@ -44,3 +45,4 @@ protected:
|
||||||
bool useFrameBuffer;
|
bool useFrameBuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef COLLISION_H
|
||||||
|
#define COLLISION_H
|
||||||
|
|
||||||
#include "Base.h"
|
#include "Base.h"
|
||||||
|
|
||||||
|
@ -142,3 +143,4 @@ public:
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef COMMONEVENTS_H
|
||||||
|
#define COMMONEVENTS_H
|
||||||
|
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
|
||||||
|
@ -46,3 +47,5 @@ public:
|
||||||
private:
|
private:
|
||||||
std::string state;
|
std::string state;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef DARKLAYER_H
|
||||||
|
#define DARKLAYER_H
|
||||||
|
|
||||||
#include "Base.h"
|
#include "Base.h"
|
||||||
#include "FrameBuffer.h"
|
#include "FrameBuffer.h"
|
||||||
|
@ -52,3 +53,4 @@ protected:
|
||||||
GLuint format;
|
GLuint format;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef DEBUGFONT_H
|
||||||
|
#define DEBUGFONT_H
|
||||||
|
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
#include "BaseText.h"
|
#include "BaseText.h"
|
||||||
|
@ -66,3 +67,4 @@ public:
|
||||||
virtual void buttonPress(DebugButton *db){}
|
virtual void buttonPress(DebugButton *db){}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef EFFECTS_H
|
||||||
|
#define EFFECTS_H
|
||||||
|
|
||||||
#include "Vector.h"
|
#include "Vector.h"
|
||||||
#include "Base.h"
|
#include "Base.h"
|
||||||
|
@ -57,4 +58,5 @@ protected:
|
||||||
bool enabled[FXT_MAX];
|
bool enabled[FXT_MAX];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef FILEVARS_H
|
||||||
|
#define FILEVARS_H
|
||||||
|
|
||||||
#include "Base.h"
|
#include "Base.h"
|
||||||
|
|
||||||
|
@ -34,3 +35,5 @@ protected:
|
||||||
std::map<std::string,float> floats;
|
std::map<std::string,float> floats;
|
||||||
std::map<std::string, int> ints;
|
std::map<std::string, int> ints;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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
|
#ifdef BBGE_BUILD_WINDOWS
|
||||||
typedef unsigned __int32 uint32;
|
typedef unsigned __int32 uint32;
|
||||||
|
@ -44,3 +45,4 @@ public:
|
||||||
uint32 flags;
|
uint32 flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -568,6 +568,9 @@ namespace FMOD {
|
||||||
#define SANITY_CHECK_OPENAL_CALL()
|
#define SANITY_CHECK_OPENAL_CALL()
|
||||||
#endif
|
#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.
|
// simply nasty.
|
||||||
#define ALBRIDGE(cls,method,params,args) \
|
#define ALBRIDGE(cls,method,params,args) \
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef FRAMEBUFFER_H
|
||||||
|
#define FRAMEBUFFER_H
|
||||||
|
|
||||||
#include "Base.h"
|
#include "Base.h"
|
||||||
|
|
||||||
|
@ -57,3 +58,4 @@ protected:
|
||||||
bool enabled, inited;
|
bool enabled, inited;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef GRADIENT_H
|
||||||
|
#define GRADIENT_H
|
||||||
|
|
||||||
#include "RenderObject.h"
|
#include "RenderObject.h"
|
||||||
|
|
||||||
|
@ -37,3 +38,5 @@ protected:
|
||||||
void onRender();
|
void onRender();
|
||||||
Vector ulc0, ulc1, ulc2, ulc3;
|
Vector ulc0, ulc1, ulc2, ulc3;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef LENSFLARE_H
|
||||||
|
#define LENSFLARE_H
|
||||||
|
|
||||||
#include "Quad.h"
|
#include "Quad.h"
|
||||||
|
|
||||||
|
@ -34,3 +35,5 @@ protected:
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt);
|
||||||
std::vector <Quad*> flares;
|
std::vector <Quad*> flares;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -26,15 +26,43 @@ static std::string _CFToStdString(CFStringRef cs)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static std::string s_locale;
|
static std::string s_locale;
|
||||||
|
static std::string s_modpath;
|
||||||
|
|
||||||
void setUsedLocale(const std::string& s)
|
void setUsedLocale(const std::string& s)
|
||||||
{
|
{
|
||||||
s_locale = 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;
|
return path;
|
||||||
|
|
||||||
const std::string fname = path.substr(modpath.length());
|
const std::string fname = path.substr(modpath.length());
|
||||||
|
@ -110,7 +138,7 @@ std::string getSystemLocale()
|
||||||
|
|
||||||
size_t found = localeStr.find('.');
|
size_t found = localeStr.find('.');
|
||||||
|
|
||||||
if (found != string::npos)
|
if (found != std::string::npos)
|
||||||
localeStr.resize(found);
|
localeStr.resize(found);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
#include "Base.h"
|
#include "Base.h"
|
||||||
|
|
||||||
void setUsedLocale(const std::string& s);
|
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();
|
std::string getSystemLocale();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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"
|
#include "RenderObject.h"
|
||||||
|
|
||||||
|
@ -57,3 +58,5 @@ protected:
|
||||||
float m_lodLevel;
|
float m_lodLevel;
|
||||||
std::string m_path;
|
std::string m_path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef POINTSPRITES_H
|
||||||
|
#define POINTSPRITES_H
|
||||||
|
|
||||||
#include "Base.h"
|
#include "Base.h"
|
||||||
|
|
||||||
#ifdef BBGE_BUILD_WINDOWS
|
#ifdef BBGE_BUILD_WINDOWS
|
||||||
|
@ -34,3 +36,4 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef PRECACHER_H
|
||||||
|
#define PRECACHER_H
|
||||||
|
|
||||||
#include "Quad.h"
|
#include "Quad.h"
|
||||||
|
|
||||||
|
@ -37,3 +38,5 @@ private:
|
||||||
bool cleaned;
|
bool cleaned;
|
||||||
void (*loadProgressCallback)();
|
void (*loadProgressCallback)();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef QUADTRAIL_H
|
||||||
|
#define QUADTRAIL_H
|
||||||
|
|
||||||
#include "RenderObject.h"
|
#include "RenderObject.h"
|
||||||
|
|
||||||
|
@ -60,3 +61,5 @@ protected:
|
||||||
void onRender();
|
void onRender();
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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"
|
#include "Vector.h"
|
||||||
|
|
||||||
|
@ -70,3 +71,5 @@ public:
|
||||||
}
|
}
|
||||||
int x1, y1, x2, y2;
|
int x1, y1, x2, y2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -314,7 +314,8 @@ void RenderObjectLayer::moveToBack(RenderObject *r)
|
||||||
for (int i = newSize - 1; i >= sizeDiff; i--)
|
for (int i = newSize - 1; i >= sizeDiff; i--)
|
||||||
{
|
{
|
||||||
renderObjects[i] = renderObjects[i - sizeDiff];
|
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++)
|
for (int i = 0; i < newIdx; i++)
|
||||||
renderObjects[i] = 0;
|
renderObjects[i] = 0;
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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()
|
inline bool RenderObject::isOnScreen()
|
||||||
{
|
{
|
||||||
|
@ -70,3 +71,5 @@ Vector RenderObject::getFollowCameraPosition() const
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef ROUNDEDRECT_H
|
||||||
|
#define ROUNDEDRECT_H
|
||||||
|
|
||||||
#include "RenderObject.h"
|
#include "RenderObject.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
@ -67,3 +68,5 @@ protected:
|
||||||
bool mbd;
|
bool mbd;
|
||||||
bool noNested;
|
bool noNested;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef SCREENTRANSITION_H
|
||||||
|
#define SCREENTRANSITION_H
|
||||||
|
|
||||||
#include "RenderObject.h"
|
#include "RenderObject.h"
|
||||||
|
|
||||||
|
@ -46,3 +47,4 @@ protected:
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef SCRIPTOBJECT_H
|
||||||
|
#define SCRIPTOBJECT_H
|
||||||
|
|
||||||
enum ScriptObjectType
|
enum ScriptObjectType
|
||||||
{
|
{
|
||||||
|
@ -79,3 +80,5 @@ public:
|
||||||
// public to allow the static compile check in ScriptInterface.cpp to work
|
// public to allow the static compile check in ScriptInterface.cpp to work
|
||||||
ScriptObjectType _objtype;
|
ScriptObjectType _objtype;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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"
|
#include "Base.h"
|
||||||
|
|
||||||
|
@ -52,3 +53,5 @@ protected:
|
||||||
static bool _wasInited;
|
static bool _wasInited;
|
||||||
static bool _useShaders;
|
static bool _useShaders;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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
|
* 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_SETUP
|
||||||
#undef VERIFY
|
#undef VERIFY
|
||||||
|
|
||||||
|
#endif // SIMPLEISTRINGSTREAM_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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef SKELETALSPRITE_H
|
||||||
|
#define SKELETALSPRITE_H
|
||||||
|
|
||||||
#include "Quad.h"
|
#include "Quad.h"
|
||||||
#include "SimpleIStringStream.h"
|
#include "SimpleIStringStream.h"
|
||||||
// for 2d system only
|
// for 2d system only
|
||||||
|
@ -273,4 +275,4 @@ protected:
|
||||||
void onUpdate(float dt);
|
void onUpdate(float dt);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -90,6 +90,7 @@ namespace SoundCore
|
||||||
|
|
||||||
bool stopMusicOnFadeOut=false;
|
bool stopMusicOnFadeOut=false;
|
||||||
bool wasPlayingVoice=false;
|
bool wasPlayingVoice=false;
|
||||||
|
bool playingMusicOnce=false;
|
||||||
|
|
||||||
typedef std::list<FadeCh> FadeChs;
|
typedef std::list<FadeCh> FadeChs;
|
||||||
FadeChs fadeChs;
|
FadeChs fadeChs;
|
||||||
|
@ -466,7 +467,7 @@ void SoundManager::toggleEffectMusic(SoundEffectType effect, bool on)
|
||||||
std::string SoundManager::getVolumeString()
|
std::string SoundManager::getVolumeString()
|
||||||
{
|
{
|
||||||
std::ostringstream os;
|
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;
|
os << "musVol: " << musVol.y << " voxVol: " << voxVol.y << std::endl;
|
||||||
|
|
||||||
float musicChannelVol = -1;
|
float musicChannelVol = -1;
|
||||||
|
@ -657,21 +658,17 @@ void SoundManager::update(float dt)
|
||||||
|
|
||||||
if (musicChannel)
|
if (musicChannel)
|
||||||
{
|
{
|
||||||
bool _isplaying = false;
|
if (!isPlayingMusic())
|
||||||
result = musicChannel->isPlaying(&_isplaying);
|
|
||||||
checkError();
|
|
||||||
if (!_isplaying)
|
|
||||||
{
|
{
|
||||||
result = musicChannel->stop();
|
if(!playingMusicOnce && lastMusic.size())
|
||||||
checkError();
|
|
||||||
musicChannel = 0;
|
|
||||||
|
|
||||||
if (musicStream)
|
|
||||||
{
|
{
|
||||||
result = musicStream->release();
|
debugLog("music not playing, but it should be - force restart");
|
||||||
checkError();
|
playMusic(lastMusic, SLT_LOOP, SFT_IN, 1, SCT_NORMAL); // FIXME: make sure this works with playMusicOnce()
|
||||||
musicStream = 0;
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
stopMusic();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -685,17 +682,7 @@ void SoundManager::update(float dt)
|
||||||
|
|
||||||
if (musVol.y <= 0 && stopMusicOnFadeOut)
|
if (musVol.y <= 0 && stopMusicOnFadeOut)
|
||||||
{
|
{
|
||||||
result = musicChannel->stop();
|
stopMusic();
|
||||||
checkError();
|
|
||||||
musicChannel = 0;
|
|
||||||
|
|
||||||
if (musicStream)
|
|
||||||
{
|
|
||||||
result = musicStream->release();
|
|
||||||
checkError();
|
|
||||||
musicStream = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
stopMusicOnFadeOut = false;
|
stopMusicOnFadeOut = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -791,7 +778,6 @@ void SoundManager::fadeMusic(SoundFadeType sft, float t)
|
||||||
case SFT_CROSS:
|
case SFT_CROSS:
|
||||||
{
|
{
|
||||||
#ifdef BBGE_BUILD_FMODEX
|
#ifdef BBGE_BUILD_FMODEX
|
||||||
|
|
||||||
if (musicChannel2)
|
if (musicChannel2)
|
||||||
{
|
{
|
||||||
musicChannel2->stop();
|
musicChannel2->stop();
|
||||||
|
@ -926,13 +912,17 @@ bool SoundManager::playVoice(const std::string &name, SoundVoiceType svt, float
|
||||||
|
|
||||||
if (!voicePath2.empty())
|
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 (exists(fn)) checkOther = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkOther)
|
if (checkOther)
|
||||||
{
|
{
|
||||||
fn = core->adjustFilenameCase(voicePath + name + fileType);
|
fn = voicePath + name + fileType;
|
||||||
|
fn = localisePath(fn);
|
||||||
|
fn = core->adjustFilenameCase(fn);
|
||||||
if (!exists(fn))
|
if (!exists(fn))
|
||||||
{
|
{
|
||||||
debugLog("Could not find voice file [" + 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_OFF:
|
||||||
case SLT_NONE:
|
case SLT_NONE:
|
||||||
mode |= FMOD_LOOP_OFF;
|
mode |= FMOD_LOOP_OFF;
|
||||||
|
playingMusicOnce = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
mode |= FMOD_LOOP_NORMAL;
|
mode |= FMOD_LOOP_NORMAL;
|
||||||
|
playingMusicOnce = false;
|
||||||
break;
|
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.
|
result = musicChannel->setPaused(false); // This is where the sound really starts.
|
||||||
checkError();
|
checkError();
|
||||||
|
debugLog("music play: " + fn);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
debugLog("Failed to create music stream: " + fn);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
debugLog("playmusic end");
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SoundManager::stopMusic()
|
void SoundManager::stopMusic()
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef BBGE_BUILD_FMODEX
|
#ifdef BBGE_BUILD_FMODEX
|
||||||
if (musicChannel)
|
if (musicChannel)
|
||||||
{
|
{
|
||||||
|
@ -1410,7 +1404,7 @@ void SoundManager::stopMusic()
|
||||||
musicChannel = 0;
|
musicChannel = 0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
playingMusicOnce = false;
|
||||||
lastMusic = "";
|
lastMusic = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1514,27 +1508,32 @@ Buffer SoundManager::loadSoundIntoBank(const std::string &filename, const std::s
|
||||||
|
|
||||||
std::string f = filename, name;
|
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!
|
// WARNING: local sounds should go here!
|
||||||
|
|
||||||
debugLog(filename);
|
debugLog(filename);
|
||||||
if (slt == SFXLOAD_LOCAL && !audioPath2.empty())
|
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))
|
if (!exists(f))
|
||||||
{
|
{
|
||||||
f = core->adjustFilenameCase(path + filename + format);
|
f = path + filename + format;
|
||||||
|
f = localisePath(f);
|
||||||
|
f = core->adjustFilenameCase(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
f = core->adjustFilenameCase(path + filename + format);
|
f = path + filename + format;
|
||||||
}
|
f = localisePath(f);
|
||||||
|
f = core->adjustFilenameCase(f);
|
||||||
bool loop = false;
|
|
||||||
|
|
||||||
if (f.find("loop")!=std::string::npos)
|
|
||||||
{
|
|
||||||
loop = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int loc = f.find_last_of('/');
|
int loc = f.find_last_of('/');
|
||||||
|
@ -1545,7 +1544,7 @@ Buffer SoundManager::loadSoundIntoBank(const std::string &filename, const std::s
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
debugLog("returning 0");
|
debugLog("returning 0");
|
||||||
return Buffer();
|
return Buffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef SOUNDMANAGER_H
|
||||||
|
#define SOUNDMANAGER_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
@ -212,8 +213,6 @@ public:
|
||||||
|
|
||||||
void update(float dt);
|
void update(float dt);
|
||||||
|
|
||||||
std::string currentMusic;
|
|
||||||
|
|
||||||
bool enabled;
|
bool enabled;
|
||||||
|
|
||||||
bool checkError();
|
bool checkError();
|
||||||
|
@ -250,3 +249,5 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
extern SoundManager *sound;
|
extern SoundManager *sound;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -138,6 +138,8 @@ std::string getInputCodeToString(int key)
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FIXME: Move stringbank to BBGE and move these strings into it. -- fg
|
||||||
|
|
||||||
std::string getInputCodeToUserString(int key)
|
std::string getInputCodeToUserString(int key)
|
||||||
{
|
{
|
||||||
for (InputCodeMap::iterator i = inputCodeMap.begin(); i != inputCodeMap.end(); i++)
|
for (InputCodeMap::iterator i = inputCodeMap.begin(); i != inputCodeMap.end(); i++)
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
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 "Base.h"
|
||||||
#include "RenderObject.h"
|
#include "RenderObject.h"
|
||||||
|
@ -69,3 +70,5 @@ protected:
|
||||||
TTFFont *font;
|
TTFFont *font;
|
||||||
int hw,h;
|
int hw,h;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
|
@ -281,6 +281,9 @@ void Texture::load(std::string file)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stringToLowerUserData(file);
|
||||||
|
file = core->adjustFilenameCase(file);
|
||||||
|
|
||||||
loadName = file;
|
loadName = file;
|
||||||
repeating = false;
|
repeating = false;
|
||||||
|
|
||||||
|
@ -315,7 +318,8 @@ void Texture::load(std::string file)
|
||||||
|
|
||||||
if (found)
|
if (found)
|
||||||
{
|
{
|
||||||
file = localisePath(file);
|
file = localisePathInternalModpath(file);
|
||||||
|
file = core->adjustFilenameCase(file);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
std::ostringstream os;
|
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)
|
// Read the width, height and bits per pixel (16, 24 or 32)
|
||||||
bb >> width >> height >> bits;
|
bb >> width >> height >> bits;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
std::ostringstream os;
|
std::ostringstream os;
|
||||||
os << "TGALoad: width: " << width << " height: " << height << " bits: " << bits;
|
os << "TGALoad: width: " << width << " height: " << height << " bits: " << bits;
|
||||||
|
|
|
@ -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
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
#pragma once
|
#ifndef BBGE_VECTOR_H
|
||||||
|
#define BBGE_VECTOR_H
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
@ -64,13 +65,13 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// vecector equality
|
// 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));
|
return ((x == vec.x) && (y == vec.y) && (z == vec.z));
|
||||||
}
|
}
|
||||||
|
|
||||||
// vecector inequality
|
// vecector inequality
|
||||||
const bool operator!=(const Vector &vec) const
|
bool operator!=(const Vector &vec) const
|
||||||
{
|
{
|
||||||
return !(*this == vec);
|
return !(*this == vec);
|
||||||
}
|
}
|
||||||
|
@ -106,10 +107,6 @@ public:
|
||||||
{
|
{
|
||||||
return Vector(-x, -y, -z);
|
return Vector(-x, -y, -z);
|
||||||
}
|
}
|
||||||
bool isZero()
|
|
||||||
{
|
|
||||||
return x == 0 && y == 0 && z == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// vector decrement
|
// vector decrement
|
||||||
const Vector &operator-=(const Vector& vec)
|
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);
|
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);
|
return Vector(-y, x);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector inline getPerpendicularRight()
|
inline Vector getPerpendicularRight()
|
||||||
{
|
{
|
||||||
return Vector(y, -x);
|
return Vector(y, -x);
|
||||||
}
|
}
|
||||||
|
@ -218,41 +215,41 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// dot product
|
// 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;
|
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;
|
return x*vec.x + y*vec.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// dot product
|
// 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;
|
return x*vec.x + y*vec.x + z*vec.z;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// length of vector
|
// length of vector
|
||||||
const scalar_t inline getLength3D() const
|
inline scalar_t getLength3D() const
|
||||||
{
|
{
|
||||||
return (scalar_t)sqrtf(x*x + y*y + z*z);
|
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 (scalar_t)sqrtf(x*x + y*y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the unit vector
|
// return the unit vector
|
||||||
const Vector inline unitVector3D() const
|
inline const Vector unitVector3D() const
|
||||||
{
|
{
|
||||||
return (*this) * (1/getLength3D());
|
return (*this) * (1/getLength3D());
|
||||||
}
|
}
|
||||||
|
|
||||||
// normalize this vector
|
// normalize this vector
|
||||||
void inline normalize3D()
|
inline void normalize3D()
|
||||||
{
|
{
|
||||||
if (x == 0 && y == 0 && z == 0)
|
if (x == 0 && y == 0 && z == 0)
|
||||||
{
|
{
|
||||||
|
@ -264,7 +261,7 @@ public:
|
||||||
(*this) *= 1/getLength3D();
|
(*this) *= 1/getLength3D();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void inline normalize2D()
|
inline void normalize2D()
|
||||||
{
|
{
|
||||||
if (x == 0 && y == 0)
|
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);
|
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 !!
|
// IGNORE !!
|
||||||
if (l == 0)
|
if (l == 0)
|
||||||
|
@ -312,7 +309,7 @@ public:
|
||||||
this->z *= (l/len);
|
this->z *= (l/len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void inline setLength2D(const float l)
|
inline void setLength2D(const float l)
|
||||||
{
|
{
|
||||||
float len = getLength2D();
|
float len = getLength2D();
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
|
@ -328,24 +325,24 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// return angle between two vectors
|
// 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);
|
return acosf(*this % normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
const scalar_t inline cheatLen() const
|
inline scalar_t cheatLen() const
|
||||||
{
|
{
|
||||||
return (x*x + y*y + z*z);
|
return (x*x + y*y + z*z);
|
||||||
}
|
}
|
||||||
const scalar_t inline cheatLen2D() const
|
inline scalar_t cheatLen2D() const
|
||||||
{
|
{
|
||||||
return (x*x + y*y);
|
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);
|
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;
|
this->x = this->y = this->z = 0;
|
||||||
}
|
}
|
||||||
const float inline getSquaredLength2D() const
|
inline scalar_t getSquaredLength2D() const
|
||||||
{
|
{
|
||||||
return (x*x) + (y*y);
|
return (x*x) + (y*y);
|
||||||
}
|
}
|
||||||
const bool inline isZero() const
|
inline bool isZero() const
|
||||||
{
|
{
|
||||||
return x==0 && y==0 && z==0;
|
return x==0 && y==0 && z==0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool inline isNan() const
|
inline bool isNan() const
|
||||||
{
|
{
|
||||||
#ifdef BBGE_BUILD_WINDOWS
|
#ifdef BBGE_BUILD_WINDOWS
|
||||||
return _isnan(x) || _isnan(y) || _isnan(z);
|
return _isnan(x) || _isnan(y) || _isnan(z);
|
||||||
|
@ -383,11 +380,11 @@ public:
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void inline capLength2D(const float l)
|
inline void capLength2D(const float l)
|
||||||
{
|
{
|
||||||
if (!isLength2DIn(l)) setLength2D(l);
|
if (!isLength2DIn(l)) setLength2D(l);
|
||||||
}
|
}
|
||||||
void inline capRotZ360()
|
inline void capRotZ360()
|
||||||
{
|
{
|
||||||
while (z > 360)
|
while (z > 360)
|
||||||
z -= 360;
|
z -= 360;
|
||||||
|
@ -573,3 +570,5 @@ public:
|
||||||
Vector getRotatedVector(const Vector &vec, float rot);
|
Vector getRotatedVector(const Vector &vec, float rot);
|
||||||
|
|
||||||
Vector lerp(const Vector &v1, const Vector &v2, float dt, int lerpType);
|
Vector lerp(const Vector &v1, const Vector &v2, float dt, int lerpType);
|
||||||
|
|
||||||
|
#endif // BBGE_VECTOR_H
|
||||||
|
|
|
@ -12,6 +12,10 @@ IF(APPLE)
|
||||||
SET(MACOSX TRUE)
|
SET(MACOSX TRUE)
|
||||||
ENDIF(APPLE)
|
ENDIF(APPLE)
|
||||||
|
|
||||||
|
IF(CMAKE_SYSTEM_NAME STREQUAL "Haiku")
|
||||||
|
SET(HAIKU TRUE)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
OPTION(AQUARIA_DEVELOPER_BUILD "Developer Build?" FALSE)
|
OPTION(AQUARIA_DEVELOPER_BUILD "Developer Build?" FALSE)
|
||||||
OPTION(AQUARIA_DEMO_BUILD "Demo Build?" FALSE)
|
OPTION(AQUARIA_DEMO_BUILD "Demo Build?" FALSE)
|
||||||
OPTION(AQUARIA_USE_VFS "Use Virtual File System? Required for some additional features." TRUE)
|
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(LUADIR ${EXTLIBDIR}/lua-5.1.4)
|
||||||
SET(LUASRCDIR ${LUADIR}/src)
|
SET(LUASRCDIR ${LUADIR}/src)
|
||||||
SET(LIBOGGDIR ${EXTLIBDIR}/libogg-1.3.0)
|
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(ZLIBDIR ${EXTLIBDIR}/glpng/zlib)
|
||||||
SET(PNGDIR ${EXTLIBDIR}/glpng/png)
|
SET(PNGDIR ${EXTLIBDIR}/glpng/png)
|
||||||
|
|
||||||
|
@ -258,9 +262,9 @@ ENDIF(WIN32)
|
||||||
|
|
||||||
|
|
||||||
# Build Lua with Unix _setjmp/_longjmp support.
|
# Build Lua with Unix _setjmp/_longjmp support.
|
||||||
IF(UNIX)
|
IF(UNIX AND NOT HAIKU)
|
||||||
ADD_DEFINITIONS(-DLUA_USE_ULONGJMP=1)
|
ADD_DEFINITIONS(-DLUA_USE_ULONGJMP=1)
|
||||||
ENDIF(UNIX)
|
ENDIF()
|
||||||
|
|
||||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||||
ADD_DEFINITIONS(-pipe -fsigned-char)
|
ADD_DEFINITIONS(-pipe -fsigned-char)
|
||||||
|
@ -627,6 +631,10 @@ IF(MACOSX)
|
||||||
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "-framework OpenAL")
|
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "-framework OpenAL")
|
||||||
ENDIF(MACOSX)
|
ENDIF(MACOSX)
|
||||||
|
|
||||||
|
IF(HAIKU)
|
||||||
|
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} "network")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} ${SDL_LIBRARY})
|
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} ${SDL_LIBRARY})
|
||||||
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} ${OPENAL_LIBRARY})
|
SET(OPTIONAL_LIBS ${OPTIONAL_LIBS} ${OPENAL_LIBRARY})
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,12 @@
|
||||||
#include <string.h> // for memcpy
|
#include <string.h> // for memcpy
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && __GNUC__ <= 2
|
||||||
|
# define BB_OLD_GNUC
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ** compatibility stuff for BBGE .... **
|
// ** compatibility stuff for BBGE .... **
|
||||||
|
@ -26,7 +32,7 @@
|
||||||
|
|
||||||
namespace ByteBufferTools
|
namespace ByteBufferTools
|
||||||
{
|
{
|
||||||
template<size_t T> inline void convert(char *val)
|
template<int T> inline void convert(char *val)
|
||||||
{
|
{
|
||||||
std::swap(*val, *(val + T - 1));
|
std::swap(*val, *(val + T - 1));
|
||||||
convert<T - 2>(val + 1);
|
convert<T - 2>(val + 1);
|
||||||
|
@ -39,12 +45,21 @@ namespace ByteBufferTools
|
||||||
convert<sizeof(T)>((char *)(val));
|
convert<sizeof(T)>((char *)(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void EndianConvertRT(char *p, unsigned int size)
|
||||||
|
{
|
||||||
|
std::reverse(p, p + size);
|
||||||
|
}
|
||||||
|
|
||||||
#if BB_IS_BIG_ENDIAN
|
#if BB_IS_BIG_ENDIAN
|
||||||
template<typename T> inline void ToLittleEndian(T& val) { EndianConvert<T>(&val); }
|
template<typename T> inline void ToLittleEndian(T& val) { EndianConvert<T>(&val); }
|
||||||
|
inline void ToLittleEndianRT(void *p, unsigned int size) { EndianConvertRT((char*)p, size); }
|
||||||
template<typename T> inline void ToBigEndian(T&) { }
|
template<typename T> inline void ToBigEndian(T&) { }
|
||||||
|
inline void ToBigEndianRT(void *p, unsigned int size) { }
|
||||||
#else
|
#else
|
||||||
template<typename T> inline void ToLittleEndian(T&) { }
|
template<typename T> inline void ToLittleEndian(T&) { }
|
||||||
|
inline void ToLittleEndianRT(void *p, unsigned int size) { }
|
||||||
template<typename T> inline void ToBigEndian(T& val) { EndianConvert<T>(&val); }
|
template<typename T> inline void ToBigEndian(T& val) { EndianConvert<T>(&val); }
|
||||||
|
inline void ToBigEndianRT(void *p, unsigned int size) { EndianConvertRT((char*)p, size); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
template<typename T> void ToLittleEndian(T*); // will generate link error
|
template<typename T> 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<T>(val); return *this; }
|
#ifdef BB_OLD_GNUC
|
||||||
#define BB_MAKE_READ_OP(T) inline ByteBuffer& operator>>(T &val) { val = read<T>(); return *this; }
|
# 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<T>(val); return *this; }
|
||||||
|
# define BB_MAKE_READ_OP(T) inline ByteBuffer& operator>>(T &val) { val = read<T>(); return *this; }
|
||||||
|
#endif
|
||||||
|
|
||||||
class ByteBuffer
|
class ByteBuffer
|
||||||
{
|
{
|
||||||
|
@ -241,23 +261,17 @@ public:
|
||||||
BB_MAKE_WRITE_OP(float);
|
BB_MAKE_WRITE_OP(float);
|
||||||
BB_MAKE_WRITE_OP(double);
|
BB_MAKE_WRITE_OP(double);
|
||||||
|
|
||||||
ByteBuffer &operator<<(bool value)
|
|
||||||
{
|
|
||||||
append<char>((char)value);
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
ByteBuffer &operator<<(const char *str)
|
ByteBuffer &operator<<(const char *str)
|
||||||
{
|
{
|
||||||
append((uint8 *)str, str ? strlen(str) : 0);
|
append((uint8 *)str, str ? strlen(str) : 0);
|
||||||
append((uint8)0);
|
appendByte(0);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
ByteBuffer &operator<<(const std::string &value)
|
ByteBuffer &operator<<(const std::string &value)
|
||||||
{
|
{
|
||||||
append((uint8 *)value.c_str(), value.length());
|
append((uint8 *)value.c_str(), value.length());
|
||||||
append((uint8)0);
|
appendByte(0);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,22 +285,18 @@ public:
|
||||||
BB_MAKE_READ_OP(float);
|
BB_MAKE_READ_OP(float);
|
||||||
BB_MAKE_READ_OP(double);
|
BB_MAKE_READ_OP(double);
|
||||||
|
|
||||||
ByteBuffer &operator>>(bool &value)
|
inline uint8 operator[](uint32 pos) const
|
||||||
{
|
{
|
||||||
value = read<char>() > 0 ? true : false;
|
if(pos >= size())
|
||||||
return *this;
|
BYTEBUFFER_EXCEPT(this, "operator[]", 1);
|
||||||
}
|
return _buf[pos];
|
||||||
|
|
||||||
uint8 operator[](uint32 pos)
|
|
||||||
{
|
|
||||||
return read<uint8>(pos);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ByteBuffer &operator>>(std::string& value)
|
ByteBuffer &operator>>(std::string& value)
|
||||||
{
|
{
|
||||||
value.clear();
|
value.clear();
|
||||||
char c;
|
char c;
|
||||||
while(readable() && (c = read<char>()))
|
while(readable() && (c = readByte()))
|
||||||
value += c;
|
value += c;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@ -313,6 +323,7 @@ public:
|
||||||
_rpos += sizeof(T);
|
_rpos += sizeof(T);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> T read(uint32 pos) const
|
template <typename T> T read(uint32 pos) const
|
||||||
{
|
{
|
||||||
if(pos + sizeof(T) > size())
|
if(pos + sizeof(T) > size())
|
||||||
|
@ -322,6 +333,20 @@ public:
|
||||||
return val;
|
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)
|
void read(void *dest, uint32 len)
|
||||||
{
|
{
|
||||||
if (_rpos + len <= size())
|
if (_rpos + len <= size())
|
||||||
|
@ -352,7 +377,7 @@ public:
|
||||||
inline uint32 readable(void) const { return size() - rpos(); }
|
inline uint32 readable(void) const { return size() - rpos(); }
|
||||||
inline uint32 writable(void) const { return size() - wpos(); } // free space left before realloc will occur
|
inline uint32 writable(void) const { return size() - wpos(); } // free space left before realloc will occur
|
||||||
|
|
||||||
template <typename T> void append(T value)
|
template <typename T> inline void append(T value)
|
||||||
{
|
{
|
||||||
ByteBufferTools::ToLittleEndian<T>(value);
|
ByteBufferTools::ToLittleEndian<T>(value);
|
||||||
_enlargeIfReq(_wpos + sizeof(T));
|
_enlargeIfReq(_wpos + sizeof(T));
|
||||||
|
@ -362,6 +387,21 @@ public:
|
||||||
_size = _wpos;
|
_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)
|
void append(const void *src, uint32 bytes)
|
||||||
{
|
{
|
||||||
if (!bytes) return;
|
if (!bytes) return;
|
||||||
|
@ -382,7 +422,7 @@ public:
|
||||||
memcpy(_buf + pos, src, bytes);
|
memcpy(_buf + pos, src, bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> void put(uint32 pos, T value)
|
template <typename T> void put(uint32 pos, const T& value)
|
||||||
{
|
{
|
||||||
if(pos >= size())
|
if(pos >= size())
|
||||||
BYTEBUFFER_EXCEPT(this, "put", sizeof(T));
|
BYTEBUFFER_EXCEPT(this, "put", sizeof(T));
|
||||||
|
|
|
@ -118,7 +118,7 @@ bool InStream::open(const char *fn)
|
||||||
vf->dropBuf(true);
|
vf->dropBuf(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
setstate(std::ios_base::failbit);
|
setstate(std::ios::failbit);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ int GLFont::GetEndChar (void)
|
||||||
return header.end_char;
|
return header.end_char;
|
||||||
}
|
}
|
||||||
//*******************************************************************
|
//*******************************************************************
|
||||||
void GLFont::GetCharSize (unsigned int c, std::pair<int, int> *size)
|
void GLFont::GetCharSize (unsigned char c, std::pair<int, int> *size)
|
||||||
{
|
{
|
||||||
//Make sure character is in range
|
//Make sure character is in range
|
||||||
if (c < header.start_char || c > header.end_char)
|
if (c < header.start_char || c > header.end_char)
|
||||||
|
@ -216,7 +216,7 @@ void GLFont::GetCharSize (unsigned int c, std::pair<int, int> *size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//*******************************************************************
|
//*******************************************************************
|
||||||
int GLFont::GetCharWidth (unsigned int c)
|
int GLFont::GetCharWidth (unsigned char c)
|
||||||
{
|
{
|
||||||
//Make sure in range
|
//Make sure in range
|
||||||
if (c < header.start_char || c > header.end_char)
|
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
|
//Make sure in range
|
||||||
if (c < header.start_char || c > header.end_char)
|
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<int, int> *size)
|
void GLFont::GetStringSize (const std::string &text, std::pair<int, int> *size)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
unsigned char c;
|
unsigned int c;
|
||||||
GLFontChar *glfont_char;
|
GLFontChar *glfont_char;
|
||||||
float width;
|
float width;
|
||||||
|
|
||||||
|
|
|
@ -70,9 +70,9 @@ public:
|
||||||
int GetEndChar (void);
|
int GetEndChar (void);
|
||||||
|
|
||||||
//Character size retrieval methods
|
//Character size retrieval methods
|
||||||
void GetCharSize (unsigned int c, std::pair<int, int> *size);
|
void GetCharSize (unsigned char c, std::pair<int, int> *size);
|
||||||
int GetCharWidth (unsigned int c);
|
int GetCharWidth (unsigned char c);
|
||||||
int GetCharHeight (unsigned int c);
|
int GetCharHeight (unsigned char c);
|
||||||
|
|
||||||
void GetStringSize (const std::string &text, std::pair<int, int> *size);
|
void GetStringSize (const std::string &text, std::pair<int, int> *size);
|
||||||
|
|
||||||
|
@ -86,21 +86,20 @@ public:
|
||||||
float y, const float *top_color, const float *bottom_color, float alpha, float lastAlpha)
|
float y, const float *top_color, const float *bottom_color, float alpha, float lastAlpha)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
T c;
|
|
||||||
GLFontChar *glfont_char;
|
GLFontChar *glfont_char;
|
||||||
float width, height;
|
float width, height;
|
||||||
|
|
||||||
//Begin rendering quads
|
//Begin rendering quads
|
||||||
glBegin(GL_QUADS);
|
glBegin(GL_QUADS);
|
||||||
|
|
||||||
int sz = text.size();
|
unsigned int sz = text.size();
|
||||||
|
|
||||||
float a = 0;
|
float a = 0;
|
||||||
//Loop through characters
|
//Loop through characters
|
||||||
for (i = 0; i < sz; i++)
|
for (i = 0; i < sz; i++)
|
||||||
{
|
{
|
||||||
//Make sure character is in range
|
//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)
|
if (c < header.start_char || c > header.end_char)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
/* png.c - location for general purpose libpng functions
|
/* png.c - location for general purpose libpng functions
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.5.7 [December 15, 2011]
|
* Last changed in libpng 1.5.11 [June 14, 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.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
#include "pngpriv.h"
|
#include "pngpriv.h"
|
||||||
|
|
||||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
/* 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
|
/* 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
|
* 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
|
#else
|
||||||
# ifdef __STDC__
|
# ifdef __STDC__
|
||||||
return PNG_STRING_NEWLINE \
|
return PNG_STRING_NEWLINE \
|
||||||
"libpng version 1.5.7 - December 15, 2011" PNG_STRING_NEWLINE \
|
"libpng version 1.5.12 - July 11, 2012" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1998-2011 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
|
"Copyright (c) 1998-2012 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||||
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
||||||
PNG_STRING_NEWLINE;
|
PNG_STRING_NEWLINE;
|
||||||
# else
|
# else
|
||||||
return "libpng version 1.5.7 - December 15, 2011\
|
return "libpng version 1.5.12 - July 11, 2012\
|
||||||
Copyright (c) 1998-2011 Glenn Randers-Pehrson\
|
Copyright (c) 1998-2012 Glenn Randers-Pehrson\
|
||||||
Copyright (c) 1996-1997 Andreas Dilger\
|
Copyright (c) 1996-1997 Andreas Dilger\
|
||||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
||||||
# endif
|
# 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
|
* and it is certain that it becomes unstable where the end points are close
|
||||||
* together.
|
* together.
|
||||||
*
|
*
|
||||||
* So this code uses the perhaps slighly less optimal but more understandable
|
* So this code uses the perhaps slightly less optimal but more
|
||||||
* and totally obvious approach of calculating color-scale.
|
* understandable and totally obvious approach of calculating color-scale.
|
||||||
*
|
*
|
||||||
* This algorithm depends on the precision in white-scale and that is
|
* 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
|
* (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)
|
png_pow10(int power)
|
||||||
{
|
{
|
||||||
int recip = 0;
|
int recip = 0;
|
||||||
double d = 1;
|
double d = 1.0;
|
||||||
|
|
||||||
/* Handle negative exponent with a reciprocal at the end because
|
/* Handle negative exponent with a reciprocal at the end because
|
||||||
* 10 is exact whereas .1 is inexact in base 2
|
* 10 is exact whereas .1 is inexact in base 2
|
||||||
|
@ -1481,7 +1481,7 @@ png_pow10(int power)
|
||||||
if (power > 0)
|
if (power > 0)
|
||||||
{
|
{
|
||||||
/* Decompose power bitwise. */
|
/* Decompose power bitwise. */
|
||||||
double mult = 10;
|
double mult = 10.0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (power & 1) d *= mult;
|
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;
|
double d;
|
||||||
|
|
||||||
fp *= 10;
|
fp *= 10.0;
|
||||||
|
|
||||||
/* Use modf here, not floor and subtract, so that
|
/* Use modf here, not floor and subtract, so that
|
||||||
* the separation is done in one step. At the end
|
* the separation is done in one step. At the end
|
||||||
* of the loop don't break the number into parts so
|
* 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);
|
d = floor(fp + .5);
|
||||||
|
|
||||||
if (d > 9)
|
if (d > 9.0)
|
||||||
{
|
{
|
||||||
/* Rounding up to 10, handle that here. */
|
/* Rounding up to 10, handle that here. */
|
||||||
if (czero > 0)
|
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;
|
--czero, d = 1;
|
||||||
if (cdigits == 0) --clead;
|
if (cdigits == 0) --clead;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while (cdigits > 0 && d > 9)
|
while (cdigits > 0 && d > 9.0)
|
||||||
{
|
{
|
||||||
int ch = *--ascii;
|
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
|
* exponent but take into account the leading
|
||||||
* decimal point.
|
* decimal point.
|
||||||
*/
|
*/
|
||||||
if (d > 9) /* cdigits == 0 */
|
if (d > 9.0) /* cdigits == 0 */
|
||||||
{
|
{
|
||||||
if (exp_b10 == (-1))
|
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;
|
++exp_b10;
|
||||||
|
|
||||||
/* In all cases we output a '1' */
|
/* In all cases we output a '1' */
|
||||||
d = 1;
|
d = 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fp = 0; /* Guarantees termination below. */
|
fp = 0; /* Guarantees termination below. */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d == 0)
|
if (d == 0.0)
|
||||||
{
|
{
|
||||||
++czero;
|
++czero;
|
||||||
if (cdigits == 0) ++clead;
|
if (cdigits == 0) ++clead;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Included embedded zeros in the digit count. */
|
/* 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 */
|
above */
|
||||||
--exp_b10;
|
--exp_b10;
|
||||||
}
|
}
|
||||||
|
|
||||||
*ascii++ = (char)(48 + (int)d), ++cdigits;
|
*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
|
#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. */
|
/* Calculate a reciprocal, return 0 on div-by-zero or overflow. */
|
||||||
png_fixed_point
|
png_fixed_point
|
||||||
png_reciprocal(png_fixed_point a)
|
png_reciprocal(png_fixed_point a)
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
/* png.h - header file for PNG reference library
|
/* png.h - header file for PNG reference library
|
||||||
*
|
*
|
||||||
* 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.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
* Authors and maintainers:
|
* Authors and maintainers:
|
||||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
* 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.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.
|
* See also "Contributing Authors", below.
|
||||||
*
|
*
|
||||||
* Note about libpng version numbers:
|
* Note about libpng version numbers:
|
||||||
|
@ -166,6 +166,18 @@
|
||||||
* 1.5.7beta01-05 15 10507 15.so.15.7[.0]
|
* 1.5.7beta01-05 15 10507 15.so.15.7[.0]
|
||||||
* 1.5.7rc01-03 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.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
|
* Henceforth the source version will match the shared-library major
|
||||||
* and minor numbers; the shared-library major version number will be
|
* 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
|
* 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
|
* were given the previous public release number plus a letter, until
|
||||||
* version 1.0.6j; from then on they were given the upcoming public
|
* 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
|
* Binary incompatibility exists only when applications make direct access
|
||||||
* to the info_ptr or png_ptr members through png.h, and the compiled
|
* 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.
|
* This code is released under the libpng license.
|
||||||
*
|
*
|
||||||
* libpng versions 1.2.6, August 15, 2004, through 1.5.7, December 15, 2011, are
|
* libpng versions 1.2.6, August 15, 2004, through 1.5.12, July 11, 2012, are
|
||||||
* Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are
|
* Copyright (c) 2004, 2006-2012 Glenn Randers-Pehrson, and are
|
||||||
* distributed according to the same disclaimer and license as libpng-1.2.5
|
* distributed according to the same disclaimer and license as libpng-1.2.5
|
||||||
* with the following individual added to the list of Contributing Authors:
|
* with the following individual added to the list of Contributing Authors:
|
||||||
*
|
*
|
||||||
|
@ -309,13 +321,13 @@
|
||||||
* Y2K compliance in libpng:
|
* Y2K compliance in libpng:
|
||||||
* =========================
|
* =========================
|
||||||
*
|
*
|
||||||
* December 15, 2011
|
* July 11, 2012
|
||||||
*
|
*
|
||||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||||
* an official declaration.
|
* an official declaration.
|
||||||
*
|
*
|
||||||
* This is your unofficial assurance that libpng from version 0.71 and
|
* 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.
|
* earlier versions were also Y2K compliant.
|
||||||
*
|
*
|
||||||
* Libpng only has two year fields. One is a 2-byte unsigned integer
|
* 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.
|
* "png_uint_16 year" in png_time_struct.
|
||||||
*
|
*
|
||||||
* The string is
|
* 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:
|
* There are seven time-related functions:
|
||||||
* png.c: png_convert_to_rfc_1123() in png.c
|
* 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 */
|
/* 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 \
|
#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_SONUM 15
|
||||||
#define PNG_LIBPNG_VER_DLLNUM 15
|
#define PNG_LIBPNG_VER_DLLNUM 15
|
||||||
|
@ -383,7 +396,7 @@
|
||||||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||||
#define PNG_LIBPNG_VER_MAJOR 1
|
#define PNG_LIBPNG_VER_MAJOR 1
|
||||||
#define PNG_LIBPNG_VER_MINOR 5
|
#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
|
/* This should match the numeric part of the final component of
|
||||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
||||||
|
@ -406,7 +419,7 @@
|
||||||
#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
|
#define PNG_LIBPNG_BUILD_SPECIAL 32 /* Cannot be OR'ed with
|
||||||
PNG_LIBPNG_BUILD_PRIVATE */
|
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.
|
/* Careful here. At one time, Guy wanted to use 082, but that would be octal.
|
||||||
* We must not include leading zeros.
|
* 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.0 was mis-numbered 100 instead of 10000). From
|
||||||
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
|
* 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
|
/* Library configuration: these options cannot be changed after
|
||||||
* the library has been built.
|
* 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
|
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||||
* do not agree upon the version number.
|
* 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
|
/* 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
|
* 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)))
|
: (png_int_32)png_get_uint_32(buf)))
|
||||||
#endif
|
#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
|
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project
|
||||||
* defs
|
* defs
|
||||||
*/
|
*/
|
||||||
|
@ -2640,7 +2659,7 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));
|
||||||
* scripts/symbols.def as well.
|
* scripts/symbols.def as well.
|
||||||
*/
|
*/
|
||||||
#ifdef PNG_EXPORT_LAST_ORDINAL
|
#ifdef PNG_EXPORT_LAST_ORDINAL
|
||||||
PNG_EXPORT_LAST_ORDINAL(233);
|
PNG_EXPORT_LAST_ORDINAL(234);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
|
||||||
/* pngconf.h - machine configurable file for libpng
|
/* 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.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||||
*
|
*
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
#ifndef PNG_BUILDING_SYMBOL_TABLE
|
#ifndef PNG_BUILDING_SYMBOL_TABLE
|
||||||
/* PNG_NO_LIMITS_H may be used to turn off the use of the standard C
|
/* 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
|
* 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
|
# ifndef PNG_NO_LIMITS_H
|
||||||
# include <limits.h>
|
# include <limits.h>
|
||||||
|
@ -51,8 +51,8 @@
|
||||||
|
|
||||||
/* This controls optimization of the reading of 16 and 32 bit values
|
/* 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
|
* 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.
|
* just changes whether a macro is used when the function is called.
|
||||||
* The library builder sets the default, if read functions are not
|
* The library builder sets the default; if read functions are not
|
||||||
* built into the library the macro implementation is forced on.
|
* built into the library the macro implementation is forced on.
|
||||||
*/
|
*/
|
||||||
#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
|
#ifndef PNG_READ_INT_FUNCTIONS_SUPPORTED
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
/* pngerror.c - stub functions for i/o and memory allocation
|
/* 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
|
* Copyright (c) 1998-2011 Glenn Randers-Pehrson
|
||||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (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_formatted_warning(png_structp png_ptr, png_warning_parameters p,
|
||||||
png_const_charp message)
|
png_const_charp message)
|
||||||
{
|
{
|
||||||
/* The internal buffer is just 128 bytes - enough for all our messages,
|
/* The internal buffer is just 192 bytes - enough for all our messages,
|
||||||
* overflow doesn't happen because this code checks!
|
* 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;
|
size_t i = 0; /* Index in the msg[] buffer: */
|
||||||
char msg[128];
|
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;
|
int parameter_char = *++message; /* Consume the '@' */
|
||||||
switch (*++message)
|
static const char valid_parameters[] = "123456789";
|
||||||
{
|
int parameter = 0;
|
||||||
case '1':
|
|
||||||
parameter = 0;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '2':
|
/* Search for the parameter digit, the index in the string is the
|
||||||
parameter = 1;
|
* parameter to use.
|
||||||
break;
|
*/
|
||||||
|
while (valid_parameters[parameter] != parameter_char &&
|
||||||
|
valid_parameters[parameter] != '\0')
|
||||||
|
++parameter;
|
||||||
|
|
||||||
case '\0':
|
/* If the parameter digit is out of range it will just get printed. */
|
||||||
continue; /* To break out of the for loop above. */
|
if (parameter < PNG_WARNING_PARAMETER_COUNT)
|
||||||
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parameter >= 0 && parameter < PNG_WARNING_PARAMETER_COUNT)
|
|
||||||
{
|
{
|
||||||
/* Append this parameter */
|
/* Append this parameter */
|
||||||
png_const_charp parm = p[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
|
* that parm[] has been initialized, so there is no guarantee of a
|
||||||
* trailing '\0':
|
* trailing '\0':
|
||||||
*/
|
*/
|
||||||
for (; i<(sizeof msg)-1 && parm != '\0' && parm < pend; ++i)
|
while (i<(sizeof msg)-1 && *parm != '\0' && parm < pend)
|
||||||
msg[i] = *parm++;
|
msg[i++] = *parm++;
|
||||||
|
|
||||||
|
/* Consume the parameter digit too: */
|
||||||
++message;
|
++message;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* else not a parameter and there is a character after the @ sign; just
|
/* 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
|
/* 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.
|
* 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: */
|
/* i is always less than (sizeof msg), so: */
|
||||||
msg[i] = '\0';
|
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);
|
png_warning(png_ptr, msg);
|
||||||
}
|
}
|
||||||
#endif /* PNG_WARNINGS_SUPPORTED */
|
#endif /* PNG_WARNINGS_SUPPORTED */
|
||||||
|
|
|
@ -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 */
|
/* This code is released under the libpng license. */
|
||||||
|
/* For conditions of distribution and use, see the disclaimer */
|
||||||
/* Copyright (c) 1998-2011 Glenn Randers-Pehrson */
|
/* 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 */
|
/* pnglibconf.h */
|
||||||
|
/* Machine generated file: DO NOT EDIT */
|
||||||
/* Derived from: scripts/pnglibconf.dfa */
|
/* 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
|
#ifndef PNGLCONF_H
|
||||||
#define PNGLCONF_H
|
#define PNGLCONF_H
|
||||||
/* settings */
|
/* 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_MAX_GAMMA_8 11
|
||||||
#define PNG_QUANTIZE_BLUE_BITS 5
|
#define PNG_CALLOC_SUPPORTED
|
||||||
#define PNG_QUANTIZE_GREEN_BITS 5
|
|
||||||
#define PNG_QUANTIZE_RED_BITS 5
|
#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_sCAL_PRECISION 5
|
||||||
#define PNG_USER_CHUNK_CACHE_MAX 0
|
#define PNG_COST_SHIFT 3
|
||||||
#define PNG_USER_CHUNK_MALLOC_MAX 0
|
|
||||||
#define PNG_USER_HEIGHT_MAX 1000000
|
|
||||||
#define PNG_USER_WIDTH_MAX 1000000
|
|
||||||
#define PNG_WEIGHT_SHIFT 8
|
#define PNG_WEIGHT_SHIFT 8
|
||||||
|
#define PNG_DEFAULT_READ_MACROS 1
|
||||||
#define PNG_ZBUF_SIZE 8192
|
#define PNG_ZBUF_SIZE 8192
|
||||||
|
#define PNG_GAMMA_THRESHOLD_FIXED 5000
|
||||||
/* end of settings */
|
/* end of settings */
|
||||||
/* options */
|
/* options */
|
||||||
#define PNG_16BIT_SUPPORTED
|
#define PNG_INFO_IMAGE_SUPPORTED 1
|
||||||
#define PNG_ALIGN_MEMORY_SUPPORTED
|
#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED 1
|
||||||
#define PNG_BENIGN_ERRORS_SUPPORTED
|
#define PNG_POINTER_INDEXING_SUPPORTED 1
|
||||||
#define PNG_bKGD_SUPPORTED
|
#define PNG_WARNINGS_SUPPORTED 1
|
||||||
#define PNG_BUILD_GRAYSCALE_PALETTE_SUPPORTED
|
#define PNG_FLOATING_ARITHMETIC_SUPPORTED 1
|
||||||
#define PNG_CHECK_cHRM_SUPPORTED
|
#define PNG_WRITE_SUPPORTED 1
|
||||||
#define PNG_cHRM_SUPPORTED
|
#define PNG_WRITE_INTERLACING_SUPPORTED 1
|
||||||
#define PNG_CONSOLE_IO_SUPPORTED
|
#define PNG_WRITE_16BIT_SUPPORTED 1
|
||||||
#define PNG_CONVERT_tIME_SUPPORTED
|
#define PNG_EASY_ACCESS_SUPPORTED 1
|
||||||
#define PNG_EASY_ACCESS_SUPPORTED
|
#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*/
|
/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/
|
||||||
#define PNG_ERROR_TEXT_SUPPORTED
|
#define PNG_ERROR_TEXT_SUPPORTED 1
|
||||||
#define PNG_FIXED_POINT_SUPPORTED
|
#define PNG_READ_SUPPORTED 1
|
||||||
#define PNG_FLOATING_ARITHMETIC_SUPPORTED
|
#define PNG_BENIGN_ERRORS_SUPPORTED 1
|
||||||
#define PNG_FLOATING_POINT_SUPPORTED
|
#define PNG_SETJMP_SUPPORTED 1
|
||||||
#define PNG_FORMAT_AFIRST_SUPPORTED
|
#define PNG_TIME_RFC1123_SUPPORTED 1
|
||||||
#define PNG_FORMAT_BGR_SUPPORTED
|
#define PNG_WRITE_FLUSH_SUPPORTED 1
|
||||||
#define PNG_gAMA_SUPPORTED
|
#define PNG_MNG_FEATURES_SUPPORTED 1
|
||||||
#define PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
/*#undef PNG_SAFE_LIMITS_SUPPORTED*/
|
||||||
#define PNG_hIST_SUPPORTED
|
#define PNG_FLOATING_POINT_SUPPORTED 1
|
||||||
#define PNG_iCCP_SUPPORTED
|
#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED 1
|
||||||
#define PNG_INCH_CONVERSIONS_SUPPORTED
|
#define PNG_INCH_CONVERSIONS_SUPPORTED 1
|
||||||
#define PNG_INFO_IMAGE_SUPPORTED
|
#define PNG_STDIO_SUPPORTED 1
|
||||||
#define PNG_IO_STATE_SUPPORTED
|
#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED 1
|
||||||
#define PNG_iTXt_SUPPORTED
|
#define PNG_USER_MEM_SUPPORTED 1
|
||||||
#define PNG_MNG_FEATURES_SUPPORTED
|
#define PNG_IO_STATE_SUPPORTED 1
|
||||||
#define PNG_oFFs_SUPPORTED
|
#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED 1
|
||||||
#define PNG_pCAL_SUPPORTED
|
#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED 1
|
||||||
#define PNG_pHYs_SUPPORTED
|
#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED 1
|
||||||
#define PNG_POINTER_INDEXING_SUPPORTED
|
#define PNG_WRITE_FILTER_SUPPORTED 1
|
||||||
#define PNG_PROGRESSIVE_READ_SUPPORTED
|
#define PNG_WRITE_zTXt_SUPPORTED 1
|
||||||
#define PNG_READ_16BIT_SUPPORTED
|
#define PNG_WRITE_iCCP_SUPPORTED 1
|
||||||
#define PNG_READ_ALPHA_MODE_SUPPORTED
|
#define PNG_READ_TRANSFORMS_SUPPORTED 1
|
||||||
#define PNG_READ_ANCILLARY_CHUNKS_SUPPORTED
|
#define PNG_READ_bKGD_SUPPORTED 1
|
||||||
#define PNG_READ_BACKGROUND_SUPPORTED
|
#define PNG_UNKNOWN_CHUNKS_SUPPORTED 1
|
||||||
#define PNG_READ_BGR_SUPPORTED
|
#define PNG_READ_sCAL_SUPPORTED 1
|
||||||
#define PNG_READ_bKGD_SUPPORTED
|
#define PNG_WRITE_hIST_SUPPORTED 1
|
||||||
#define PNG_READ_cHRM_SUPPORTED
|
#define PNG_READ_OPT_PLTE_SUPPORTED 1
|
||||||
#define PNG_READ_COMPOSITE_NODIV_SUPPORTED
|
#define PNG_WRITE_gAMA_SUPPORTED 1
|
||||||
#define PNG_READ_COMPRESSED_TEXT_SUPPORTED
|
#define PNG_READ_GRAY_TO_RGB_SUPPORTED 1
|
||||||
#define PNG_READ_EXPAND_16_SUPPORTED
|
#define PNG_WRITE_pCAL_SUPPORTED 1
|
||||||
#define PNG_READ_EXPAND_SUPPORTED
|
#define PNG_READ_INVERT_ALPHA_SUPPORTED 1
|
||||||
#define PNG_READ_FILLER_SUPPORTED
|
#define PNG_WRITE_TRANSFORMS_SUPPORTED 1
|
||||||
#define PNG_READ_gAMA_SUPPORTED
|
#define PNG_READ_ALPHA_MODE_SUPPORTED 1
|
||||||
#define PNG_READ_GAMMA_SUPPORTED
|
#define PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED 1
|
||||||
#define PNG_READ_GRAY_TO_RGB_SUPPORTED
|
#define PNG_READ_sBIT_SUPPORTED 1
|
||||||
#define PNG_READ_hIST_SUPPORTED
|
#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED 1
|
||||||
#define PNG_READ_iCCP_SUPPORTED
|
#define PNG_READ_PACK_SUPPORTED 1
|
||||||
#define PNG_READ_INTERLACING_SUPPORTED
|
#define PNG_WRITE_iTXt_SUPPORTED 1
|
||||||
#define PNG_READ_INT_FUNCTIONS_SUPPORTED
|
#define PNG_WRITE_SWAP_SUPPORTED 1
|
||||||
#define PNG_READ_INVERT_ALPHA_SUPPORTED
|
#define PNG_READ_cHRM_SUPPORTED 1
|
||||||
#define PNG_READ_INVERT_SUPPORTED
|
#define PNG_READ_STRIP_16_TO_8_SUPPORTED 1
|
||||||
#define PNG_READ_iTXt_SUPPORTED
|
#define PNG_WRITE_tIME_SUPPORTED 1
|
||||||
#define PNG_READ_oFFs_SUPPORTED
|
#define PNG_READ_INTERLACING_SUPPORTED 1
|
||||||
#define PNG_READ_OPT_PLTE_SUPPORTED
|
#define PNG_READ_tRNS_SUPPORTED 1
|
||||||
#define PNG_READ_PACK_SUPPORTED
|
#define PNG_WRITE_pHYs_SUPPORTED 1
|
||||||
#define PNG_READ_PACKSWAP_SUPPORTED
|
#define PNG_WRITE_INVERT_SUPPORTED 1
|
||||||
#define PNG_READ_pCAL_SUPPORTED
|
#define PNG_READ_RGB_TO_GRAY_SUPPORTED 1
|
||||||
#define PNG_READ_pHYs_SUPPORTED
|
#define PNG_WRITE_sRGB_SUPPORTED 1
|
||||||
#define PNG_READ_QUANTIZE_SUPPORTED
|
#define PNG_READ_oFFs_SUPPORTED 1
|
||||||
#define PNG_READ_RGB_TO_GRAY_SUPPORTED
|
#define PNG_WRITE_FILLER_SUPPORTED 1
|
||||||
#define PNG_READ_sBIT_SUPPORTED
|
#define PNG_WRITE_SHIFT_SUPPORTED 1
|
||||||
#define PNG_READ_SCALE_16_TO_8_SUPPORTED
|
#define PNG_PROGRESSIVE_READ_SUPPORTED 1
|
||||||
#define PNG_READ_sCAL_SUPPORTED
|
#define PNG_READ_SHIFT_SUPPORTED 1
|
||||||
#define PNG_READ_SHIFT_SUPPORTED
|
#define PNG_CONVERT_tIME_SUPPORTED 1
|
||||||
#define PNG_READ_sPLT_SUPPORTED
|
#define PNG_READ_USER_TRANSFORM_SUPPORTED 1
|
||||||
#define PNG_READ_sRGB_SUPPORTED
|
#define PNG_READ_INT_FUNCTIONS_SUPPORTED 1
|
||||||
#define PNG_READ_STRIP_16_TO_8_SUPPORTED
|
#define PNG_READ_USER_CHUNKS_SUPPORTED 1
|
||||||
#define PNG_READ_STRIP_ALPHA_SUPPORTED
|
#define PNG_READ_hIST_SUPPORTED 1
|
||||||
#define PNG_READ_SUPPORTED
|
#define PNG_READ_16BIT_SUPPORTED 1
|
||||||
#define PNG_READ_SWAP_ALPHA_SUPPORTED
|
#define PNG_READ_SWAP_ALPHA_SUPPORTED 1
|
||||||
#define PNG_READ_SWAP_SUPPORTED
|
#define PNG_READ_COMPOSITE_NODIV_SUPPORTED 1
|
||||||
#define PNG_READ_tEXt_SUPPORTED
|
#define PNG_SEQUENTIAL_READ_SUPPORTED 1
|
||||||
#define PNG_READ_TEXT_SUPPORTED
|
#define PNG_READ_BACKGROUND_SUPPORTED 1
|
||||||
#define PNG_READ_tIME_SUPPORTED
|
#define PNG_READ_QUANTIZE_SUPPORTED 1
|
||||||
#define PNG_READ_TRANSFORMS_SUPPORTED
|
#define PNG_READ_zTXt_SUPPORTED 1
|
||||||
#define PNG_READ_tRNS_SUPPORTED
|
#define PNG_USER_LIMITS_SUPPORTED 1
|
||||||
#define PNG_READ_UNKNOWN_CHUNKS_SUPPORTED
|
#define PNG_READ_iCCP_SUPPORTED 1
|
||||||
#define PNG_READ_USER_CHUNKS_SUPPORTED
|
#define PNG_READ_STRIP_ALPHA_SUPPORTED 1
|
||||||
#define PNG_READ_USER_TRANSFORM_SUPPORTED
|
#define PNG_READ_PACKSWAP_SUPPORTED 1
|
||||||
#define PNG_READ_zTXt_SUPPORTED
|
#define PNG_READ_sRGB_SUPPORTED 1
|
||||||
#define PNG_SAVE_INT_32_SUPPORTED
|
#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED 1
|
||||||
#define PNG_sBIT_SUPPORTED
|
#define PNG_READ_pCAL_SUPPORTED 1
|
||||||
#define PNG_sCAL_SUPPORTED
|
#define PNG_WRITE_sPLT_SUPPORTED 1
|
||||||
#define PNG_SEQUENTIAL_READ_SUPPORTED
|
#define PNG_READ_iTXt_SUPPORTED 1
|
||||||
#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED
|
#define PNG_READ_SWAP_SUPPORTED 1
|
||||||
#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
|
#define PNG_READ_tIME_SUPPORTED 1
|
||||||
#define PNG_SETJMP_SUPPORTED
|
#define PNG_READ_pHYs_SUPPORTED 1
|
||||||
#define PNG_SET_USER_LIMITS_SUPPORTED
|
#define PNG_WRITE_SWAP_ALPHA_SUPPORTED 1
|
||||||
#define PNG_sPLT_SUPPORTED
|
#define PNG_READ_SCALE_16_TO_8_SUPPORTED 1
|
||||||
#define PNG_sRGB_SUPPORTED
|
#define PNG_WRITE_BGR_SUPPORTED 1
|
||||||
#define PNG_STDIO_SUPPORTED
|
#define PNG_USER_CHUNKS_SUPPORTED 1
|
||||||
#define PNG_tEXt_SUPPORTED
|
#define PNG_CONSOLE_IO_SUPPORTED 1
|
||||||
#define PNG_TEXT_SUPPORTED
|
#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED 1
|
||||||
#define PNG_TIME_RFC1123_SUPPORTED
|
#define PNG_WRITE_PACK_SUPPORTED 1
|
||||||
#define PNG_tIME_SUPPORTED
|
#define PNG_READ_FILLER_SUPPORTED 1
|
||||||
#define PNG_tRNS_SUPPORTED
|
#define PNG_WRITE_bKGD_SUPPORTED 1
|
||||||
#define PNG_UNKNOWN_CHUNKS_SUPPORTED
|
#define PNG_WRITE_tRNS_SUPPORTED 1
|
||||||
#define PNG_USER_CHUNKS_SUPPORTED
|
#define PNG_READ_sPLT_SUPPORTED 1
|
||||||
#define PNG_USER_LIMITS_SUPPORTED
|
#define PNG_WRITE_sCAL_SUPPORTED 1
|
||||||
#define PNG_USER_MEM_SUPPORTED
|
#define PNG_WRITE_oFFs_SUPPORTED 1
|
||||||
#define PNG_USER_TRANSFORM_INFO_SUPPORTED
|
#define PNG_SET_USER_LIMITS_SUPPORTED 1
|
||||||
#define PNG_USER_TRANSFORM_PTR_SUPPORTED
|
#define PNG_WRITE_sBIT_SUPPORTED 1
|
||||||
#define PNG_WARNINGS_SUPPORTED
|
#define PNG_READ_INVERT_SUPPORTED 1
|
||||||
#define PNG_WRITE_16BIT_SUPPORTED
|
#define PNG_WRITE_cHRM_SUPPORTED 1
|
||||||
#define PNG_WRITE_ANCILLARY_CHUNKS_SUPPORTED
|
#define PNG_16BIT_SUPPORTED 1
|
||||||
#define PNG_WRITE_BGR_SUPPORTED
|
#define PNG_WRITE_USER_TRANSFORM_SUPPORTED 1
|
||||||
#define PNG_WRITE_bKGD_SUPPORTED
|
#define PNG_READ_BGR_SUPPORTED 1
|
||||||
#define PNG_WRITE_cHRM_SUPPORTED
|
#define PNG_WRITE_PACKSWAP_SUPPORTED 1
|
||||||
#define PNG_WRITE_COMPRESSED_TEXT_SUPPORTED
|
#define PNG_WRITE_INVERT_ALPHA_SUPPORTED 1
|
||||||
#define PNG_WRITE_CUSTOMIZE_ZTXT_COMPRESSION_SUPPORTED
|
#define PNG_sCAL_SUPPORTED 1
|
||||||
#define PNG_WRITE_FILLER_SUPPORTED
|
#define PNG_SET_CHUNK_CACHE_LIMIT_SUPPORTED 1
|
||||||
#define PNG_WRITE_FILTER_SUPPORTED
|
#define PNG_READ_GAMMA_SUPPORTED 1
|
||||||
#define PNG_WRITE_FLUSH_SUPPORTED
|
#define PNG_USER_TRANSFORM_INFO_SUPPORTED 1
|
||||||
#define PNG_WRITE_gAMA_SUPPORTED
|
#define PNG_sBIT_SUPPORTED 1
|
||||||
#define PNG_WRITE_hIST_SUPPORTED
|
#define PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED 1
|
||||||
#define PNG_WRITE_iCCP_SUPPORTED
|
#define PNG_cHRM_SUPPORTED 1
|
||||||
#define PNG_WRITE_INTERLACING_SUPPORTED
|
#define PNG_bKGD_SUPPORTED 1
|
||||||
#define PNG_WRITE_INT_FUNCTIONS_SUPPORTED
|
#define PNG_tRNS_SUPPORTED 1
|
||||||
#define PNG_WRITE_INVERT_ALPHA_SUPPORTED
|
#define PNG_oFFs_SUPPORTED 1
|
||||||
#define PNG_WRITE_INVERT_SUPPORTED
|
#define PNG_READ_EXPAND_16_SUPPORTED 1
|
||||||
#define PNG_WRITE_iTXt_SUPPORTED
|
#define PNG_USER_TRANSFORM_PTR_SUPPORTED 1
|
||||||
#define PNG_WRITE_oFFs_SUPPORTED
|
#define PNG_WRITE_TEXT_SUPPORTED 1
|
||||||
#define PNG_WRITE_OPTIMIZE_CMF_SUPPORTED
|
#define PNG_READ_COMPRESSED_TEXT_SUPPORTED 1
|
||||||
#define PNG_WRITE_PACK_SUPPORTED
|
#define PNG_hIST_SUPPORTED 1
|
||||||
#define PNG_WRITE_PACKSWAP_SUPPORTED
|
#define PNG_zTXt_SUPPORTED 1
|
||||||
#define PNG_WRITE_pCAL_SUPPORTED
|
#define PNG_iCCP_SUPPORTED 1
|
||||||
#define PNG_WRITE_pHYs_SUPPORTED
|
#define PNG_sRGB_SUPPORTED 1
|
||||||
#define PNG_WRITE_sBIT_SUPPORTED
|
#define PNG_pCAL_SUPPORTED 1
|
||||||
#define PNG_WRITE_sCAL_SUPPORTED
|
#define PNG_WRITE_tEXt_SUPPORTED 1
|
||||||
#define PNG_WRITE_SHIFT_SUPPORTED
|
#define PNG_CHECK_cHRM_SUPPORTED 1
|
||||||
#define PNG_WRITE_sPLT_SUPPORTED
|
#define PNG_READ_gAMA_SUPPORTED 1
|
||||||
#define PNG_WRITE_sRGB_SUPPORTED
|
#define PNG_iTXt_SUPPORTED 1
|
||||||
#define PNG_WRITE_SUPPORTED
|
#define PNG_tIME_SUPPORTED 1
|
||||||
#define PNG_WRITE_SWAP_ALPHA_SUPPORTED
|
#define PNG_READ_EXPAND_SUPPORTED 1
|
||||||
#define PNG_WRITE_SWAP_SUPPORTED
|
#define PNG_pHYs_SUPPORTED 1
|
||||||
#define PNG_WRITE_tEXt_SUPPORTED
|
#define PNG_READ_TEXT_SUPPORTED 1
|
||||||
#define PNG_WRITE_TEXT_SUPPORTED
|
#define PNG_SAVE_INT_32_SUPPORTED 1
|
||||||
#define PNG_WRITE_tIME_SUPPORTED
|
#define PNG_sPLT_SUPPORTED 1
|
||||||
#define PNG_WRITE_TRANSFORMS_SUPPORTED
|
#define PNG_READ_tEXt_SUPPORTED 1
|
||||||
#define PNG_WRITE_tRNS_SUPPORTED
|
#define PNG_gAMA_SUPPORTED 1
|
||||||
#define PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED
|
#define PNG_TEXT_SUPPORTED 1
|
||||||
#define PNG_WRITE_USER_TRANSFORM_SUPPORTED
|
#define PNG_tEXt_SUPPORTED 1
|
||||||
#define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED
|
|
||||||
#define PNG_WRITE_zTXt_SUPPORTED
|
|
||||||
#define PNG_zTXt_SUPPORTED
|
|
||||||
/* end of options */
|
/* end of options */
|
||||||
#endif /* PNGLCONF_H */
|
#endif /* PNGLCONF_H */
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
/* pngpread.c - read a png file in push mode
|
/* pngpread.c - read a png file in push mode
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.5.7 [December 15, 2011]
|
* Last changed in libpng 1.5.11 [June 14, 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.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (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;
|
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:
|
case PNG_SKIP_MODE:
|
||||||
{
|
{
|
||||||
png_push_crc_finish(png_ptr);
|
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_push_read_sig(png_structp png_ptr, png_infop info_ptr)
|
||||||
{
|
{
|
||||||
png_size_t num_checked = png_ptr->sig_bytes,
|
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)
|
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
|
else
|
||||||
png_error(png_ptr, "PNG file corrupted by ASCII conversion");
|
png_error(png_ptr, "PNG file corrupted by ASCII conversion");
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (png_ptr->sig_bytes >= 8)
|
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");
|
png_error(png_ptr, "Missing PLTE before IDAT");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
else if (chunk_name == png_PLTE)
|
else if (chunk_name == png_PLTE)
|
||||||
{
|
{
|
||||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
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;
|
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
|
#endif
|
||||||
|
@ -556,7 +533,7 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||||
return;
|
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
|
#endif
|
||||||
|
@ -569,10 +546,11 @@ png_push_read_chunk(png_structp png_ptr, png_infop info_ptr)
|
||||||
return;
|
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
|
#endif
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (png_ptr->push_length + 4 > png_ptr->buffer_size)
|
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);
|
png_push_save_buffer(png_ptr);
|
||||||
return;
|
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;
|
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_size -= save_size;
|
||||||
png_ptr->save_buffer_ptr += save_size;
|
png_ptr->save_buffer_ptr += save_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (png_ptr->skip_length && png_ptr->current_buffer_size)
|
if (png_ptr->skip_length && png_ptr->current_buffer_size)
|
||||||
{
|
{
|
||||||
png_size_t save_size = 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_size -= save_size;
|
||||||
png_ptr->current_buffer_ptr += save_size;
|
png_ptr->current_buffer_ptr += save_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!png_ptr->skip_length)
|
if (!png_ptr->skip_length)
|
||||||
{
|
{
|
||||||
if (png_ptr->buffer_size < 4)
|
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;
|
return;
|
||||||
|
|
||||||
ptr = buffer;
|
ptr = buffer;
|
||||||
|
|
||||||
if (png_ptr->save_buffer_size)
|
if (png_ptr->save_buffer_size)
|
||||||
{
|
{
|
||||||
png_size_t save_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_size -= save_size;
|
||||||
png_ptr->save_buffer_ptr += save_size;
|
png_ptr->save_buffer_ptr += save_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length && png_ptr->current_buffer_size)
|
if (length && png_ptr->current_buffer_size)
|
||||||
{
|
{
|
||||||
png_size_t save_size;
|
png_size_t save_size;
|
||||||
|
@ -709,6 +691,7 @@ png_push_save_buffer(png_structp png_ptr)
|
||||||
png_bytep dp;
|
png_bytep dp;
|
||||||
|
|
||||||
istop = png_ptr->save_buffer_size;
|
istop = png_ptr->save_buffer_size;
|
||||||
|
|
||||||
for (i = 0, sp = png_ptr->save_buffer_ptr, dp = png_ptr->save_buffer;
|
for (i = 0, sp = png_ptr->save_buffer_ptr, dp = png_ptr->save_buffer;
|
||||||
i < istop; i++, sp++, dp++)
|
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 >
|
if (png_ptr->save_buffer_size + png_ptr->current_buffer_size >
|
||||||
png_ptr->save_buffer_max)
|
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;
|
new_max = png_ptr->save_buffer_size + png_ptr->current_buffer_size + 256;
|
||||||
old_buffer = png_ptr->save_buffer;
|
old_buffer = png_ptr->save_buffer;
|
||||||
png_ptr->save_buffer = (png_bytep)png_malloc_warn(png_ptr,
|
png_ptr->save_buffer = (png_bytep)png_malloc_warn(png_ptr, new_max);
|
||||||
(png_size_t)new_max);
|
|
||||||
|
|
||||||
if (png_ptr->save_buffer == NULL)
|
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_free(png_ptr, old_buffer);
|
||||||
png_ptr->save_buffer_max = new_max;
|
png_ptr->save_buffer_max = new_max;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (png_ptr->current_buffer_size)
|
if (png_ptr->current_buffer_size)
|
||||||
{
|
{
|
||||||
png_memcpy(png_ptr->save_buffer + png_ptr->save_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->save_buffer_size += png_ptr->current_buffer_size;
|
||||||
png_ptr->current_buffer_size = 0;
|
png_ptr->current_buffer_size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
png_ptr->save_buffer_ptr = png_ptr->save_buffer;
|
png_ptr->save_buffer_ptr = png_ptr->save_buffer;
|
||||||
png_ptr->buffer_size = 0;
|
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_size -= save_size;
|
||||||
png_ptr->current_buffer_ptr += save_size;
|
png_ptr->current_buffer_ptr += save_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!png_ptr->idat_size)
|
if (!png_ptr->idat_size)
|
||||||
{
|
{
|
||||||
if (png_ptr->buffer_size < 4)
|
if (png_ptr->buffer_size < 4)
|
||||||
|
@ -1201,6 +1187,7 @@ png_push_process_row(png_structp png_ptr)
|
||||||
void /* PRIVATE */
|
void /* PRIVATE */
|
||||||
png_read_push_finish_row(png_structp png_ptr)
|
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 */
|
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
|
||||||
|
|
||||||
/* Start of interlace block */
|
/* 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
|
* it, uncomment it here and in png.h
|
||||||
static PNG_CONST png_byte FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
|
static PNG_CONST png_byte FARDATA png_pass_height[] = {8, 8, 4, 4, 2, 2, 1};
|
||||||
*/
|
*/
|
||||||
|
#endif
|
||||||
|
|
||||||
png_ptr->row_number++;
|
png_ptr->row_number++;
|
||||||
if (png_ptr->row_number < png_ptr->num_rows)
|
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 */
|
#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 */
|
void /* PRIVATE */
|
||||||
png_push_have_info(png_structp png_ptr, png_infop info_ptr)
|
png_push_have_info(png_structp png_ptr, png_infop info_ptr)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
/* pngpriv.h - private declarations for use inside libpng
|
/* pngpriv.h - private declarations for use inside libpng
|
||||||
*
|
*
|
||||||
* For conditions of distribution and use, see copyright notice in png.h
|
* 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.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (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.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* For conditions of distribution and use, see the disclaimer
|
||||||
|
@ -133,6 +133,46 @@
|
||||||
# define PNG_DLL_EXPORT
|
# define PNG_DLL_EXPORT
|
||||||
#endif
|
#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 is used for 16 bit gamma tables - only the top level pointers are const,
|
||||||
* this could be changed:
|
* 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_BACKGROUND_IS_GRAY 0x800
|
||||||
#define PNG_HAVE_PNG_SIGNATURE 0x1000
|
#define PNG_HAVE_PNG_SIGNATURE 0x1000
|
||||||
#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */
|
#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 */
|
/* Flags for the transformations the PNG library does on the image data */
|
||||||
#define PNG_BGR 0x0001
|
#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));
|
png_uint_32 length));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
|
|
||||||
PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
|
PNG_EXTERN void png_handle_unknown PNGARG((png_structp png_ptr,
|
||||||
png_infop info_ptr, png_uint_32 length));
|
png_infop info_ptr, png_uint_32 length));
|
||||||
#endif
|
|
||||||
|
|
||||||
PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr,
|
PNG_EXTERN void png_check_chunk_name PNGARG((png_structp png_ptr,
|
||||||
png_uint_32 chunk_name));
|
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 color_type, int interlace_type, int compression_type,
|
||||||
int filter_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) */
|
/* Free all memory used by the read (old method - NOT DLL EXPORTED) */
|
||||||
PNG_EXTERN void png_read_destroy PNGARG((png_structp png_ptr,
|
PNG_EXTERN void png_read_destroy PNGARG((png_structp png_ptr,
|
||||||
png_infop info_ptr, png_infop end_info_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_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_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)
|
#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 actual parser. This can be called repeatedly, it updates
|
||||||
* the index into the string and the state variable (which must
|
* the index into the string and the state variable (which must
|
||||||
* be initialzed to 0). It returns a result code, as above. There
|
* be initialzed to 0). It returns a result code, as above. There
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
/* pngread.c - read a PNG file
|
/* pngread.c - read a PNG file
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.5.7 [December 15, 2011]
|
* Last changed in libpng 1.5.10 [March 8, 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.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (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_width_max = PNG_USER_WIDTH_MAX;
|
||||||
png_ptr->user_height_max = PNG_USER_HEIGHT_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 */
|
/* Added at libpng-1.2.43 and 1.4.0 */
|
||||||
png_ptr->user_chunk_cache_max = PNG_USER_CHUNK_CACHE_MAX;
|
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 */
|
/* Added at libpng-1.2.43 and 1.4.1 */
|
||||||
png_ptr->user_chunk_malloc_max = PNG_USER_CHUNK_MALLOC_MAX;
|
png_ptr->user_chunk_malloc_max = PNG_USER_CHUNK_MALLOC_MAX;
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_SETJMP_SUPPORTED
|
#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 */
|
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
|
do
|
||||||
{
|
{
|
||||||
png_uint_32 length = png_read_chunk_header(png_ptr);
|
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);
|
png_free(png_ptr, png_ptr->save_buffer);
|
||||||
#endif
|
#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
|
/* Save the important info out of the png_struct, in case it is
|
||||||
* being used again.
|
* being used again.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.5.7 [December 15, 2011]
|
* Last changed in libpng 1.5.11 [June 14, 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.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (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 num_palette = png_ptr->num_palette;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/*NOTE: there are other transformations that should probably be in here
|
/* NOTE: there are other transformations that should probably be in
|
||||||
* too.
|
* here too.
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < num_palette; i++)
|
for (i = 0; i < num_palette; i++)
|
||||||
{
|
{
|
||||||
|
@ -1830,12 +1830,15 @@ png_init_read_transformations(png_structp png_ptr)
|
||||||
|
|
||||||
#ifdef PNG_READ_SHIFT_SUPPORTED
|
#ifdef PNG_READ_SHIFT_SUPPORTED
|
||||||
if ((png_ptr->transformations & PNG_SHIFT) &&
|
if ((png_ptr->transformations & PNG_SHIFT) &&
|
||||||
|
!(png_ptr->transformations & PNG_EXPAND) &&
|
||||||
(png_ptr->color_type == PNG_COLOR_TYPE_PALETTE))
|
(png_ptr->color_type == PNG_COLOR_TYPE_PALETTE))
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int istop = png_ptr->num_palette;
|
int istop = png_ptr->num_palette;
|
||||||
int shift = 8 - png_ptr->sig_bit.red;
|
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
|
/* 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
|
* the number of significant bits is 0 then no shift is done (this is an
|
||||||
* error condition which is silently ignored.)
|
* error condition which is silently ignored.)
|
||||||
|
@ -2274,7 +2277,7 @@ png_do_read_transformations(png_structp png_ptr, png_row_infop row_info)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_READ_GRAY_TO_RGB_SUPPORTED
|
#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) &&
|
if ((png_ptr->transformations & PNG_GRAY_TO_RGB) &&
|
||||||
(png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
|
(png_ptr->mode & PNG_BACKGROUND_IS_GRAY))
|
||||||
png_do_gray_to_rgb(row_info, png_ptr->row_buf + 1);
|
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);
|
png_do_unpack(row_info, png_ptr->row_buf + 1);
|
||||||
#endif
|
#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
|
#ifdef PNG_READ_BGR_SUPPORTED
|
||||||
if (png_ptr->transformations & PNG_BGR)
|
if (png_ptr->transformations & PNG_BGR)
|
||||||
png_do_bgr(row_info, png_ptr->row_buf + 1);
|
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)
|
if (red != green || red != blue)
|
||||||
{
|
{
|
||||||
rgb_error |= 1;
|
rgb_error |= 1;
|
||||||
/*NOTE: this is the historical approach which simply
|
/* NOTE: this is the historical approach which simply
|
||||||
* truncates the results.
|
* truncates the results.
|
||||||
*/
|
*/
|
||||||
*(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15);
|
*(dp++) = (png_byte)((rc*red + gc*green + bc*blue)>>15);
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
/* pngrutil.c - utilities to read a PNG file
|
/* pngrutil.c - utilities to read a PNG file
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.5.7 [December 15, 2011]
|
* Last changed in libpng 1.5.10 [March 8, 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.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (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
|
/* Now check the limits on this chunk - if the limit fails the
|
||||||
* compressed data will be removed, the prefix will remain.
|
* compressed data will be removed, the prefix will remain.
|
||||||
*/
|
*/
|
||||||
#ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
|
if (prefix_size >= (~(png_size_t)0) - 1 ||
|
||||||
if (png_ptr->user_chunk_malloc_max &&
|
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))
|
(prefix_size + expanded_size >= png_ptr->user_chunk_malloc_max - 1))
|
||||||
#else
|
#else
|
||||||
# ifdef PNG_USER_CHUNK_MALLOC_MAX
|
|| ((PNG_USER_CHUNK_MALLOC_MAX > 0) &&
|
||||||
if ((PNG_USER_CHUNK_MALLOC_MAX > 0) &&
|
|
||||||
prefix_size + expanded_size >= PNG_USER_CHUNK_MALLOC_MAX - 1)
|
prefix_size + expanded_size >= PNG_USER_CHUNK_MALLOC_MAX - 1)
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
)
|
||||||
png_warning(png_ptr, "Exceeded size limit while expanding chunk");
|
png_warning(png_ptr, "Exceeded size limit while expanding chunk");
|
||||||
|
|
||||||
/* If the size is zero either there was an error and a message
|
/* 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
|
* and we have nothing to do - the code will exit through the
|
||||||
* error case below.
|
* 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)
|
||||||
#else
|
|
||||||
if (expanded_size > 0)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
/* Success (maybe) - really uncompress the chunk. */
|
/* Success (maybe) - really uncompress the chunk. */
|
||||||
png_size_t new_size = 0;
|
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 */
|
/* Should be an error, but we can cope with it */
|
||||||
png_warning(png_ptr, "Out of place iCCP chunk");
|
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_warning(png_ptr, "Duplicate iCCP chunk");
|
||||||
png_crc_finish(png_ptr, length);
|
png_crc_finish(png_ptr, length);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
png_ptr->mode |= PNG_HAVE_iCCP;
|
||||||
|
|
||||||
#ifdef PNG_MAX_MALLOC_64K
|
#ifdef PNG_MAX_MALLOC_64K
|
||||||
if (length > (png_uint_32)65535L)
|
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_free(png_ptr, png_ptr->chunkdata);
|
||||||
png_ptr->chunkdata = (png_charp)png_malloc(png_ptr, length + 1);
|
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);
|
png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
|
||||||
|
|
||||||
if (png_crc_finish(png_ptr, skip))
|
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
|
* 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.
|
* 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);
|
png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
|
||||||
|
|
||||||
if (png_crc_finish(png_ptr, skip))
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
num = length / 2 ;
|
if (length > 2*PNG_MAX_PALETTE_LENGTH ||
|
||||||
|
length != (unsigned int) (2*png_ptr->num_palette))
|
||||||
if (num != (unsigned int)png_ptr->num_palette || num >
|
|
||||||
(unsigned int)PNG_MAX_PALETTE_LENGTH)
|
|
||||||
{
|
{
|
||||||
png_warning(png_ptr, "Incorrect hIST chunk length");
|
png_warning(png_ptr, "Incorrect hIST chunk length");
|
||||||
png_crc_finish(png_ptr, length);
|
png_crc_finish(png_ptr, length);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
num = length / 2 ;
|
||||||
|
|
||||||
for (i = 0; i < num; i++)
|
for (i = 0; i < num; i++)
|
||||||
{
|
{
|
||||||
png_byte buf[2];
|
png_byte buf[2];
|
||||||
|
@ -1956,7 +1955,7 @@ png_handle_pCAL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
slength = (png_size_t)length;
|
slength = length;
|
||||||
png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
|
png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
|
||||||
|
|
||||||
if (png_crc_finish(png_ptr, 0))
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
slength = (png_size_t)length;
|
slength = length;
|
||||||
png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
|
png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
|
||||||
png_ptr->chunkdata[slength] = 0x00; /* Null terminate the last string */
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
slength = (png_size_t)length;
|
slength = length;
|
||||||
png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
|
png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
|
||||||
|
|
||||||
if (png_crc_finish(png_ptr, skip))
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
slength = (png_size_t)length;
|
slength = length;
|
||||||
png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
|
png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
|
||||||
|
|
||||||
if (png_crc_finish(png_ptr, 0))
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
slength = (png_size_t)length;
|
slength = length;
|
||||||
png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
|
png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength);
|
||||||
|
|
||||||
if (png_crc_finish(png_ptr, 0))
|
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_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_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;
|
png_read_filter_row_paeth3_neon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
/* pngset.c - storage of image information into info struct
|
/* pngset.c - storage of image information into info struct
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.5.7 [December 15, 2011]
|
* Last changed in libpng 1.5.11 [June 14, 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.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (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
|
* 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
|
* 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
|
* 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.)
|
* displays that are all black or all white.)
|
||||||
*/
|
*/
|
||||||
if (file_gamma < 16 || file_gamma > 625000000)
|
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)
|
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)
|
if (info_ptr->text != NULL)
|
||||||
{
|
{
|
||||||
png_textp old_text;
|
png_textp old_text;
|
||||||
int old_max;
|
|
||||||
|
|
||||||
old_max = info_ptr->max_text;
|
|
||||||
info_ptr->max_text = info_ptr->num_text + num_text + 8;
|
info_ptr->max_text = info_ptr->num_text + num_text + 8;
|
||||||
old_text = info_ptr->text;
|
old_text = info_ptr->text;
|
||||||
|
|
||||||
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
|
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
|
||||||
(png_size_t)(info_ptr->max_text * png_sizeof(png_text)));
|
(png_size_t)(info_ptr->max_text * png_sizeof(png_text)));
|
||||||
|
|
||||||
if (info_ptr->text == NULL)
|
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);
|
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_sizeof(png_text)));
|
||||||
png_free(png_ptr, old_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,
|
info_ptr->text = (png_textp)png_malloc_warn(png_ptr,
|
||||||
(png_size_t)(info_ptr->max_text * png_sizeof(png_text)));
|
(png_size_t)(info_ptr->max_text * png_sizeof(png_text)));
|
||||||
if (info_ptr->text == NULL)
|
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);
|
return(1);
|
||||||
|
}
|
||||||
info_ptr->free_me |= PNG_FREE_TEXT;
|
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;
|
png_ptr->flags &= ~PNG_FLAG_BENIGN_ERRORS_WARN;
|
||||||
}
|
}
|
||||||
#endif /* PNG_BENIGN_ERRORS_SUPPORTED */
|
#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 */
|
#endif /* PNG_READ_SUPPORTED || PNG_WRITE_SUPPORTED */
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
|
|
||||||
/* pngstruct.h - header file for PNG reference library
|
/* 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.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (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.
|
* This code is released under the libpng license.
|
||||||
* For conditions of distribution and use, see the disclaimer
|
* 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_uint_32 crc; /* current chunk CRC value */
|
||||||
png_colorp palette; /* palette from the input file */
|
png_colorp palette; /* palette from the input file */
|
||||||
png_uint_16 num_palette; /* number of color entries in palette */
|
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_uint_16 num_trans; /* number of transparency values */
|
||||||
png_byte compression; /* file compression type (always 0) */
|
png_byte compression; /* file compression type (always 0) */
|
||||||
png_byte filter; /* file filter 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 process_mode; /* what push library is currently doing */
|
||||||
int cur_palette; /* current push library palette index */
|
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 */
|
#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */
|
||||||
|
|
||||||
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
|
#if defined(__TURBOC__) && !defined(_Windows) && !defined(__FLAT__)
|
||||||
|
@ -249,6 +248,7 @@ struct png_struct_def
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PNG_TIME_RFC1123_SUPPORTED
|
#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 */
|
char time_buffer[29]; /* String to hold RFC 1123 time text */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -283,9 +283,7 @@ struct png_struct_def
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* New member added in libpng-1.0.4 (renamed in 1.0.9) */
|
/* New member added in libpng-1.0.4 (renamed in 1.0.9) */
|
||||||
#if defined(PNG_MNG_FEATURES_SUPPORTED) || \
|
#if defined(PNG_MNG_FEATURES_SUPPORTED)
|
||||||
defined(PNG_READ_EMPTY_PLTE_SUPPORTED) || \
|
|
||||||
defined(PNG_WRITE_EMPTY_PLTE_SUPPORTED)
|
|
||||||
/* Changed from png_byte to png_uint_32 at version 1.2.0 */
|
/* Changed from png_byte to png_uint_32 at version 1.2.0 */
|
||||||
png_uint_32 mng_features_permitted;
|
png_uint_32 mng_features_permitted;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
|
||||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||||
*
|
*
|
||||||
* Last changed in libpng 1.5.4 [July 7, 2011]
|
* Last changed in libpng 1.5.11 [June 14, 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.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
* (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 */
|
#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) || \
|
#if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) || \
|
||||||
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
|
defined(PNG_WRITE_USER_TRANSFORM_SUPPORTED)
|
||||||
#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
|
#ifdef PNG_USER_TRANSFORM_PTR_SUPPORTED
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
## Process this file with automake to produce Makefile.in
|
|
||||||
|
|
||||||
SUBDIRS = vorbis
|
|
|
@ -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:
|
|
|
@ -1,7 +0,0 @@
|
||||||
## Process this file with automake to produce Makefile.in
|
|
||||||
|
|
||||||
vorbisincludedir = $(includedir)/vorbis
|
|
||||||
|
|
||||||
vorbisinclude_HEADERS = codec.h vorbisfile.h vorbisenc.h
|
|
||||||
|
|
||||||
|
|
|
@ -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:
|
|
|
@ -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";
|
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue