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-09-27 17:16:15 +0000
committerStijn Buys <ingar@osirion.org>2008-09-27 17:16:15 +0000
commitca0c1d3e6f8b5fa4eb2e0a86fcf47b12fb600786 (patch)
tree5d72e330f11350065806e83cc8712693241b9aad /src/client/view.cc
parent29984680d6e0e52efec489497b1796e056164442 (diff)
mission targets, texture unloading, private messages
Diffstat (limited to 'src/client/view.cc')
-rw-r--r--src/client/view.cc58
1 files changed, 46 insertions, 12 deletions
diff --git a/src/client/view.cc b/src/client/view.cc
index 8cf1af9..bbf9088 100644
--- a/src/client/view.cc
+++ b/src/client/view.cc
@@ -18,13 +18,8 @@
#include "client/input.h"
#include "client/targets.h"
#include "client/video.h"
-#include "render/draw.h"
#include "render/render.h"
-#include "render/textures.h"
-#include "render/camera.h"
#include "core/core.h"
-#include "core/stats.h"
-#include "core/zone.h"
#include "math/mathlib.h"
#include "sys/sys.h"
@@ -38,6 +33,7 @@ core::Cvar *draw_keypress = 0;
core::Cvar *ui_pointercolor = 0;
core::Cvar *ui_pointerhovercolor =0;
+
namespace view
{
@@ -50,6 +46,8 @@ float net_counter_time[net_counter_size];
size_t net_counter_traffic[net_counter_size];
size_t net_counter_index;
+core::Zone *current_zone = 0;
+
void init()
{
draw_stats = core::Cvar::get("draw_stats", "0", core::Cvar::Archive);
@@ -84,6 +82,26 @@ void shutdown()
targets::shutdown();
}
+void clear_zone(core::Zone *zone)
+{
+ for (core::Zone::Content::iterator it = zone->content().begin(); it != zone->content().end(); it++) {
+ core:: Entity *entity = (*it);
+
+ if (entity->type() == core::Entity::Globe) {
+ core::EntityGlobe *globe = static_cast<core::EntityGlobe *>(entity);
+ if (globe->render_texture) {
+ render::Textures::unload(globe->render_texture);
+ globe->render_texture = 0;
+ }
+ }
+ }
+
+ if (zone->sky_texture()) {
+ render::Textures::unload(zone->sky_texture());
+ zone->set_sky_texture(0);
+ }
+}
+
void draw_loader()
{
using namespace render;
@@ -219,10 +237,12 @@ void draw_entity_offscreen_target(core::Entity *entity, bool is_active_target)
glVertex3f(cx, cy-r+2, 0);
render::gl::end();
- if (entity->type() == core::Entity::Controlable) {
- render::gl::color(0, 1, 0, 1);
+ if (entity == core::localplayer()->mission_target()) {
+ render::gl::color(1, 0.5f, 1, 1); // FIXME mission color
+ } else if (entity->type() == core::Entity::Controlable) {
+ render::gl::color(0, 1, 0, 1); // FIXME allegiance color
} else {
- render::gl::color(1, 1, 1, 1);
+ render::gl::color(1, 1, 1, 1); // FIXME neutral color
}
render::gl::begin(render::gl::LineLoop);
@@ -279,11 +299,14 @@ void draw_entity_target(core::Entity *entity, bool is_active_target)
glVertex3f(cx, cy-r+2, 0);
render::gl::end();
- if (entity->type() == core::Entity::Controlable) {
- render::gl::color(0, 1, 0, 1);
+ if (entity == core::localplayer()->mission_target()) {
+ render::gl::color(1, 0.5f, 1, 1); // FIXME mission color
+ } else if (entity->type() == core::Entity::Controlable) {
+ render::gl::color(0, 1, 0, 1); // FIXME allegiance color
} else {
- render::gl::color(1, 1, 1, 1);
+ render::gl::color(1, 1, 1, 1); // FIXME neutral color
}
+
// outer square0
render::gl::begin(render::gl::LineLoop);
glVertex3f(cx+r, cy, 0);
@@ -391,7 +414,9 @@ void draw_status()
core::Entity *entity = (*it);
if (targets::is_legal_target(entity)) {
- if (entity == targets::current()) {
+ if (entity == core::localplayer()->mission_target()) {
+ draw_entity_target(entity, true);
+ } else if (entity == targets::current()) {
draw_entity_target(entity, true);
} else if (entity->type() == core::Entity::Controlable) {
draw_entity_target(entity, false);
@@ -716,11 +741,20 @@ void frame(float seconds)
render::Stats::clear();
if (core::application()->connected() && core::game()->serverframetime()) {
+
+ if (core::localplayer()->zone() != current_zone) {
+ if (current_zone)
+ clear_zone(current_zone);
+ current_zone = core::localplayer()->zone();
+ }
+
render::draw(seconds); // draw the world
targets::draw(); // validate current target, render sound
if (targets::current()) // draw target docks etc
draw_entity_world_target(targets::current());
+ } else {
+ current_zone = 0;
}
// switch to orthographic projection to draw the GUI