Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/view.cc16
-rw-r--r--src/render/camera.cc4
-rw-r--r--src/render/draw.cc18
3 files changed, 22 insertions, 16 deletions
diff --git a/src/client/view.cc b/src/client/view.cc
index c74c83e..fa96096 100644
--- a/src/client/view.cc
+++ b/src/client/view.cc
@@ -31,9 +31,11 @@ namespace client
core::Cvar *draw_ui = 0;
core::Cvar *draw_stats = 0;
-core::Cvar *cl_crosshaircolor = 0;
+core::Cvar *draw_location = 0;
core::Cvar *draw_radar = 0;
+core::Cvar *cl_crosshaircolor = 0;
+
namespace view
{
@@ -44,6 +46,9 @@ void init()
draw_stats = core::Cvar::get("draw_stats", "0", core::Cvar::Archive);
draw_stats->set_info("[bool] draw network and render statistics");
+ draw_location = core::Cvar::get("draw_location", "0", core::Cvar::Archive);
+ draw_location->set_info("[bool] draw world location");
+
draw_ui = core::Cvar::get("draw_ui", "1", core::Cvar::Archive);
draw_ui->set_info("[bool] draw the user interface");
@@ -178,6 +183,15 @@ void draw_status()
<< std::setprecision(2) << core::localcontrol()->speed();
Text::draw(4, video::height - Text::fontheight() -4, status);
+
+ if (draw_location->value()) {
+ std::stringstream location;
+ location << "^Nloc ^B" << std::fixed << std::setprecision(2) << std::setfill(' ') <<
+ std::setw(7) << core::localcontrol()->location().x << " " <<
+ std::setw(7) << core::localcontrol()->location().y << " " <<
+ std::setw(7) << core::localcontrol()->location().z;
+ Text::draw(4, video::height - Text::fontheight()*2 -4, location);
+ }
}
}
diff --git a/src/render/camera.cc b/src/render/camera.cc
index a55038d..287e4ad 100644
--- a/src/render/camera.cc
+++ b/src/render/camera.cc
@@ -265,8 +265,8 @@ void Camera::draw(float seconds)
}
if (core::localcontrol()->model()) {
- camera_target -= (core::localcontrol()->model()->maxbbox().x + 0.1f) * camera_axis.forward();
- camera_target += (core::localcontrol()->model()->maxbbox().z + 0.1f ) * camera_axis.up();
+ camera_target -= (core::localcontrol()->model()->maxbbox().x + core::localcontrol()->model()->radius() + 0.1f) * 0.5f * camera_axis.forward();
+ camera_target += (core::localcontrol()->model()->maxbbox().z + core::localcontrol()->model()->radius() + 0.1f) * 0.5f * camera_axis.up();
}
} else if (mode() == Free) {
diff --git a/src/render/draw.cc b/src/render/draw.cc
index d1b06ea..c650169 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -716,14 +716,14 @@ void draw_pass_sky()
if (!(r_sky && r_sky->value()))
return;
- size_t flare_texture = Textures::load("textures/env/sky");
- Textures::bind(flare_texture);
+ size_t sky_texture = Textures::load("textures/env/sky");
+ Textures::bind(sky_texture);
gl::enable(GL_TEXTURE_2D);
gl::push();
gl::translate(Camera::eye());
- draw_sphere_inside(math::Color(), 16000);
+ draw_sphere_inside(math::Color(), 8192);
gl::pop();
gl::disable(GL_TEXTURE_2D);
@@ -784,7 +784,7 @@ void draw(float seconds)
gl::matrixmode(GL_PROJECTION);
gl::loadidentity();
gl::frustum(-frustum_size*Camera::aspect(), frustum_size*Camera::aspect(),
- -frustum_size, frustum_size, frustum_front, 16384.0f);
+ -frustum_size, frustum_size, frustum_front, 8192.0f);
gl::matrixmode(GL_MODELVIEW);
gl::loadidentity();
@@ -826,16 +826,8 @@ void draw(float seconds)
draw_pass_default(); // draw entities without model
- gl::disable(GL_RESCALE_NORMAL);
-
- // adjust the projection matrix for local world view
- gl::matrixmode(GL_PROJECTION);
- gl::loadidentity();
- gl::frustum(-frustum_size*Camera::aspect(), frustum_size*Camera::aspect(),
- -frustum_size, frustum_size, frustum_front, 1024.0f);
- gl::matrixmode(GL_MODELVIEW);
-
glEnableClientState(GL_COLOR_ARRAY);
+ gl::disable(GL_RESCALE_NORMAL);
draw_pass_model_vertex(); // draw entities with model