Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-07-16 18:34:54 +0000
committerStijn Buys <ingar@osirion.org>2009-07-16 18:34:54 +0000
commit70b4d79d501be4802a06770f02b8f49e2c14e8a7 (patch)
treeb868e13489f8ef4377c7ac6c7d900ee854270b03
parent1b8ceba3a173ff59939042713cd07a65e83193f1 (diff)
Removes unused collor array support, disable bullet in sys/sys.h
-rw-r--r--src/core/module.h2
-rw-r--r--src/game/base/game.cc30
-rw-r--r--src/game/base/game.h2
-rw-r--r--src/game/base/physics.cc2
-rw-r--r--src/game/base/ship.cc16
-rw-r--r--src/model/fragment.cc4
-rw-r--r--src/model/fragment.h3
-rw-r--r--src/model/map.cc49
-rw-r--r--src/model/primitives.cc8
-rw-r--r--src/model/primitives.h8
-rw-r--r--src/model/quad.cc5
-rw-r--r--src/model/quad.h9
-rw-r--r--src/model/triangle.cc5
-rw-r--r--src/model/triangle.h9
-rw-r--r--src/model/vertexarray.cc23
-rw-r--r--src/model/vertexarray.h13
-rw-r--r--src/render/draw.cc4
-rw-r--r--src/sys/sys.h5
18 files changed, 89 insertions, 108 deletions
diff --git a/src/core/module.h b/src/core/module.h
index 240488f..76b1ba4 100644
--- a/src/core/module.h
+++ b/src/core/module.h
@@ -38,7 +38,7 @@ public:
/*----- mutators -------------------------------------------------- */
- /// run one timeframe
+ /// run one game frame
virtual void frame(float seconds) = 0;
/// is called when a player connects
diff --git a/src/game/base/game.cc b/src/game/base/game.cc
index 441e080..ed1b80e 100644
--- a/src/game/base/game.cc
+++ b/src/game/base/game.cc
@@ -237,10 +237,11 @@ void Game::func_launch(core::Player *player, std::string const &args)
Ship *ship = static_cast<Ship *>(player->control());
ship->shutdown_physics();
core::Entity *dock = player->view();
- ship->entity_location.assign(dock->location() + (dock->axis().forward() * (player->control()->radius()+ dock->radius())));
+ ship->entity_location.assign(dock->location() + (dock->axis().forward() * (ship->radius()+ dock->radius())));
ship->entity_axis.assign(dock->axis());
ship->set_state(core::Entity::Normal);
ship->init_physics(ship->radius());
+ ship->set_state(core::Entity::Jump);
player->set_view(0);
player->send("^BLaunching from " + dock->name());
@@ -258,21 +259,27 @@ void Game::func_respawn(core::Player *player, std::string const &args)
if (player->control()->state() != core::Entity::Destroyed)
return;
- player->control()->set_zone(Default::zone);
+ Ship *ship = static_cast<Ship *>(player->control());
core::Entity *dock = player->control()->zone()->default_view();
+
+ ship->shutdown_physics();
+
if (dock) {
- player->control()->entity_location.assign(dock->location() + (dock->axis().forward() * ((player->control()->radius()+ dock->radius()))));
- player->control()->entity_axis.assign(dock->axis());
- player->control()->set_state(core::Entity::Docked);
+ ship->entity_location.assign(dock->location() + (dock->axis().forward() * ((ship->radius()+ dock->radius()))));
+ ship->entity_axis.assign(dock->axis());
+ ship->set_state(core::Entity::Docked);
player->set_view(dock);
player->send("^BRespawning at " + dock->name());
} else {
- player->control()->location().clear();
- player->control()->axis().clear();
- player->control()->set_state(core::Entity::Normal);
+ ship->location().clear();
+ ship->axis().clear();
+ ship->set_state(core::Entity::Jump);
player->set_view(0);
player->send("^BRespawning");
}
+
+ ship->set_zone(Default::zone);
+ ship->init_physics(ship->radius());
}
@@ -302,7 +309,8 @@ void Game::func_goto(core::Player *player, const std::string &args)
ship->set_state(core::Entity::Normal);
ship->init_physics(ship->radius());
-
+ ship->set_state(core::Entity::Jump);
+
player->set_view(0);
player->send("Going to " + dock->name());
} else {
@@ -945,10 +953,10 @@ bool Game::load_player()
void Game::frame(float seconds)
{
+ Physics::frame(seconds);
+
if (!running())
return;
-
- Physics::frame(seconds);
}
void Game::player_connect(core::Player *player)
diff --git a/src/game/base/game.h b/src/game/base/game.h
index 1f16a9f..7519970 100644
--- a/src/game/base/game.h
+++ b/src/game/base/game.h
@@ -51,7 +51,7 @@ public:
Game();
virtual ~Game();
- /// run one time frame
+ /// run one game frame
void frame(float seconds);
/// is called when a player connects
diff --git a/src/game/base/physics.cc b/src/game/base/physics.cc
index e0b6a70..b76e0c1 100644
--- a/src/game/base/physics.cc
+++ b/src/game/base/physics.cc
@@ -267,7 +267,7 @@ void PhysicsBody::init_physics(const float mass)
collider_body = new btRigidBody(body_info);
collider_body->setUserPointer((void *)entity());
collider_body->setLinearFactor(btVector3(1,1,1));
- //collider_body->setCcdMotionThreshold(0.0001f);
+ collider_body->setCcdMotionThreshold(0.0001f);
} else {
collider_body = new btRigidBody(mass, 0, collider_shape->bullet_shape(), inertia);
collider_body->setWorldTransform(t);
diff --git a/src/game/base/ship.cc b/src/game/base/ship.cc
index 739b29a..b512d34 100644
--- a/src/game/base/ship.cc
+++ b/src/game/base/ship.cc
@@ -278,14 +278,14 @@ void Ship::frame(float seconds)
if (entity_timer <= 0) {
if (ship_jumpdepart && ship_jumpdepart->target()) {
set_state(core::Entity::Jump);
+ entity_speed = Game::g_impulsespeed->value();
if (ship_jumpdepart->moduletype() == jumpgate_enttype) {
entity_axis.assign(ship_jumpdepart->target()->axis());
entity_location.assign(ship_jumpdepart->target()->location());
//entity_location += entity_axis.forward() * radius();
} else {
entity_location.assign(ship_jumpdepart->target()->location() + location() - ship_jumpdepart->location());
- }
-
+ }
set_zone(ship_jumpdepart->target()->zone());
owner()->send("^BJumping to the " + ship_jumpdepart->target()->zone()->name());
} else {
@@ -320,18 +320,16 @@ void Ship::frame(float seconds)
target_afterburner = 0.0f;
target_thrust = 0;
- // FIXME jump location and axis
- //math::Axis default_axis;
- //entity_axis.assign(default_axis);
- entity_dirty = true;
-
// FIXME 5 second cooldown
- entity_speed = Game::g_impulsespeed->value();
entity_state = core::Entity::Normal;
+ entity_dirty = true;
+
if (owner() && owner()->view() && owner()->control() == (EntityControlable*) this)
owner()->set_view(0);
+ return;
+
} else if (entity_state == core::Entity::ImpulseInitiate) {
if (ship_impulsedrive_timer + 1.0f <= core::server()->time()) {
@@ -546,7 +544,7 @@ void Ship::frame(float seconds)
location().assign(v[0], v[1], v[2]);
// apply engine trust to the body
- body()->applyCentralImpulse(to_btVector3(axis().forward() * actual_thrust * actual_acceleration * seconds * 10.0f));
+ body()->applyCentralImpulse(to_btVector3(axis().forward() * actual_thrust * actual_acceleration * seconds * 20.0f));
#endif /* else #ifndef HAVE_BULLET */
diff --git a/src/model/fragment.cc b/src/model/fragment.cc
index d8479eb..7765b7e 100644
--- a/src/model/fragment.cc
+++ b/src/model/fragment.cc
@@ -25,9 +25,9 @@ Fragment::Fragment(Type type, const Material *material)
fragment_detail_size = 0;
}
-size_t Fragment::add_vertex(math::Vector3f const & vertex, math::Vector3f const &normal, math::Color const & color, bool detail)
+size_t Fragment::add_vertex(math::Vector3f const & vertex, math::Vector3f const &normal, bool detail)
{
- size_t n = VertexArray::instance()->add_vertex(vertex, normal, color);
+ size_t n = VertexArray::instance()->add_vertex(vertex, normal);
if (n) {
if (detail)
fragment_detail_size += n;
diff --git a/src/model/fragment.h b/src/model/fragment.h
index d9c200d..e975734 100644
--- a/src/model/fragment.h
+++ b/src/model/fragment.h
@@ -10,7 +10,6 @@
#include <list>
#include "math/axis.h"
-#include "math/color.h"
#include "math/vector3f.h"
#include "model/material.h"
@@ -28,7 +27,7 @@ public:
Fragment(Type type, const Material *material);
/// add a vertex to the fragment
- size_t add_vertex(math::Vector3f const & vertex, math::Vector3f const &normal, math::Color const & color, bool detail);
+ size_t add_vertex(math::Vector3f const & vertex, math::Vector3f const &normal, bool detail);
/// the type of primitives this fragment consists of
inline Type type() const
diff --git a/src/model/map.cc b/src/model/map.cc
index 1d1983c..c2b184f 100644
--- a/src/model/map.cc
+++ b/src/model/map.cc
@@ -434,13 +434,10 @@ void Map::make_brushface(Plane *face)
if (vl.size() > 2) {
Material *material = Material::find(face->texture());
- math::Color color(1.0, 0.0f, 1.0f);
- if (material) {
- color.assign(material->color());
- } else {
+ if (!material) {
material = new Material(face->texture());
Material::add(material);
- material->set_color(color);
+ material->set_color(math::Color(1.0, 0.0f, 1.0f));
material->set_flags(Material::Bright);
// don't show material warnings on a dedicated server
@@ -470,8 +467,12 @@ void Map::make_brushface(Plane *face)
class_minbbox[i] = (*(*it))[i];
}
}
-/* Quads are disable to use model data for bullet physics
-
+
+
+#ifndef HAVE_BULLET
+
+ // Quads are disable to use model data for bullet physics
+
// split polygon into quads
while (vl.size() > 3) {
std::vector<Vector3f *>::iterator v0 = vl.begin();
@@ -485,13 +486,13 @@ void Map::make_brushface(Plane *face)
Vector3f n(face->normal()*-1);
n.normalize();
- primitives->add_quad(*(*vn2), *(*vn1), *(*vn), *(*v0), n, color, face->detail());
+ primitives->add_quad(*(*vn2), *(*vn1), *(*vn), *(*v0), n, face->detail());
delete(*vn);
delete(*vn1);
vl.pop_back();
vl.pop_back();
}
-*/
+#endif
// split polygon into triangles
while (vl.size() > 2) {
std::vector<Vector3f *>::iterator v0 = vl.begin();
@@ -502,7 +503,7 @@ void Map::make_brushface(Plane *face)
Vector3f n(face->normal()*-1);
n.normalize();
- primitives->add_triangle(*(*vn1), *(*vn), *(*v0), n, color, face->detail());
+ primitives->add_triangle(*(*vn1), *(*vn), *(*v0), n, face->detail());
delete(*vn);
vl.pop_back();
}
@@ -677,9 +678,9 @@ void Map::load_fragmentgroup(Model *model, const FragmentGroup::Type class_type)
Triangle *triangle = (*tris_it);
if (!triangle->detail()) {
size_t count = 0;
- count += fragment->add_vertex(triangle->v0()-map_center, triangle->normal(), triangle->color(), false);
- count += fragment->add_vertex(triangle->v1()-map_center, triangle->normal(), triangle->color(), false);
- count += fragment->add_vertex(triangle->v2()-map_center, triangle->normal(), triangle->color(), false);
+ count += fragment->add_vertex(triangle->v0()-map_center, triangle->normal(), false);
+ count += fragment->add_vertex(triangle->v1()-map_center, triangle->normal(), false);
+ count += fragment->add_vertex(triangle->v2()-map_center, triangle->normal(), false);
if (count == 3)
model->model_tris_count++;
}
@@ -690,9 +691,9 @@ void Map::load_fragmentgroup(Model *model, const FragmentGroup::Type class_type)
Triangle *triangle = (*tris_it);
if (triangle->detail()) {
size_t count = 0;
- count += fragment->add_vertex(triangle->v0()-map_center, triangle->normal(), triangle->color(), true);
- count += fragment->add_vertex(triangle->v1()-map_center, triangle->normal(), triangle->color(), true);
- count += fragment->add_vertex(triangle->v2()-map_center, triangle->normal(), triangle->color(), true);
+ count += fragment->add_vertex(triangle->v0()-map_center, triangle->normal(), true);
+ count += fragment->add_vertex(triangle->v1()-map_center, triangle->normal(), true);
+ count += fragment->add_vertex(triangle->v2()-map_center, triangle->normal(), true);
if (count == 3) {
model->model_tris_count++;
model->model_tris_detail_count++;
@@ -713,10 +714,10 @@ void Map::load_fragmentgroup(Model *model, const FragmentGroup::Type class_type)
Quad *quad = (*quad_it);
if (!quad->detail()) {
size_t count = 0;
- count += fragment->add_vertex(quad->v0()-map_center, quad->normal(), quad->color(), false);
- count += fragment->add_vertex(quad->v1()-map_center, quad->normal(), quad->color(), false);
- count += fragment->add_vertex(quad->v2()-map_center, quad->normal(), quad->color(), false);
- count += fragment->add_vertex(quad->v3()-map_center, quad->normal(), quad->color(), false);
+ count += fragment->add_vertex(quad->v0()-map_center, quad->normal(), false);
+ count += fragment->add_vertex(quad->v1()-map_center, quad->normal(), false);
+ count += fragment->add_vertex(quad->v2()-map_center, quad->normal(), false);
+ count += fragment->add_vertex(quad->v3()-map_center, quad->normal(), false);
if (count == 4)
model->model_quad_count++;
}
@@ -727,10 +728,10 @@ void Map::load_fragmentgroup(Model *model, const FragmentGroup::Type class_type)
Quad *quad = (*quad_it);
if (quad->detail()) {
size_t count = 0;
- count += fragment->add_vertex(quad->v0()-map_center, quad->normal(), quad->color(), false);
- count += fragment->add_vertex(quad->v1()-map_center, quad->normal(), quad->color(), false);
- count += fragment->add_vertex(quad->v2()-map_center, quad->normal(), quad->color(), false);
- count += fragment->add_vertex(quad->v3()-map_center, quad->normal(), quad->color(), false);
+ count += fragment->add_vertex(quad->v0()-map_center, quad->normal(), false);
+ count += fragment->add_vertex(quad->v1()-map_center, quad->normal(), false);
+ count += fragment->add_vertex(quad->v2()-map_center, quad->normal(), false);
+ count += fragment->add_vertex(quad->v3()-map_center, quad->normal(), false);
if (count == 4) {
model->model_quad_count++;
model->model_quad_detail_count++;
diff --git a/src/model/primitives.cc b/src/model/primitives.cc
index a53ebcd..5e58b50 100644
--- a/src/model/primitives.cc
+++ b/src/model/primitives.cc
@@ -28,16 +28,16 @@ Primitives::~Primitives()
}
void Primitives::add_triangle(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2,
- math::Vector3f const &normal, math::Color const &color, bool detail)
+ math::Vector3f const &normal, bool detail)
{
- Triangle *triangle = new Triangle(v0, v1, v2, normal, color, detail);
+ Triangle *triangle = new Triangle(v0, v1, v2, normal, detail);
primitives_triangles.push_back(triangle);
}
void Primitives::add_quad(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2, math::Vector3f const &v3,
- math::Vector3f const &normal, math::Color const &color, bool detail)
+ math::Vector3f const &normal, bool detail)
{
- Quad *quad = new Quad(v0, v1, v2, v3, normal, color, detail);
+ Quad *quad = new Quad(v0, v1, v2, v3, normal, detail);
primitives_quads.push_back(quad);
}
diff --git a/src/model/primitives.h b/src/model/primitives.h
index 2b53b5a..d113961 100644
--- a/src/model/primitives.h
+++ b/src/model/primitives.h
@@ -10,7 +10,6 @@
#include <list>
#include "math/vector3f.h"
-#include "math/color.h"
#include "model/material.h"
#include "model/triangle.h"
#include "model/quad.h"
@@ -51,12 +50,11 @@ public:
/// add a Triangle primitive
void add_triangle(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2,
- math::Vector3f const &normal, math::Color const &color, bool detail);
-
+ math::Vector3f const &normal, bool detail);
+
/// add a Quad primitive
void add_quad(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2, math::Vector3f const &v3,
- math::Vector3f const &normal, math::Color const &color, bool detail);
-
+ math::Vector3f const &normal, bool detail);
private:
Triangles primitives_triangles;
Quads primitives_quads;
diff --git a/src/model/quad.cc b/src/model/quad.cc
index 0b8b208..5bed2e4 100644
--- a/src/model/quad.cc
+++ b/src/model/quad.cc
@@ -10,13 +10,12 @@ namespace model
{
Quad::Quad(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2, math::Vector3f const &v3,
- math::Vector3f const &normal, math::Color const &color, bool detail) :
+ math::Vector3f const &normal, bool detail) :
quad_v0(v0),
quad_v1(v1),
quad_v2(v2),
quad_v3(v3),
- quad_normal(normal),
- quad_color(color)
+ quad_normal(normal)
{
quad_detail = detail;
}
diff --git a/src/model/quad.h b/src/model/quad.h
index 42832d0..2950477 100644
--- a/src/model/quad.h
+++ b/src/model/quad.h
@@ -19,7 +19,7 @@ class Quad
public:
/// a new quad with 4 vertices, a normal, color and a detail flag
Quad(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2, math::Vector3f const &v3,
- math::Vector3f const &normal, math::Color const & color, bool detail);
+ math::Vector3f const &normal, bool detail);
/// delete quad
~Quad();
@@ -29,12 +29,6 @@ public:
return quad_normal;
}
- /// color of the quad
- inline math::Color const & color() const
- {
- return quad_color;
- }
-
/// indidcates if this quad was generated from a detail brush
inline bool detail() const
{
@@ -72,7 +66,6 @@ private:
math::Vector3f quad_v3;
math::Vector3f quad_normal;
- math::Color quad_color;
bool quad_detail;
};
diff --git a/src/model/triangle.cc b/src/model/triangle.cc
index 807d536..162b68a 100644
--- a/src/model/triangle.cc
+++ b/src/model/triangle.cc
@@ -10,12 +10,11 @@ namespace model
{
Triangle::Triangle(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2,
- math::Vector3f const &normal, math::Color const &color, bool detail) :
+ math::Vector3f const &normal, bool detail) :
triangle_v0(v0),
triangle_v1(v1),
triangle_v2(v2),
- triangle_normal(normal),
- triangle_color(color)
+ triangle_normal(normal)
{
triangle_detail = detail;
}
diff --git a/src/model/triangle.h b/src/model/triangle.h
index 8f4a6a5..416a3e6 100644
--- a/src/model/triangle.h
+++ b/src/model/triangle.h
@@ -19,7 +19,7 @@ class Triangle
public:
/// a new triangle with 3 vertices, a normal, color and a detail flag
Triangle(math::Vector3f const &v0, math::Vector3f const &v1, math::Vector3f const &v2,
- math::Vector3f const &normal, math::Color const & color, bool detail);
+ math::Vector3f const &normal, bool detail);
/// delete triangle
~Triangle();
@@ -29,12 +29,6 @@ public:
return triangle_normal;
}
- /// color of the triangle
- inline math::Color const & color() const
- {
- return triangle_color;
- }
-
/// indidcates if this triangle was generated from a detail brush
inline bool detail() const
{
@@ -65,7 +59,6 @@ private:
math::Vector3f triangle_v2;
math::Vector3f triangle_normal;
- math::Color triangle_color;
bool triangle_detail;
};
diff --git a/src/model/vertexarray.cc b/src/model/vertexarray.cc
index dc5e23e..8509dc6 100644
--- a/src/model/vertexarray.cc
+++ b/src/model/vertexarray.cc
@@ -21,10 +21,9 @@ VertexArray::VertexArray(size_t size)
vertex_instance = this;
vertex_size = size * 1024*1024; // megabytes
vertex_size = vertex_size / sizeof(float); // sizeof float
- vertex_size = vertex_size / 4; // 4 arrays
+ vertex_size = vertex_size / 3; // 3 arrays
vertex_vertex = (float *) malloc(vertex_size * sizeof(float));
- vertex_color = (float *) malloc(vertex_size * sizeof(float));
vertex_normal = (float *) malloc(vertex_size * sizeof(float));
vertex_texture = (float *) malloc(vertex_size * sizeof(float));
@@ -38,7 +37,6 @@ VertexArray::~VertexArray()
{
free(vertex_vertex);
free(vertex_normal);
- free(vertex_color);
free(vertex_texture);
vertex_instance = 0 ;
@@ -50,7 +48,6 @@ void VertexArray::clear()
vertex_overflow = false;
memset(vertex_vertex, 0, sizeof(vertex_vertex));
- memset(vertex_color, 0, sizeof(vertex_color));
memset(vertex_normal, 0, sizeof(vertex_normal));
memset(vertex_texture, 0, sizeof(vertex_texture));
@@ -75,7 +72,6 @@ void VertexArray::add_sphere()
}
// draw body
- math::Color white(1.0f, 1.0f, 1.0f);
math::Vector3f v;
math::Vector3f n;
float texx, texy;
@@ -94,14 +90,14 @@ void VertexArray::add_sphere()
n.normalize();
texx = (float)i/(float)(SPHERESEGMENTS-1);
texy = -costable[j]/2 + 0.5f;
- add_vertex(v, n, white, texx, texy);
+ add_vertex(v, n, texx, texy);
v = math::Vector3f(r1*costable[i], r1*sintable[i], costable[j+1]);
n = v;
n.normalize();
texx = (float)i/(float)(SPHERESEGMENTS-1);
texy = -costable[j+1]/2 + 0.5f;
- add_vertex(v, n, white, texx, texy);
+ add_vertex(v, n, texx, texy);
quad_count++;
}
@@ -122,14 +118,14 @@ void VertexArray::add_sphere()
n.normalize();
texx = 1-(float)i/(float)(SPHERESEGMENTS-1);
texy = -costable[j]/2 + 0.5f;
- add_vertex(v, n, white, texx, texy);
+ add_vertex(v, n, texx, texy);
v = math::Vector3f(r1*costable[i], r1*sintable[i], costable[j+1]);
n = v;
n.normalize();
texx = 1-(float)i/(float)(SPHERESEGMENTS-1);
texy = -costable[j+1]/2 + 0.5f;
- add_vertex(v, n, white, texx, texy);
+ add_vertex(v, n, texx, texy);
}
}
@@ -138,7 +134,7 @@ void VertexArray::add_sphere()
delete[] costable;
}
-size_t VertexArray::add_vertex(math::Vector3f const &v, math::Vector3f const &n, math::Color const &color, float tex_x, float tex_y)
+size_t VertexArray::add_vertex(math::Vector3f const &v, math::Vector3f const &n, float tex_x, float tex_y)
{
if (vertex_index + 3 >= vertex_size) {
if (!vertex_overflow) {
@@ -152,14 +148,9 @@ size_t VertexArray::add_vertex(math::Vector3f const &v, math::Vector3f const &n,
vertex_vertex[vertex_index+i] = v[i];
vertex_normal[vertex_index+i] = n[i];
}
-
- vertex_color[vertex_index] = color.r;
- vertex_color[vertex_index+1] = color.g;
- vertex_color[vertex_index+2] = color.b;
-
+
vertex_texture[vertex_index] = tex_x;
vertex_texture[vertex_index+1] = tex_y;
- // reserved
vertex_texture[vertex_index+2] = 0;
vertex_index += 3;
diff --git a/src/model/vertexarray.h b/src/model/vertexarray.h
index 8312789..4277442 100644
--- a/src/model/vertexarray.h
+++ b/src/model/vertexarray.h
@@ -7,13 +7,13 @@
#ifndef __INCLUDED_MODEL_VERTEXARRAY_H__
#define __INCLUDED_MODEL_VERTEXARRAY_H__
-#include "math/color.h"
#include "math/vector3f.h"
namespace model
{
-const int SPHERESEGMENTS=65;
+// number of segments in a sphere circle, must be uneven
+const int SPHERESEGMENTS = 65;
/// global vertex array
/** a VertexArray acts like a stack of model vertices, it has no knowledge of what it is holding
@@ -27,20 +27,18 @@ public:
void clear();
- size_t add_vertex(math::Vector3f const &v, math::Vector3f const &n, math::Color const &color, float tex_x=0.0f, float tex_y=0.0f);
+ size_t add_vertex(math::Vector3f const &v, math::Vector3f const &n, float tex_x=0.0f, float tex_y=0.0f);
inline float *vertex()
{
return vertex_vertex;
}
- inline float *color()
- {
- return vertex_color;
- }
+
inline float *normal()
{
return vertex_normal;
}
+
inline float *texture()
{
return vertex_texture;
@@ -71,7 +69,6 @@ public:
private:
/// model vertices
float *vertex_vertex;
- float *vertex_color;
float *vertex_normal;
float *vertex_texture;
diff --git a/src/render/draw.cc b/src/render/draw.cc
index f128019..5b3127b 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -625,7 +625,7 @@ void draw_model_fragments(model::Model *model,
}
}
} else {
- /// material not found
+ // material not found
if (use_light) {
gl::disable(GL_LIGHTING);
use_light = false;
@@ -1027,8 +1027,8 @@ void draw(float seconds)
// set vertex array pointers
glVertexPointer(3, GL_FLOAT, 0, core::game()->vertexarray()->vertex());
glNormalPointer(GL_FLOAT, 0, core::game()->vertexarray()->normal());
- glColorPointer(3, GL_FLOAT, 0, core::game()->vertexarray()->color());
glTexCoordPointer(3, GL_FLOAT, 0, core::game()->vertexarray()->texture());
+// glColorPointer(3, GL_FLOAT, sizeof(float) * (model::VERTEXSIZE - 3), core::game()->vertexarray()->color());
// enable vertex arrays
glEnableClientState(GL_VERTEX_ARRAY);
diff --git a/src/sys/sys.h b/src/sys/sys.h
index 3d94bcb..eb9d099 100644
--- a/src/sys/sys.h
+++ b/src/sys/sys.h
@@ -9,6 +9,11 @@
#include "config.h"
+// disable bullet for now
+#ifdef HAVE_BULLET
+#undef HAVE_BULLET
+#endif
+
#include <string>
/// maximum line size throught the game