diff options
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/draw.cc | 8 | ||||
-rw-r--r-- | src/render/render.cc | 33 | ||||
-rw-r--r-- | src/render/render.h | 6 |
3 files changed, 11 insertions, 36 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc index 5784347..f128019 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -1025,10 +1025,10 @@ void draw(float seconds) } // set vertex array pointers - glVertexPointer(3, GL_FLOAT, 0, vertexarray->vertex()); - glNormalPointer(GL_FLOAT, 0, vertexarray->normal()); - glColorPointer(3, GL_FLOAT, 0, vertexarray->color()); - glTexCoordPointer(3, GL_FLOAT, 0, vertexarray->texture()); + 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()); // enable vertex arrays glEnableClientState(GL_VERTEX_ARRAY); diff --git a/src/render/render.cc b/src/render/render.cc index 60d64a7..ce23645 100644 --- a/src/render/render.cc +++ b/src/render/render.cc @@ -26,9 +26,6 @@ namespace render { -model::VertexArray *vertexarray = 0; - -core::Cvar *r_arraysize = 0; core::Cvar *r_bbox = 0; core::Cvar *r_grid = 0; core::Cvar *r_particles = 0; @@ -36,6 +33,7 @@ core::Cvar *r_radius = 0; core::Cvar *r_sky = 0; core::Cvar *r_wireframe = 0; core::Cvar *r_mipmap = 0; +core::Cvar *r_collision = 0; void func_list_textures(std::string const &args) { @@ -63,18 +61,6 @@ void init(int width, int height) // initialize render state State::init(width, height); - // size of the vertex array in megabytes - r_arraysize = core::Cvar::get("r_arraysize", 64.0f , core::Cvar::Archive); - r_arraysize->set_info("[int] size of the vertex array in Mb"); - - size_t mb = (size_t) r_arraysize->value(); - if (mb < 4 * sizeof(float)) - mb = 4 * sizeof(float); - if (mb > 256) - mb = 256; - (*r_arraysize) = (float) mb; - vertexarray = new model::VertexArray(mb); - // engine variables r_radius = core::Cvar::get("r_radius", "0", core::Cvar::Archive); r_radius->set_info("[bool] render entity radius"); @@ -93,7 +79,10 @@ void init(int width, int height) r_particles = core::Cvar::get("r_particles", "1", core::Cvar::Archive); r_particles->set_info("[bool] render particles"); - + /* + r_collision = core::Cvar::get("r_collision", "1", core::Cvar::Archive); + r_collision->set_info("[bool] render collision (server side only)"); + */ Screenshot::screenshotformat = core::Cvar::get("screenshotformat", "jpg", core::Cvar::Archive); Screenshot::screenshotformat->set_info("[string] screenshot format: jpg png tga"); @@ -196,10 +185,6 @@ void clear() // clear particle system scripts ParticleScript::clear(); - - // clear vertex array - delete vertexarray; - vertexarray = 0; } // reset render subsystem (module disconnect) @@ -213,14 +198,6 @@ void reset() Textures::init(); - size_t mb = (size_t) r_arraysize->value(); - if (mb < 4 * sizeof(float)) - mb = 4 * sizeof(float); - if (mb > 256) - mb = 256; - (*r_arraysize) = (float) mb; - vertexarray = new model::VertexArray(mb); - Dust::reset(); model::Material::init(); diff --git a/src/render/render.h b/src/render/render.h index a7b1950..54205bc 100644 --- a/src/render/render.h +++ b/src/render/render.h @@ -36,8 +36,6 @@ namespace render { /// resize viewport void resize(int width, int height); - /// size of the vertex array, in megabytes - extern core::Cvar *r_arraysize; /// render model bounding boxes extern core::Cvar *r_bbox; /// render the spacegrid @@ -50,10 +48,10 @@ namespace render { extern core::Cvar *r_sky; /// render wireframe models extern core::Cvar *r_wireframe; + /// render collision + extern core::Cvar *r_collision; /// use hardware generated mipmaps (requires OpenGL 1.4, does not work on all cards) extern core::Cvar *r_mipmap; - /// global vertex arrat - extern model::VertexArray *vertexarray; inline RenderExt *ext_render(core::Entity *entity) { return static_cast<RenderExt *>(entity->extension((size_t)core::Extension::Render)); } |