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-07-15 00:16:45 +0000
committerStijn Buys <ingar@osirion.org>2008-07-15 00:16:45 +0000
commit84d6f8c6a58c2b0e94a6137b4a055a4e32d29457 (patch)
treeaa39a09291cf7bbcc21287c44cc895192233da4d
parentbb73e3aaa036fb4450e98c715e80a6e8d9f2714d (diff)
various small fixes
-rw-r--r--osirion.kdevelop.pcsbin777319 -> 777319 bytes
-rw-r--r--osirion.kdevses5
-rw-r--r--src/client/input.cc23
-rw-r--r--src/client/view.cc20
-rw-r--r--src/core/gameserver.cc2
5 files changed, 27 insertions, 23 deletions
diff --git a/osirion.kdevelop.pcs b/osirion.kdevelop.pcs
index 13a5ee6..9d49317 100644
--- a/osirion.kdevelop.pcs
+++ b/osirion.kdevelop.pcs
Binary files differ
diff --git a/osirion.kdevses b/osirion.kdevses
index 137b3f6..650010c 100644
--- a/osirion.kdevses
+++ b/osirion.kdevses
@@ -1,7 +1,7 @@
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE KDevPrjSession>
<KDevPrjSession>
- <DocsAndViews NumberOfDocuments="3" >
+ <DocsAndViews NumberOfDocuments="4" >
<Doc0 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/render/draw.cc" >
<View0 Encoding="" line="786" Type="Source" />
</Doc0>
@@ -11,6 +11,9 @@
<Doc2 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/render/camera.cc" >
<View0 Encoding="" line="267" Type="Source" />
</Doc2>
+ <Doc3 NumberOfViews="1" URL="file:///home/ingar/projects/osirion/osirion-work/src/client/input.cc" >
+ <View0 Encoding="" line="235" Type="Source" />
+ </Doc3>
</DocsAndViews>
<pluginList>
<kdevdebugger>
diff --git a/src/client/input.cc b/src/client/input.cc
index 1b895b7..10be405 100644
--- a/src/client/input.cc
+++ b/src/client/input.cc
@@ -56,6 +56,9 @@ bool mouse_control = false;
const float thruster_offset = 0.05f;
+// small hack to prevent two sounds triggered by the scrollwheel
+bool singleclick = true;
+
//--- engine functions --------------------------------------------
void func_screenshot(std::string const & args)
@@ -232,14 +235,18 @@ void action_press(std::string const &action)
{
/* -- thruster ------------------------------------ */
if (action.compare("+thrust") == 0) {
- if (local_thrust < 1.0f)
+ if (local_thrust < 1.0f && singleclick) {
audio::play("ui/thruster");
+ singleclick = false;
+ }
local_thrust += thruster_offset;
} else if (action.compare("-thrust") == 0) {
- if (local_thrust > 0.0f)
+ if (local_thrust > 0.0f && singleclick) {
audio::play("ui/thruster");
+ singleclick = false;
+ }
local_thrust -= 2.0f * thruster_offset;
/* -- mouse control ------------------------------- */
@@ -355,6 +362,7 @@ void frame(float seconds)
SDL_Event event;
Key *key = 0;
bool pressed = false;
+ singleclick = true;
while (SDL_PollEvent(&event)) {
pressed = false;
@@ -400,7 +408,7 @@ void frame(float seconds)
if (keysym.mod & KMOD_CAPS) capslock = true; else capslock = false;
if ((keysym.mod & KMOD_LSHIFT) || (keysym.mod & KMOD_RSHIFT)) capslock != capslock;
*/
- // FIXME screenshot and console are always captured
+ // console key is always captured
if (key->bind().compare("ui_console") == 0) {
console()->toggle();
local_direction = 0.0f;
@@ -410,16 +418,13 @@ void frame(float seconds)
render::Camera::set_direction(0.0f);
render::Camera::set_pitch(0.0f);
- } else if (key->bind().compare("screenshot") == 0) {
- video::screenshot();
-
} else if (console()->visible()) {
- // FIXME send key events to the console
+ // send key events to the console
if (event.type == SDL_KEYDOWN)
console()->keypressed(translate_keysym(event.key.keysym));
} else if (chat::visible()) {
- // FIXME send key events to the chat box
+ // send key events to the chat box
if (event.type == SDL_KEYDOWN)
chat::keypressed(translate_keysym(event.key.keysym));
@@ -445,7 +450,7 @@ void frame(float seconds)
} else {
- if (core::application()->connected() && core::localcontrol()) {
+ if (core::application()->connected() && core::localcontrol() && !console()->visible() && !chat::visible()) {
char c = key->bind().c_str()[0];
if (c == '+' || c == '-') {
diff --git a/src/client/view.cc b/src/client/view.cc
index fa96096..2bbae15 100644
--- a/src/client/view.cc
+++ b/src/client/view.cc
@@ -146,9 +146,6 @@ void draw_status()
{
using namespace render;
- if (console()->visible())
- return;
-
// print the status in the upper left corner
std::stringstream status;
@@ -267,8 +264,6 @@ void draw_cursor()
}
-
-
gl::color(color);
gl::begin(gl::Quads);
@@ -305,6 +300,9 @@ void frame(float seconds)
if (core::application()->connected() && core::game()->serverframetime()) {
render::draw(seconds); // draw the world
+ if (draw_radar->value()) {
+ Radar::draw();
+ }
}
// switch to ortographic projection to draw the GUI
@@ -323,14 +321,6 @@ void frame(float seconds)
}
// draw text elements
- Text::setfont("bitmaps/fonts/console", 12, 18);
- console()->draw();
- chat::draw();
-
- if (draw_radar->value()) {
- Radar::draw();
- }
-
if (draw_ui->value()) {
Text::setfont("bitmaps/fonts/gui", 16, 24);
draw_status();
@@ -338,6 +328,10 @@ void frame(float seconds)
// draw the mouse cursor
draw_cursor();
}
+
+ Text::setfont("bitmaps/fonts/console", 12, 18);
+ chat::draw();
+ console()->draw();
gl::disable(GL_TEXTURE_2D);
}
diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc
index 4172d4f..0a2370c 100644
--- a/src/core/gameserver.cc
+++ b/src/core/gameserver.cc
@@ -195,6 +195,8 @@ GameServer::~GameServer()
delete server_module;
}
+ Func::remove("kick");
+
Func::remove("mute");
Func::remove("unmute");