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>2008-02-10 17:54:53 +0000
committerStijn Buys <ingar@osirion.org>2008-02-10 17:54:53 +0000
commit825d5a44bd312772c53fdaa8924e4009cfb320a3 (patch)
treea222232dee96bfe391eba819b1a18693db5bb3a4 /src/client/view.cc
parent31959bc355c471c573828bf63932850e46c4b5bc (diff)
more entity updates
Diffstat (limited to 'src/client/view.cc')
-rw-r--r--src/client/view.cc59
1 files changed, 5 insertions, 54 deletions
diff --git a/src/client/view.cc b/src/client/view.cc
index 4627d26..b6ef28a 100644
--- a/src/client/view.cc
+++ b/src/client/view.cc
@@ -10,6 +10,7 @@
#include "client/video.h"
#include "client/draw.h"
#include "render/render.h"
+#include "core/core.h"
#include "game/game.h"
#include "sys/sys.h"
#include "math/mathlib.h"
@@ -61,54 +62,6 @@ void reset()
gl::disable(GL_CULL_FACE);
}
-void draw_background(float elapsed)
-{
- using namespace render::gl;
-
- // galactic axis
- begin(Lines);
- color(0.9f, 0.5f, 0.0f);
- vertex(-2,0,0);
- color(1.0f, 1.0f, 0.0f);
- vertex(2,0,0);
-
- vertex(0,0,-0.5);
- vertex(0,0,0.5);
-
- vertex(0,1.0f,0);
- vertex(0,-1, 0);
- end();
-
- translate(camera::target);
-
- int gridsize = 32;
- float s = 1.0f / gridsize;
- float y = -4.0f;
-
- float dx = camera::target.x - floorf(camera::target.x);
- float dz = camera::target.z - floorf(camera::target.z);
-
- color(0,0, 1.0f);
- begin(Lines);
- for (int i=-gridsize; i <= gridsize; i++) {
- color(0,0, 0, 0);
- vertex(i-dx, y, -gridsize-dz);
- color(0,0, (gridsize-abs(i))*s, (gridsize-abs(i))*s);
- vertex(i-dx, y, -dz);
- vertex(i-dx, y, -dz);
- color(0,0, 0, 0);
- vertex(i-dx, y, gridsize-dz);
-
- vertex(-gridsize-dx, y, i-dz);
- color(0,0, (gridsize-abs(i))*s, (gridsize-abs(i))*s);
- vertex(-dx, y, i-dz);
- vertex(-dx, y, i-dz);
- color(0,0, 0, 0);
- vertex(gridsize-dx, y, i-dz);
- }
- end();
-}
-
void draw_loader()
{
using namespace render;
@@ -161,7 +114,7 @@ void draw_status()
status << " time " << std::setfill('0') << std::setw(2) << minutes << ":" << std::setfill('0') << std::setw(2) << seconds;
status << " fps " << std::setw(4) << fps;
- draw_text(0, 4, status);
+ draw_text(CHARWIDTH, 4, status);
// print the version number in the upper right corner
gl::color(0.0f, 1.0f, 0.0f, 1.0f);
@@ -204,14 +157,11 @@ void frame(float seconds)
gl::enable(GL_DEPTH_TEST); // enable depth buffer writing
gl::enable(GL_CULL_FACE); // enable culling
+ gl::enable(GL_BLEND); // enable alpha blending
draw_world(seconds); // draw the world
gl::disable(GL_CULL_FACE); // disable culling
- gl::enable(GL_BLEND); // enable alpha blending
-
- draw_background(seconds); // draw the spacegrid
-
gl::disable(GL_DEPTH_TEST); // disable depth buffer writing
}
@@ -234,8 +184,9 @@ void frame(float seconds)
// draw the status line
draw_status();
-
+
gl::disable(GL_BLEND);
+
}
} //namespace view