Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/client.cc4
-rw-r--r--src/client/video.cc27
-rw-r--r--src/client/video.h3
-rw-r--r--src/client/view.cc4
4 files changed, 29 insertions, 9 deletions
diff --git a/src/client/client.cc b/src/client/client.cc
index edec13c..bb6fb55 100644
--- a/src/client/client.cc
+++ b/src/client/client.cc
@@ -252,6 +252,8 @@ void Client::notify_connect()
view()->notify()->clear();
view()->chat()->clear();
ui::root()->hide_menu();
+
+ video::set_caption();
}
void Client::notify_disconnect()
@@ -262,6 +264,8 @@ void Client::notify_disconnect()
view()->notify()->clear();
view()->chat()->clear();
+
+ video::set_caption();
}
void Client::notify_zonechange()
diff --git a/src/client/video.cc b/src/client/video.cc
index 53e5dbc..1db1ba4 100644
--- a/src/client/video.cc
+++ b/src/client/video.cc
@@ -10,6 +10,7 @@
#include "client/client.h"
#include "render/render.h"
#include "core/core.h"
+#include "core/gameserver.h"
#include "filesystem/filesystem.h"
#include "sys/sys.h"
#include "ui/ui.h"
@@ -133,20 +134,17 @@ bool init()
#endif // HAVE_DEBUG_MESSAGES
+ // set window caption
+ set_caption();
+
// save r_width and r_height variables
(*r_width) = width;
(*r_height) = height;
- // set window caption
- std::string version(core::name());
- version += ' ';
- version.append(core::version());
- SDL_WM_SetCaption(version.c_str(), 0);
-
// resize user interface
ui::root()->set_size((float) width, (float) height);
ui::root()->event_resize();
-
+
// to grab or not to grab
if (ui::console()->visible()) {
SDL_WM_GrabInput(SDL_GRAB_OFF);
@@ -158,12 +156,27 @@ bool init()
// initialize renderer
render::init(width, height);
+
+ // apply render options
+ ui::root()->apply_render_options();
view::init();
return true;
}
+void set_caption()
+{
+ // set window caption
+ std::string version;
+ if (core::server() && core::server()->module()) {
+ version.assign(core::server()->module()->name());
+ } else {
+ version.assign(core::name() + ' ' + core::version());
+ }
+ SDL_WM_SetCaption(version.c_str(), 0);
+}
+
void resize(int w, int h)
{
if (fullscreen)
diff --git a/src/client/video.h b/src/client/video.h
index 7a8d386..833ebc4 100644
--- a/src/client/video.h
+++ b/src/client/video.h
@@ -30,6 +30,9 @@ namespace video
/// draw the next client video frame
void frame(float elapsed);
+ /// set the window caption
+ void set_caption();
+
} // namespace video
} // namespace client
diff --git a/src/client/view.cc b/src/client/view.cc
index 1c35708..1c1b108 100644
--- a/src/client/view.cc
+++ b/src/client/view.cc
@@ -418,7 +418,7 @@ void draw_entity_offscreen_target(core::Entity *entity, bool is_active_target)
gl::end();
if (entity == core::localplayer()->mission_target()) {
- gl::color(1, 0.5f, 1, 1); // FIXME mission color
+ gl::color(ui::root()->palette()->mission());
} else if (entity->type() == core::Entity::Controlable) {
gl::color(0, 1, 0, 1); // FIXME allegiance color
} else {
@@ -488,7 +488,7 @@ void draw_entity_target(core::Entity *entity, bool is_active_target)
}
if (entity == core::localplayer()->mission_target()) {
- gl::color(1, 0.5f, 1, 1); // FIXME mission color
+ gl::color(ui::root()->palette()->mission());
} else if (entity->type() == core::Entity::Controlable) {
gl::color(0, 1, 0, 1); // FIXME allegiance color
} else {