From 7de62efc14d0e0f037051bd887c96f28fd9a3215 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 7 Dec 2008 09:03:10 +0000 Subject: add system map, prepare source tree for dataset reorganization --- src/render/draw.cc | 112 ++---------------------------------------------- src/render/renderext.cc | 4 +- 2 files changed, 6 insertions(+), 110 deletions(-) (limited to 'src/render') diff --git a/src/render/draw.cc b/src/render/draw.cc index b42a849..35b9956 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -249,7 +249,7 @@ void draw_globe(core::EntityGlobe *globe) if (!globe->render_texture) { gl::enable(GL_TEXTURE_2D); } - Textures::bind("bitmaps/fx/corona"); + Textures::bind("textures/fx/corona"); /* if (ext_render(globe)->distance() <= farplane) { gl::depthmask(GL_FALSE); @@ -712,11 +712,8 @@ void draw_pass_model_fx(float elapsed) //const size_t count = 8; // number of engine trail particles float t = 0.0f; - //float u = 0.0f; float a = 0.0f; float light_size = 0.0f; - //float engine_size = 0.0f; - //float trail_size = 0.0f; bool power = true; float thrust; @@ -727,12 +724,10 @@ void draw_pass_model_fx(float elapsed) model::Light *light; model::Flare *flare; - //model::Engine *engine; math::Axis flare_axis; - //size_t circle_texture = Textures::load("bitmaps/fx/circle01"); - size_t current_texture = Textures::bind("bitmaps/fx/flare00"); + size_t current_texture = Textures::bind("textures/fx/flare00"); gl::enable(GL_TEXTURE_2D); gl::begin(gl::Quads); @@ -858,106 +853,7 @@ void draw_pass_model_fx(float elapsed) } } -/* - // draw model engines for Controlable entities - if ((entity->type() == core::Entity::Controlable) && entity->model()->engines().size()) { - core::EntityControlable *ec = static_cast(entity); - u = ec->thrust(); - if ((ec->eventstate() == core::Entity::ImpulseInitiate) || (ec->eventstate() == core::Entity::Impulse)) { - u = 1; - } - - if (u > 0) { - t = ext_render(entity)->state_engine_trail_offset; - t += elapsed * 4.0f * u; - - if (t > 1.0f) - t -= 1.0f; - math::clamp(t, 0.0f, 1.0f); - ext_render(entity)->state_engine_trail_offset = t; - - for(model::Model::Engines::iterator eit = entity->model()->engines().begin(); eit != entity->model()->engines().end(); eit++) { - - engine = (*eit); - location.assign(entity->location() + (entity->axis() * engine->location())); - engine_size = 0.0625 * engine->radius(); - - if (current_texture != engine->texture() ) { - gl::end(); - current_texture = Textures::bind(engine->texture()); - gl::begin(gl::Quads); - } - - quad[0].assign(entity->axis().up() - entity->axis().left()); - quad[1].assign(entity->axis().up() + entity->axis().left()); - quad[2].assign(entity->axis().up() * -1 + entity->axis().left()); - quad[3].assign(entity->axis().up() * -1 - entity->axis().left()); - - // assign engine color to the flare - if (!engine->noflare()){ - color.assign(entity->model()->enginecolor()); - color.a = 0.9f * u; - - gl::color(color); - glTexCoord2f(0,1); - gl::vertex(location + quad[0] * engine_size); - glTexCoord2f(0,0); - gl::vertex(location + quad[1] * engine_size); - glTexCoord2f(1,0); - gl::vertex(location + quad[2] * engine_size); - glTexCoord2f(1,1); - gl::vertex(location + quad[3] * engine_size); - Stats::quads++; - } - - if (!(engine->notrail() || (ec->eventstate() == core::Entity::Impulse))) { - // draw the engine trail - if (current_texture != circle_texture) { - gl::end(); - current_texture = Textures::bind(circle_texture); - gl::begin(gl::Quads); - } - color.assign(1.0f, 1.0f); - offset.assign(entity->axis().forward() * engine_size); - - if (t > 0) - location -= offset * t; - - for (size_t i = count; i > 0; i--) { - trail_size = engine_size * 0.8f * (0.4f + ((-t + (float) i) / (float) count) * 0.6f); - color.a = (0.1f + ((-t + (float) i) / (float) count) * 0.7f) * u; - gl::color(color); - glTexCoord2f(0,1); - gl::vertex(location + quad[0] * trail_size); - glTexCoord2f(0,0); - gl::vertex(location + quad[1] * trail_size); - glTexCoord2f(1,0); - gl::vertex(location + quad[2] * trail_size); - glTexCoord2f(1,1); - gl::vertex(location + quad[3] * trail_size); - Stats::quads++; - - - gl::color(color); - glTexCoord2f(1,1); - gl::vertex(location + quad[3] * trail_size); - glTexCoord2f(1,0); - gl::vertex(location + quad[2] * trail_size); - glTexCoord2f(0,0); - gl::vertex(location + quad[1] * trail_size); - glTexCoord2f(0,1); - gl::vertex(location + quad[0] * trail_size); - Stats::quads++; - - location -= offset; - } - } - } - } - } - */ - - // draw particles + // draw particle systems if (ext_render(entity)->particles().size()) { gl::end(); gl::disable(GL_CULL_FACE); @@ -968,7 +864,7 @@ void draw_pass_model_fx(float elapsed) } gl::enable(GL_CULL_FACE); - current_texture = Textures::bind("bitmaps/fx/flare00"); + current_texture = Textures::bind("textures/fx/flare00"); gl::begin(gl::Quads); } } diff --git a/src/render/renderext.cc b/src/render/renderext.cc index 01e8fcf..0fa6796 100644 --- a/src/render/renderext.cc +++ b/src/render/renderext.cc @@ -40,7 +40,7 @@ RenderExt::RenderExt(core::Entity *entity) : core::Extension(core::Extension::Re // load light texture std::stringstream flarename; - flarename << "bitmaps/fx/flare" << std::setfill('0') << std::setw(2) << light->flare(); + flarename << "textures/fx/flare" << std::setfill('0') << std::setw(2) << light->flare(); light->render_texture = Textures::load(flarename.str()); } @@ -49,7 +49,7 @@ RenderExt::RenderExt(core::Entity *entity) : core::Extension(core::Extension::Re // load flare texture std::stringstream flarename; - flarename << "bitmaps/fx/flare" << std::setfill('0') << std::setw(2) << flare->flare(); + flarename << "textures/fx/flare" << std::setfill('0') << std::setw(2) << flare->flare(); flare->render_texture = Textures::load(flarename.str()); } -- cgit v1.2.3