Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/intro')
-rw-r--r--src/game/intro/convoy.cc21
-rw-r--r--src/game/intro/convoy.h7
-rw-r--r--src/game/intro/intro.cc21
-rw-r--r--src/game/intro/intro.h4
4 files changed, 29 insertions, 24 deletions
diff --git a/src/game/intro/convoy.cc b/src/game/intro/convoy.cc
index ac52c38..4a21071 100644
--- a/src/game/intro/convoy.cc
+++ b/src/game/intro/convoy.cc
@@ -1,12 +1,13 @@
/*
intro/convoy.h
- This file is part of the Osirion project and is distributed under
- the terms of the GNU General Public License version 2
+ This file is part of the Osirion project and is distributed under
+ the terms of the GNU General Public License version 2
*/
#include "intro/convoy.h"
-namespace intro {
+namespace intro
+{
/* ---- class Member ----------------------------------------------- */
@@ -34,10 +35,10 @@ void Member::frame(float seconds)
Convoy::Convoy(core::Zone *zone) : core::EntityDynamic()
{
- set_zone(zone);
+ set_zone(zone);
set_label("convoy");
set_name("Convoy");
-
+
entity_speed = 1.0f;
set_serverside();
}
@@ -68,20 +69,20 @@ void Convoy::add(const std::string &model)
member->get_location().assign(location());
d = ((float) convoy_members.size()) * 0.5f;
- member->get_location().get_x() += math::randomf((float) convoy_members.size()) -d;
- member->get_location().get_y() += math::randomf((float) convoy_members.size()) -d;
- member->get_location().get_z() += (math::randomf((float) convoy_members.size()) -d) * 0.5f;
+ member->get_location().get_x() += math::randomf((float) convoy_members.size()) - d;
+ member->get_location().get_y() += math::randomf((float) convoy_members.size()) - d;
+ member->get_location().get_z() += (math::randomf((float) convoy_members.size()) - d) * 0.5f;
member->get_axis().assign(axis());
}
void Convoy::frame(float seconds)
{
- for (Members::iterator it = convoy_members.begin(); it != convoy_members.end(); ) {
+ for (Members::iterator it = convoy_members.begin(); it != convoy_members.end();) {
Member *member = (*it);
if (member->location().length() > 64.0f) {
std::string model(member->model()->name());
- member->die();
+ member->die();
convoy_members.erase(it++);
add(model);
} else {
diff --git a/src/game/intro/convoy.h b/src/game/intro/convoy.h
index 2002164..64204a0 100644
--- a/src/game/intro/convoy.h
+++ b/src/game/intro/convoy.h
@@ -1,7 +1,7 @@
/*
intro/convoy.h
- This file is part of the Osirion project and is distributed under
- the terms of the GNU General Public License version 2
+ This file is part of the Osirion project and is distributed under
+ the terms of the GNU General Public License version 2
*/
#ifndef __INCLUDED_INTRO_CONVOY_H__
@@ -12,7 +12,8 @@
#include "core/entity.h"
#include "math/color.h"
-namespace intro {
+namespace intro
+{
/* ---- class Member ----------------------------------------------- */
diff --git a/src/game/intro/intro.cc b/src/game/intro/intro.cc
index 05dcec7..f2da493 100644
--- a/src/game/intro/intro.cc
+++ b/src/game/intro/intro.cc
@@ -1,7 +1,7 @@
/*
intro/intro.cc
- This file is part of the Osirion project and is distributed under
- the terms of the GNU General Public License version 2
+ This file is part of the Osirion project and is distributed under
+ the terms of the GNU General Public License version 2
*/
#include "intro/intro.h"
@@ -12,7 +12,8 @@
#include "math/color.h"
#include "sys/sys.h"
-namespace intro {
+namespace intro
+{
core::Module *factory()
{
@@ -53,7 +54,7 @@ bool Intro::load_world()
math::Vector3f v;
float f;
bool b;
-
+
while (ini.getline()) {
if (ini.got_section()) {
@@ -63,18 +64,18 @@ bool Intro::load_world()
zone->set_name("Introduction");
zone->set_sky("sky");
core::Zone::add(zone);
-
+
} else if (ini.got_section("convoy")) {
if (zone) {
convoy = new Convoy(zone);
}
-
+
} else if (ini.got_section("globe")) {
if (zone) {
globe = new core::EntityGlobe();
globe->set_zone(zone);
}
-
+
} else {
ini.unknown_section();
}
@@ -84,7 +85,7 @@ bool Intro::load_world()
if (ini.got_key_string("label", strval)) {
zone->set_label(strval);
-
+
} else if (ini.got_key_string("sky", strval)) {
zone->set_sky(strval);
@@ -128,7 +129,9 @@ bool Intro::load_world()
} else if (ini.got_key_float("rotationspeed", globe->entity_rotationspeed)) {
continue;
} else if (ini.got_key_bool("bright", b)) {
- if (b) { globe->set_flag(core::Entity::Bright); }
+ if (b) {
+ globe->set_flag(core::Entity::Bright);
+ }
} else if (ini.got_key()) {
ini.unkown_key();
}
diff --git a/src/game/intro/intro.h b/src/game/intro/intro.h
index d6d8393..7f2e58c 100644
--- a/src/game/intro/intro.h
+++ b/src/game/intro/intro.h
@@ -1,7 +1,7 @@
/*
intro/intro.h
- This file is part of the Osirion project and is distributed under
- the terms of the GNU General Public License version 2
+ This file is part of the Osirion project and is distributed under
+ the terms of the GNU General Public License version 2
*/
#ifndef __INCLUDED_INTRO_H__