summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2008-04-10 02:04:03 +0200
committerneoraider <devnull@localhost>2008-04-10 02:04:03 +0200
commit3c72a44fa4592e0105af6bb9a440b0da06d0bde4 (patch)
treec84db1ff4714ccfdc579e758cbb50001a1750a21 /src
parentdbe6bf35635c70abdcc3656b3fcb4408fc920c74 (diff)
downloadzoomedit-3c72a44fa4592e0105af6bb9a440b0da06d0bde4.tar
zoomedit-3c72a44fa4592e0105af6bb9a440b0da06d0bde4.zip
zoomedit:
* Added more data classes * Work on integration with libxml++
Diffstat (limited to 'src')
-rw-r--r--src/Data/Level.cpp28
-rw-r--r--src/Data/Level.h40
-rw-r--r--src/Data/Makefile.am5
-rw-r--r--src/Data/Makefile.in54
-rw-r--r--src/Data/Room.cpp28
-rw-r--r--src/Data/Room.h40
-rw-r--r--src/Data/TexCoords.h37
-rw-r--r--src/Data/Triangle.h57
-rw-r--r--src/Gui/Makefile.in4
-rw-r--r--src/Instance.cpp9
-rw-r--r--src/Instance.h8
-rw-r--r--src/Makefile.am4
-rw-r--r--src/Makefile.in11
13 files changed, 309 insertions, 16 deletions
diff --git a/src/Data/Level.cpp b/src/Data/Level.cpp
new file mode 100644
index 0000000..4da62ea
--- /dev/null
+++ b/src/Data/Level.cpp
@@ -0,0 +1,28 @@
+/*
+ * Level.cpp
+ *
+ * Copyright (C) 2008 Matthias Schiffer <matthias@gamezock.de>
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Level.h"
+
+namespace ZoomEdit {
+namespace Data {
+
+
+
+}
+}
diff --git a/src/Data/Level.h b/src/Data/Level.h
new file mode 100644
index 0000000..4a9481a
--- /dev/null
+++ b/src/Data/Level.h
@@ -0,0 +1,40 @@
+/*
+ * Level.h
+ *
+ * Copyright (C) 2008 Matthias Schiffer <matthias@gamezock.de>
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ZOOMEDIT_DATA_LEVEL_H_
+#define ZOOMEDIT_DATA_LEVEL_H_
+
+#include "Room.h"
+#include <list>
+
+namespace ZoomEdit {
+namespace Data {
+
+class Level {
+ private:
+ std::list<Room> rooms;
+
+ public:
+ Level() {}
+};
+
+}
+}
+
+#endif /*ZOOMEDIT_DATA_LEVEL_H_*/
diff --git a/src/Data/Makefile.am b/src/Data/Makefile.am
index 51afca5..f4712df 100644
--- a/src/Data/Makefile.am
+++ b/src/Data/Makefile.am
@@ -1,3 +1,4 @@
-noinst_LTLIBRARIES = libdata.la
+noinst_LTLIBRARIES = libdata.la
-libdata_la_SOURCES = Triangle.cpp Vector.cpp Vertex.cpp \ No newline at end of file
+libdata_la_SOURCES = Level.cpp Room.cpp Triangle.cpp Vector.cpp Vertex.cpp
+libdata_la_CPPFLAGS = $(libxml_CFLAGS) \ No newline at end of file
diff --git a/src/Data/Makefile.in b/src/Data/Makefile.in
index bcc5af8..19de33c 100644
--- a/src/Data/Makefile.in
+++ b/src/Data/Makefile.in
@@ -43,7 +43,9 @@ CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES =
LTLIBRARIES = $(noinst_LTLIBRARIES)
libdata_la_LIBADD =
-am_libdata_la_OBJECTS = Triangle.lo Vector.lo Vertex.lo
+am_libdata_la_OBJECTS = libdata_la-Level.lo libdata_la-Room.lo \
+ libdata_la-Triangle.lo libdata_la-Vector.lo \
+ libdata_la-Vertex.lo
libdata_la_OBJECTS = $(am_libdata_la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -81,6 +83,7 @@ CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -106,6 +109,7 @@ LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -158,6 +162,8 @@ infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+libxml_CFLAGS = @libxml_CFLAGS@
+libxml_LIBS = @libxml_LIBS@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
@@ -175,7 +181,8 @@ target_alias = @target_alias@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LTLIBRARIES = libdata.la
-libdata_la_SOURCES = Triangle.cpp Vector.cpp Vertex.cpp
+libdata_la_SOURCES = Level.cpp Room.cpp Triangle.cpp Vector.cpp Vertex.cpp
+libdata_la_CPPFLAGS = $(libxml_CFLAGS)
all: all-am
.SUFFIXES:
@@ -227,9 +234,11 @@ mostlyclean-compile:
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Triangle.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Vector.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Vertex.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdata_la-Level.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdata_la-Room.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdata_la-Triangle.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdata_la-Vector.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdata_la-Vertex.Plo@am__quote@
.cpp.o:
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -252,6 +261,41 @@ distclean-compile:
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+libdata_la-Level.lo: Level.cpp
+@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdata_la-Level.lo -MD -MP -MF $(DEPDIR)/libdata_la-Level.Tpo -c -o libdata_la-Level.lo `test -f 'Level.cpp' || echo '$(srcdir)/'`Level.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libdata_la-Level.Tpo $(DEPDIR)/libdata_la-Level.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Level.cpp' object='libdata_la-Level.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdata_la-Level.lo `test -f 'Level.cpp' || echo '$(srcdir)/'`Level.cpp
+
+libdata_la-Room.lo: Room.cpp
+@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdata_la-Room.lo -MD -MP -MF $(DEPDIR)/libdata_la-Room.Tpo -c -o libdata_la-Room.lo `test -f 'Room.cpp' || echo '$(srcdir)/'`Room.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libdata_la-Room.Tpo $(DEPDIR)/libdata_la-Room.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Room.cpp' object='libdata_la-Room.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdata_la-Room.lo `test -f 'Room.cpp' || echo '$(srcdir)/'`Room.cpp
+
+libdata_la-Triangle.lo: Triangle.cpp
+@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdata_la-Triangle.lo -MD -MP -MF $(DEPDIR)/libdata_la-Triangle.Tpo -c -o libdata_la-Triangle.lo `test -f 'Triangle.cpp' || echo '$(srcdir)/'`Triangle.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libdata_la-Triangle.Tpo $(DEPDIR)/libdata_la-Triangle.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Triangle.cpp' object='libdata_la-Triangle.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdata_la-Triangle.lo `test -f 'Triangle.cpp' || echo '$(srcdir)/'`Triangle.cpp
+
+libdata_la-Vector.lo: Vector.cpp
+@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdata_la-Vector.lo -MD -MP -MF $(DEPDIR)/libdata_la-Vector.Tpo -c -o libdata_la-Vector.lo `test -f 'Vector.cpp' || echo '$(srcdir)/'`Vector.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libdata_la-Vector.Tpo $(DEPDIR)/libdata_la-Vector.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Vector.cpp' object='libdata_la-Vector.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdata_la-Vector.lo `test -f 'Vector.cpp' || echo '$(srcdir)/'`Vector.cpp
+
+libdata_la-Vertex.lo: Vertex.cpp
+@am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libdata_la-Vertex.lo -MD -MP -MF $(DEPDIR)/libdata_la-Vertex.Tpo -c -o libdata_la-Vertex.lo `test -f 'Vertex.cpp' || echo '$(srcdir)/'`Vertex.cpp
+@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/libdata_la-Vertex.Tpo $(DEPDIR)/libdata_la-Vertex.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='Vertex.cpp' object='libdata_la-Vertex.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libdata_la-Vertex.lo `test -f 'Vertex.cpp' || echo '$(srcdir)/'`Vertex.cpp
+
mostlyclean-libtool:
-rm -f *.lo
diff --git a/src/Data/Room.cpp b/src/Data/Room.cpp
new file mode 100644
index 0000000..58a7c31
--- /dev/null
+++ b/src/Data/Room.cpp
@@ -0,0 +1,28 @@
+/*
+ * Room.cpp
+ *
+ * Copyright (C) 2008 Matthias Schiffer <matthias@gamezock.de>
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "Room.h"
+
+namespace ZoomEdit {
+namespace Data {
+
+
+
+}
+}
diff --git a/src/Data/Room.h b/src/Data/Room.h
new file mode 100644
index 0000000..3d7ddbd
--- /dev/null
+++ b/src/Data/Room.h
@@ -0,0 +1,40 @@
+/*
+ * Room.h
+ *
+ * Copyright (C) 2008 Matthias Schiffer <matthias@gamezock.de>
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ZOOMEDIT_DATA_ROOM_H_
+#define ZOOMEDIT_DATA_ROOM_H_
+
+#include "Triangle.h"
+#include <list>
+
+namespace ZoomEdit {
+namespace Data {
+
+class Room {
+ private:
+ std::list<Triangle> triangles;
+
+ public:
+ Room() {}
+};
+
+}
+}
+
+#endif /*ZOOMEDIT_DATA_ROOM_H_*/
diff --git a/src/Data/TexCoords.h b/src/Data/TexCoords.h
new file mode 100644
index 0000000..caf98a1
--- /dev/null
+++ b/src/Data/TexCoords.h
@@ -0,0 +1,37 @@
+/*
+ * TexCoords.h
+ *
+ * Copyright (C) 2008 Matthias Schiffer <matthias@gamezock.de>
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef ZOOMEDIT_DATA_TEXCOORDS_H_
+#define ZOOMEDIT_DATA_TEXCOORDS_H_
+
+namespace ZoomEdit {
+namespace Data {
+
+class TexCoords {
+ private:
+ float s, t, r, q;
+
+ public:
+ TexCoords(float s0 = 0, float t0 = 0, float r0 = 0, float q0 = 0) : s(s0), t(t0), r(r0), q(q0) {}
+};
+
+}
+}
+
+#endif /*ZOOMEDIT_DATA_TEXCOORDS_H_*/
diff --git a/src/Data/Triangle.h b/src/Data/Triangle.h
index 03e0fa4..e3e6130 100644
--- a/src/Data/Triangle.h
+++ b/src/Data/Triangle.h
@@ -21,17 +21,68 @@
#define ZOOMEDIT_DATA_TRIANGLE_H_
#include "Vertex.h"
+#include "TexCoords.h"
namespace ZoomEdit {
namespace Data {
class Triangle {
private:
- Vertex a, b, c;
- Vector na, nb, nc;
+ Vertex vertices[3];
+ Vector normals[3];
+ TexCoords texCoords[3];
+ bool visible;
public:
- Triangle(Vertex a0, Vertex b0, Vertex c0) : a(a0), b(b0), c(c0) {}
+ Triangle(bool vis = true) : visible(vis) {}
+
+ Triangle(Vertex v0, Vertex v1, Vertex v2, bool vis = true) : visible(vis) {
+ vertices[0] = v0; vertices[1] = v1; vertices[2] = v2;
+ }
+
+ Triangle(Vertex v[3], bool vis = true) : visible(vis) {
+ vertices[0] = v[0]; vertices[1] = v[1]; vertices[2] = v[2];
+ }
+
+ Triangle(Vertex v[3], Vector n[3], bool vis = true) : visible(vis) {
+ vertices[0] = v[0]; vertices[1] = v[1]; vertices[2] = v[2];
+ normals[0] = n[0]; normals[1] = n[1]; normals[2] = n[2];
+ }
+
+ Triangle(Vertex v[3], TexCoords t[3], bool vis = true) : visible(vis) {
+ vertices[0] = v[0]; vertices[1] = v[1]; vertices[2] = v[2];
+ texCoords[0] = t[0]; texCoords[1] = t[1]; texCoords[2] = t[2];
+ }
+
+ Triangle(Vertex v[3], Vector n[3], TexCoords t[3], bool vis = true) : visible(vis) {
+ vertices[0] = v[0]; vertices[1] = v[1]; vertices[2] = v[2];
+ normals[0] = n[0]; normals[1] = n[1]; normals[2] = n[2];
+ texCoords[0] = t[0]; texCoords[1] = t[1]; texCoords[2] = t[2];
+ }
+
+ Vertex& getVertex(unsigned int i) {return vertices[i%3];}
+ const Vertex& getVertex(unsigned int i) const {return vertices[i%3];}
+ void setVertex(unsigned int i, Vertex v) {vertices[i%3] = v;}
+ void setVertices(Vertex v[3]) {
+ vertices[0] = v[0]; vertices[1] = v[1]; vertices[2] = v[2];
+ }
+
+ Vector& getNormal(unsigned int i) {return normals[i%3];}
+ const Vector& getNormal(unsigned int i) const {return normals[i%3];}
+ void setNormal(unsigned int i, Vector n) {normals[i%3] = n;}
+ void setNormals(Vector n[3]) {
+ normals[0] = n[0]; normals[1] = n[1]; normals[2] = n[2];
+ }
+
+ TexCoords& getTexCoords(unsigned int i) {return texCoords[i%3];}
+ const TexCoords& getTexCoords(unsigned int i) const {return texCoords[i%3];}
+ void getTexCoords(unsigned int i, TexCoords t) {texCoords[i%3] = t;}
+ void getTexCoords(TexCoords t[3]) {
+ texCoords[0] = t[0]; texCoords[1] = t[1]; texCoords[2] = t[2];
+ }
+
+ bool isVisible() {return visible;}
+ void setVisible(bool vis) {visible = vis;}
};
}
diff --git a/src/Gui/Makefile.in b/src/Gui/Makefile.in
index 267ad62..461bad8 100644
--- a/src/Gui/Makefile.in
+++ b/src/Gui/Makefile.in
@@ -81,6 +81,7 @@ CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -106,6 +107,7 @@ LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -158,6 +160,8 @@ infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+libxml_CFLAGS = @libxml_CFLAGS@
+libxml_LIBS = @libxml_LIBS@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
diff --git a/src/Instance.cpp b/src/Instance.cpp
index 9758dbb..ead9cac 100644
--- a/src/Instance.cpp
+++ b/src/Instance.cpp
@@ -20,12 +20,13 @@
#include <iostream>
#include "Instance.h"
#include "Gui/Window.h"
+#include "Data/Level.h"
namespace ZoomEdit {
guint Instance::instances = 0;
-Instance::Instance() : window(NULL) {
+Instance::Instance() : window(NULL), levelXml(NULL), level(NULL) {
instances++;
#ifdef GLIBMM_EXCEPTIONS_ENABLED
@@ -63,6 +64,12 @@ Instance::~Instance() {
if(window)
delete window;
+ if(levelXml)
+ delete levelXml;
+
+ if(level)
+ delete level;
+
instances--;
if(!instances)
Gtk::Main::quit();
diff --git a/src/Instance.h b/src/Instance.h
index ced1fdc..e8a0007 100644
--- a/src/Instance.h
+++ b/src/Instance.h
@@ -22,6 +22,7 @@
#include <gtkmm/main.h>
#include <libglademm/xml.h>
+#include <libxml++/document.h>
namespace ZoomEdit {
@@ -29,6 +30,10 @@ namespace Gui {
class Window;
}
+namespace Data {
+class Level;
+}
+
class Instance {
public:
virtual ~Instance();
@@ -41,6 +46,9 @@ class Instance {
Glib::RefPtr<Gnome::Glade::Xml> xml;
Gui::Window *window;
+ xmlpp::Document *levelXml;
+ Data::Level *level;
+
Instance();
void destroy();
diff --git a/src/Makefile.am b/src/Makefile.am
index 91ccb33..04b4a08 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,5 +2,5 @@ SUBDIRS = Data Gui
bin_PROGRAMS = zoomedit
zoomedit_SOURCES = zoomedit.cpp Instance.cpp
-zoomedit_CPPFLAGS = $(glademm_CFLAGS) $(GTKGLEXT_CFLAGS)
-zoomedit_LDADD = Data/libdata.la Gui/libgui.la $(glademm_LIBS) $(GTKGLEXT_LIBS)
+zoomedit_CPPFLAGS = $(glademm_CFLAGS) $(GTKGLEXT_CFLAGS) $(libxml_CFLAGS)
+zoomedit_LDADD = Data/libdata.la Gui/libgui.la $(glademm_LIBS) $(GTKGLEXT_LIBS) $(libxml_LIBS)
diff --git a/src/Makefile.in b/src/Makefile.in
index 4b4ab2e..d19ad3e 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -51,7 +51,8 @@ am_zoomedit_OBJECTS = zoomedit-zoomedit.$(OBJEXT) \
zoomedit_OBJECTS = $(am_zoomedit_OBJECTS)
am__DEPENDENCIES_1 =
zoomedit_DEPENDENCIES = Data/libdata.la Gui/libgui.la \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -98,6 +99,7 @@ CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DSYMUTIL = @DSYMUTIL@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
@@ -123,6 +125,7 @@ LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -175,6 +178,8 @@ infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+libxml_CFLAGS = @libxml_CFLAGS@
+libxml_LIBS = @libxml_LIBS@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
@@ -193,8 +198,8 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = Data Gui
zoomedit_SOURCES = zoomedit.cpp Instance.cpp
-zoomedit_CPPFLAGS = $(glademm_CFLAGS) $(GTKGLEXT_CFLAGS)
-zoomedit_LDADD = Data/libdata.la Gui/libgui.la $(glademm_LIBS) $(GTKGLEXT_LIBS)
+zoomedit_CPPFLAGS = $(glademm_CFLAGS) $(GTKGLEXT_CFLAGS) $(libxml_CFLAGS)
+zoomedit_LDADD = Data/libdata.la Gui/libgui.la $(glademm_LIBS) $(GTKGLEXT_LIBS) $(libxml_LIBS)
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive