Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-11-08 12:55:48 +0000
committerStijn Buys <ingar@osirion.org>2008-11-08 12:55:48 +0000
commitf961a2fb478a44958d4cf727ebabff99252133b0 (patch)
tree18224c3344fe047ee0d5b8e4dbafe220105635a6 /src/model
parent2182933986afd7e17cf9072d8f2e3333fa110cd4 (diff)
parse model geometry without vertexbuffer
Diffstat (limited to 'src/model')
-rw-r--r--src/model/map.cc100
1 files changed, 48 insertions, 52 deletions
diff --git a/src/model/map.cc b/src/model/map.cc
index 960a1f0..584240f 100644
--- a/src/model/map.cc
+++ b/src/model/map.cc
@@ -142,21 +142,21 @@ bool Map::getline()
} else if (firstword == "}") {
if ((parse_level == 2) && (planes.size())) {
- // end-of-brush
- if (VertexArray::instance()) {
- // for every face
- for (std::vector<Plane *>::iterator face = planes.begin(); face != planes.end(); face++) {
- make_brushface((*face));
- }
-
- // clean planes
- for (std::vector<Plane *>::iterator it = planes.begin(); it != planes.end(); it++) {
- delete(*it);
- }
- planes.clear();
-
- map_brushes++;
+ // end-of-brush
+
+ // for every face
+ for (std::vector<Plane *>::iterator face = planes.begin(); face != planes.end(); face++) {
+ make_brushface((*face));
}
+
+ // clean planes
+ for (std::vector<Plane *>::iterator it = planes.begin(); it != planes.end(); it++) {
+ delete(*it);
+ }
+ planes.clear();
+
+ map_brushes++;
+
value_current.clear();
} else if ((parse_level == 1)) {
@@ -200,42 +200,42 @@ bool Map::getline()
if (firstword == "(") {
// brush plane
- if (VertexArray::instance()) {
- Vector3f p1, p2, p3;
- std::string tmp;
- std::string texture;
- int n = 0;
+
+ Vector3f p1, p2, p3;
+ std::string tmp;
+ std::string texture;
+ int n = 0;
+
+ linestream >> p1;
+ linestream >> tmp; // )
+ linestream >> tmp; // (
+ linestream >> p2;
+ linestream >> tmp; // )
+ linestream >> tmp; // (
+ linestream >> p3;
+ linestream >> tmp; // )
+ linestream >> texture;
+
+ // 5 numbers (texture alignment?)
+ for (int i=0; i < 5; i++)
+ linestream >> tmp;
- linestream >> p1;
- linestream >> tmp; // )
- linestream >> tmp; // (
- linestream >> p2;
- linestream >> tmp; // )
- linestream >> tmp; // (
- linestream >> p3;
- linestream >> tmp; // )
- linestream >> texture;
+ // content flags ?
+ if (!(linestream >> n))
+ n = 0;
- // 5 numbers (texture alignment?)
- for (int i=0; i < 5; i++)
- linestream >> tmp;
-
- // content flags ?
- if (!(linestream >> n))
- n = 0;
-
- Plane *plane = new Plane(p1, p2, p3);
- plane->texture() = texture;
- if (n > 0)
- plane->detail() = true;
-
- // surface flags
- if (!(linestream >> n))
- n = 0;
- plane->surface_flags() = n;
+ Plane *plane = new Plane(p1, p2, p3);
+ plane->texture() = texture;
+ if (n > 0)
+ plane->detail() = true;
- planes.push_back(plane);
- }
+ // surface flags
+ if (!(linestream >> n))
+ n = 0;
+ plane->surface_flags() = n;
+
+ planes.push_back(plane);
+
value_current.clear();
}
}
@@ -678,11 +678,7 @@ void Map::close()
}
void Map::load_worldspawn(Model *model)
-{
- // set default values
- if (!VertexArray::instance() || VertexArray::instance()->overflow())
- return;
-
+{
if (!map_materials.size())
return;