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-02-09 17:48:16 +0000
committerStijn Buys <ingar@osirion.org>2008-02-09 17:48:16 +0000
commit48aa068b036f565d6b94d4207242066ba655afe4 (patch)
tree4b68cf169c7fcd4bc6f2eecc7c072830d91830f8 /src/client/console.cc
parent23aee34002facf39b56d209320817375db3b6189 (diff)
entities, step 1
Diffstat (limited to 'src/client/console.cc')
-rw-r--r--src/client/console.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/client/console.cc b/src/client/console.cc
index 01f90da..1c2ab1e 100644
--- a/src/client/console.cc
+++ b/src/client/console.cc
@@ -58,9 +58,13 @@ size_t console_scroll = 0;
//--- engine functions --------------------------------------------
-extern "C" void func_con_toggle(std::stringstream &args)
+void func_con_toggle(std::stringstream &args)
{
- console_visible = !console_visible;
+ int i;
+ if (args >> i) {
+ if (i) console_visible = true; else console_visible = false;
+ } else
+ console_visible = !console_visible;
}
//--- public ------------------------------------------------------
@@ -215,6 +219,7 @@ void keypressed(const SDL_keysym &keysym)
}
core::cmd << (*history_pos) << std::endl;
+ (*history.rbegin()) = (*history_pos);
history.push_back("");
history_pos = history.rbegin();
@@ -242,7 +247,7 @@ void keypressed(const SDL_keysym &keysym)
input_pos = 0;
break;
case SDLK_KP1:
- case SDLK_END:
+ case SDLK_END:
input_pos = (*history_pos).size();
break;
case SDLK_KP4:
@@ -256,7 +261,7 @@ void keypressed(const SDL_keysym &keysym)
input_pos++;
break;
case SDLK_BACKSPACE:
- if ((*history_pos).size() && input_pos) {
+ if ((*history.rbegin()).size() && input_pos) {
(*history_pos).erase(input_pos-1, 1);
input_pos--;
}