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-29 18:01:35 +0000
committerStijn Buys <ingar@osirion.org>2008-09-29 18:01:35 +0000
commit381c729e777b50771626703e60b422aafc791513 (patch)
tree856b9467dda75daaa1d78f6dce9dfb746dc338ce /src/client/view.cc
parent5b64ecbd39307d17acd8815187f6cd211c384029 (diff)
adds introduction screen to the client
Diffstat (limited to 'src/client/view.cc')
-rw-r--r--src/client/view.cc48
1 files changed, 45 insertions, 3 deletions
diff --git a/src/client/view.cc b/src/client/view.cc
index bbf9088..03ce42b 100644
--- a/src/client/view.cc
+++ b/src/client/view.cc
@@ -84,6 +84,11 @@ void shutdown()
void clear_zone(core::Zone *zone)
{
+ if (!zone) {
+ current_zone = 0;
+ return;
+ }
+
for (core::Zone::Content::iterator it = zone->content().begin(); it != zone->content().end(); it++) {
core:: Entity *entity = (*it);
@@ -125,6 +130,28 @@ void draw_loader()
gl::end();
}
+void draw_banner()
+{
+ using namespace render;
+
+ render::Textures::bind("bitmaps/banner");
+
+ gl::begin(gl::Quads);
+
+ glTexCoord2f(0.0f, 0.0f);
+ gl::vertex(0,0, 0);
+
+ glTexCoord2f(1.0f, 0.0f);
+ gl::vertex(video::width,0,0);
+
+ glTexCoord2f(1.0f, 1.0f);
+ gl::vertex(video::width,video::height,0);
+
+ glTexCoord2f(0.0f, 1.0f);
+ gl::vertex(0,video::height,0);
+
+ gl::end();
+}
/*
FIXME should be merged with the render passes
@@ -349,7 +376,7 @@ void draw_status()
std::stringstream status;
- if (core::game()) {
+ if (core::game() && core::game()->interactive()) {
int minutes = (int) floorf(core::game()->clientframetime() / 60.0f);
int seconds = (int) floorf( core::game()->clientframetime() - (float) minutes* 60.0f);
@@ -740,6 +767,16 @@ void frame(float seconds)
render::Stats::clear();
+ // load the intro
+ if (!core::application()->connected()) {
+ if (core::application()->load("intro")) {
+ current_zone = 0;
+ core::application()->connect("");
+ if (!console()->visible())
+ console()->toggle();
+ }
+ }
+
if (core::application()->connected() && core::game()->serverframetime()) {
if (core::localplayer()->zone() != current_zone) {
@@ -754,6 +791,8 @@ void frame(float seconds)
if (targets::current()) // draw target docks etc
draw_entity_world_target(targets::current());
} else {
+ // FIXME this should be handle through a module_disconnect signal
+ // this should to the same as calling clear_zone(0)
current_zone = 0;
}
@@ -765,6 +804,7 @@ void frame(float seconds)
gl::matrixmode(GL_MODELVIEW);
gl::loadidentity();
+ gl::enable(GL_BLEND);
gl::enable(GL_TEXTURE_2D);
gl::color(1.0f, 1.0f, 1.0f, 1.0f);
@@ -776,9 +816,11 @@ void frame(float seconds)
// force console on if not connected
if (!console()->visible())
console()->toggle();
- }
- gl::enable(GL_BLEND);
+ } else if (!core::game()->interactive()) {
+ // draw the banner bitmap
+ draw_banner();
+ }
// draw text elements
if (draw_ui->value()) {