Commit 152142c7100243df79c12811453d8c2af5fa7cd5

Authored by DarkGod
1 parent 1027f425

plop

... ... @@ -95,6 +95,11 @@ void DisplayObject::scale(float x, float y, float z, bool increment) {
95 95 recomputeModelMatrix();
96 96 }
97 97
  98 +void DOVertexes::clear() {
  99 + vertices.clear();
  100 + setChanged();
  101 +}
  102 +
98 103 int DOVertexes::addQuad(
99 104 float x1, float y1, float u1, float v1,
100 105 float x2, float y2, float u2, float v2,
... ...
... ... @@ -93,6 +93,8 @@ public:
93 93 if (tex_lua_ref != LUA_NOREF && L) luaL_unref(L, LUA_REGISTRYINDEX, tex_lua_ref);
94 94 };
95 95
  96 + void clear();
  97 +
96 98 int addQuad(
97 99 float x1, float y1, float u1, float v1,
98 100 float x2, float y2, float u2, float v2,
... ...
... ... @@ -96,6 +96,7 @@ void DOText::parseText() {
96 96 bool no_linefeed = lua_toboolean(L, 11);
97 97
98 98 setTexture(f->atlas_tex, LUA_NOREF);
  99 + clear();
99 100
100 101 // Update VO size once, we are allocating a few more than neede in case of utf8 or control sequences, but we dont care
101 102 vertices.reserve(len * 4);
... ...
... ... @@ -162,6 +162,12 @@ void DORContainer::render(DORContainer *container, mat4 cur_model) {
162 162 resetChanged();
163 163 }
164 164
  165 +static bool zSorter(vertex i, vertex j) {
  166 + return i.pos[z] < j.pos[z];
  167 +
  168 + // ah but this wont work, we need to sort BEFORE display lists are made.. some kind of super big raw display list .. uh ..
  169 +}
  170 +
165 171 void RendererGL::update() {
166 172 // Release currently owned display lists
167 173 for (auto dl = displays.begin() ; dl != displays.end(); ++dl) { releaseDisplayList(*dl); }
... ...
... ... @@ -105,12 +105,15 @@ private:
105 105 GLuint *vbo_elements_data = NULL;
106 106 GLuint vbo_elements = 0;
107 107 int vbo_elements_nb = 0;
  108 + bool zsort = false;
  109 + vector<vertex> zvertices;
108 110
109 111 public:
110 112 RendererGL();
111 113 RendererGL(int w, int h);
112 114 virtual ~RendererGL();
113 115
  116 + virtual void zSorting(bool sort) { zsort = sort; };
114 117 virtual void update();
115 118 virtual void toScreen(float x, float y, float r, float g, float b, float a);
116 119 };
... ...