1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2024-11-29 03:33:48 +00:00

Remove some unnecessary includes of glpng

This commit is contained in:
fgenesis 2017-02-15 00:56:00 +01:00
parent 33b9eebd3f
commit b7e3e55cf1
5 changed files with 260 additions and 253 deletions

View file

@ -19,7 +19,6 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "../BBGE/DebugFont.h"
#include <GL/glpng.h>
#include "../BBGE/AfterEffect.h"
#include "DSQ.h"

View file

@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define GAME_H
#include "../BBGE/DebugFont.h"
#include <GL/glpng.h>
#include "DSQ.h"
#include "AquariaMenuItem.h"
@ -30,6 +29,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "TileVector.h"
#include "AquariaProgressBar.h"
#ifdef AQUARIA_DEMO
#undef AQUARIA_BUILD_SCENEEDITOR
#endif
#ifdef AQUARIA_BUILD_SCENEEDITOR
#include "SceneEditor.h"
#endif
#include <tinyxml2.h>
using namespace tinyxml2;
@ -56,9 +63,6 @@ const char CHAR_RIGHT = 'r';
const float MIN_SIZE = 0.1f;
#ifdef AQUARIA_DEMO
#undef AQUARIA_BUILD_SCENEEDITOR
#endif
class GridRender;
@ -71,32 +75,6 @@ class Beam;
#include "Path.h"
#ifdef AQUARIA_BUILD_SCENEEDITOR
struct EntityGroupEntity
{
std::string name;
std::string gfx;
};
typedef std::vector<EntityGroupEntity> EntityGroupEntities;
struct EntityGroup
{
std::string name;
EntityGroupEntities entities;
};
typedef std::vector<EntityGroup> EntityGroups;
enum EditTypes
{
ET_ELEMENTS =0,
ET_ENTITIES =1,
ET_PATHS =2,
ET_SELECTENTITY =4,
ET_MAX
};
#endif
// impl is in Minimap.cpp
struct MinimapIcon
@ -142,18 +120,6 @@ enum FlagCheckType
OR =1
};
#ifdef AQUARIA_BUILD_SCENEEDITOR
enum EditorStates
{
ES_SELECTING =0,
ES_SCALING =1,
ES_ROTATING =2,
ES_MOVING =3,
ES_MAX
};
#endif
class EntityClass
{
public:
@ -166,204 +132,6 @@ public:
int idx;
};
#ifdef AQUARIA_BUILD_SCENEEDITOR
class SceneEditorMenuReceiver : public DebugButtonReceiver
{
public:
void buttonPress(DebugButton *db);
};
struct SelectedEntity
{
SelectedEntity();
void clear();
void setIndex(int idx);
void setName(const std::string &name, const std::string &prevGfx);
void setSelectEntity(const SelectedEntity &ent);
bool nameBased;
int index, typeListIndex;
std::string name;
std::string prevGfx;
float prevScale;
};
class SceneEditor : public ActionMapper
{
public:
SceneEditor();
void init();
void shutdown();
void toggle();
void toggle(bool on);
void update(float dt);
void prevElement();
void nextElement();
void doPrevElement();
Element *cycleElementNext(Element *e);
Element *cycleElementPrev(Element *e);
void selectZero();
void selectEnd();
void placeElement();
void flipElementHorz();
void flipElementVert();
void deleteSelectedElement();
void deleteElement(int selectedIdx);
virtual void action(int id, int state, int source, InputDevice device);
void scaleElementUp();
void scaleElementDown();
void scaleElement1();
void placeAvatar();
void executeButtonID(int bid);
void openMainMenu();
void closeMainMenu();
void setBackgroundGradient();
bool isOn();
void generateLevel();
void skinLevel(pngRawInfo *png, int minX, int minY, int maxX, int maxY);
void skinLevel();
void regenLevel();
void updateSaveFileEnemyPosition(Entity *ent);
void startMoveEntity();
void endMoveEntity();
void down();
void up();
void exitMoveState();
void alignHorz();
void alignVert();
EditTypes editType;
EditorStates state;
Element *getElementAtCursor();
Entity *getEntityAtCursor();
void mouseButtonLeftUp();
void mouseButtonRightUp();
void moveToBack();
void moveToFront();
int bgLayer;
Element *editingElement;
Entity *editingEntity;
Path *editingPath;
size_t selectedIdx;
size_t selectedNode;
Path *getSelectedPath();
void changeDepth();
void updateEntitySaveData(Entity *editingEntity);
void moveLayer();
void moveElementToLayer(Element *e, int bgLayer);
void toggleElementRepeat();
bool multiSelecting;
Vector multiSelectPoint;
std::vector <Element*> selectedElements;
Vector groupCenter;
Vector getSelectedElementsCenter();
Quad dummy;
void updateSelectedElementPosition(Vector position);
int selectedEntityType;
SelectedEntity selectedEntity;
size_t entityPageNum;
void checkForRebuild();
void createAquarian();
void dumpObs();
DebugButton *btnMenu;
protected:
void reversePath();
void updateEntityPlacer();
void updateMultiSelect();
float autoSaveTimer;
int autoSaveFile;
void enterName();
void changeShape();
int skinMinX, skinMinY, skinMaxX, skinMaxY;
void setGridPattern(int gi);
void setGridPattern0();
void setGridPattern1();
void setGridPattern2();
void setGridPattern3();
void setGridPattern4();
void setGridPattern5();
void setGridPattern6();
void setGridPattern7();
void setGridPattern8();
void setGridPattern9();
void toggleElementSolid();
void toggleElementHurt();
void editModeElements();
void editModeEntities();
void editModePaths();
void deleteSelected();
void cloneSelectedElement();
void enterScaleState();
void enterRotateState();
void enterMoveState();
Vector oldPosition, oldRotation, oldScale, cursorOffset, oldRepeatScale;
Entity *movingEntity;
void nextEntityType();
void prevEntityType();
void removeEntity();
void selectEntityFromGroups();
Vector zoom;
void rotateElement();
void rotateElement2();
void updateText();
void saveScene();
void loadScene();
SceneEditorMenuReceiver menuReceiver;
void addMainMenuItem(const std::string &label, int bid);
void loadSceneByName();
void reloadScene();
void mouseButtonLeft();
void mouseButtonRight();
size_t curElement, selectedVariation, possibleSelectedIdx;
Quad *placer;
DebugFont *text;
bool on;
InterpolatedVector oldGlobalScale;
};
#endif // AQUARIA_BUILD_SCENEEDITOR
typedef std::vector<Quad*> QuadList;
typedef std::vector<QuadList> QuadArray;

View file

@ -18,6 +18,8 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "SceneEditor.h"
#include "../BBGE/MathFunctions.h"
#include <GL/glpng.h>
#include "../BBGE/Gradient.h"
@ -1525,18 +1527,11 @@ void SceneEditor::skinLevel()
dsq->screenMessage("Cannot skin without generated level.");
return;
}
pngRawInfo rawinfo;
std::string file = getMapTemplateFilename();
bool success = pngLoadRaw(file.c_str(), &rawinfo);
if (success)
{
skinLevel(&rawinfo, skinMinX, skinMinY, skinMaxX, skinMaxY);
if (rawinfo.Data != NULL)
free(rawinfo.Data);
}
skinLevel(skinMinX, skinMinY, skinMaxX, skinMaxY);
}
void SceneEditor::skinLevel(pngRawInfo *png, int minX, int minY, int maxX, int maxY)
void SceneEditor::skinLevel(int minX, int minY, int maxX, int maxY)
{
std::vector<Element*> deleteElements;
size_t i = 0;

246
Aquaria/SceneEditor.h Normal file
View file

@ -0,0 +1,246 @@
#ifndef AQUARIA_SCENEEDITOR_H
#define AQUARIA_SCENEEDITOR_H
#include "Base.h"
#include "AquariaCompileConfig.h"
#include "DebugFont.h"
#include "ActionMapper.h"
#include "Quad.h"
#ifdef AQUARIA_BUILD_SCENEEDITOR
class Element;
class Entity;
class Path;
struct EntityGroupEntity
{
std::string name;
std::string gfx;
};
typedef std::vector<EntityGroupEntity> EntityGroupEntities;
struct EntityGroup
{
std::string name;
EntityGroupEntities entities;
};
typedef std::vector<EntityGroup> EntityGroups;
enum EditTypes
{
ET_ELEMENTS =0,
ET_ENTITIES =1,
ET_PATHS =2,
ET_SELECTENTITY =4,
ET_MAX
};
enum EditorStates
{
ES_SELECTING =0,
ES_SCALING =1,
ES_ROTATING =2,
ES_MOVING =3,
ES_MAX
};
class SceneEditorMenuReceiver : public DebugButtonReceiver
{
public:
void buttonPress(DebugButton *db);
};
struct SelectedEntity
{
SelectedEntity();
void clear();
void setIndex(int idx);
void setName(const std::string &name, const std::string &prevGfx);
void setSelectEntity(const SelectedEntity &ent);
bool nameBased;
int index, typeListIndex;
std::string name;
std::string prevGfx;
float prevScale;
};
class SceneEditor : public ActionMapper
{
public:
SceneEditor();
void init();
void shutdown();
void toggle();
void toggle(bool on);
void update(float dt);
void prevElement();
void nextElement();
void doPrevElement();
Element *cycleElementNext(Element *e);
Element *cycleElementPrev(Element *e);
void selectZero();
void selectEnd();
void placeElement();
void flipElementHorz();
void flipElementVert();
void deleteSelectedElement();
void deleteElement(int selectedIdx);
virtual void action(int id, int state, int source, InputDevice device);
void scaleElementUp();
void scaleElementDown();
void scaleElement1();
void placeAvatar();
void executeButtonID(int bid);
void openMainMenu();
void closeMainMenu();
void setBackgroundGradient();
bool isOn();
void generateLevel();
void skinLevel(int minX, int minY, int maxX, int maxY);
void skinLevel();
void regenLevel();
void updateSaveFileEnemyPosition(Entity *ent);
void startMoveEntity();
void endMoveEntity();
void down();
void up();
void exitMoveState();
void alignHorz();
void alignVert();
EditTypes editType;
EditorStates state;
Element *getElementAtCursor();
Entity *getEntityAtCursor();
void mouseButtonLeftUp();
void mouseButtonRightUp();
void moveToBack();
void moveToFront();
int bgLayer;
Element *editingElement;
Entity *editingEntity;
Path *editingPath;
size_t selectedIdx;
size_t selectedNode;
Path *getSelectedPath();
void changeDepth();
void updateEntitySaveData(Entity *editingEntity);
void moveLayer();
void moveElementToLayer(Element *e, int bgLayer);
void toggleElementRepeat();
bool multiSelecting;
Vector multiSelectPoint;
std::vector <Element*> selectedElements;
Vector groupCenter;
Vector getSelectedElementsCenter();
Quad dummy;
void updateSelectedElementPosition(Vector position);
int selectedEntityType;
SelectedEntity selectedEntity;
size_t entityPageNum;
void checkForRebuild();
void createAquarian();
void dumpObs();
DebugButton *btnMenu;
protected:
void reversePath();
void updateEntityPlacer();
void updateMultiSelect();
float autoSaveTimer;
int autoSaveFile;
void enterName();
void changeShape();
int skinMinX, skinMinY, skinMaxX, skinMaxY;
void setGridPattern(int gi);
void setGridPattern0();
void setGridPattern1();
void setGridPattern2();
void setGridPattern3();
void setGridPattern4();
void setGridPattern5();
void setGridPattern6();
void setGridPattern7();
void setGridPattern8();
void setGridPattern9();
void toggleElementSolid();
void toggleElementHurt();
void editModeElements();
void editModeEntities();
void editModePaths();
void deleteSelected();
void cloneSelectedElement();
void enterScaleState();
void enterRotateState();
void enterMoveState();
Vector oldPosition, oldRotation, oldScale, cursorOffset, oldRepeatScale;
Entity *movingEntity;
void nextEntityType();
void prevEntityType();
void removeEntity();
void selectEntityFromGroups();
Vector zoom;
void rotateElement();
void rotateElement2();
void updateText();
void saveScene();
void loadScene();
SceneEditorMenuReceiver menuReceiver;
void addMainMenuItem(const std::string &label, int bid);
void loadSceneByName();
void reloadScene();
void mouseButtonLeft();
void mouseButtonRight();
size_t curElement, selectedVariation, possibleSelectedIdx;
Quad *placer;
DebugFont *text;
bool on;
InterpolatedVector oldGlobalScale;
};
#endif // AQUARIA_BUILD_SCENEEDITOR
#endif // AQUARIA_SCENEEDITOR_H

View file

@ -30,8 +30,7 @@
//#define GL_GLEXT_PROTOTYPES
//#include <GL/glpng.h>
#include "GL/glpng.h"
#include <GL/glpng.h>
#include <GL/gl.h>
#include <GL/glext.h>
#include <stdlib.h>