summaryrefslogtreecommitdiff
path: root/Dalos/Console.cc
diff options
context:
space:
mode:
authorpixel <pixel>2004-12-26 02:45:55 +0000
committerpixel <pixel>2004-12-26 02:45:55 +0000
commitcf676c6c981d98535e25b2cdcb2768d5f2fac67d (patch)
tree5d3708a62f7bcf0c06d42aabc410d23072e6a1f9 /Dalos/Console.cc
parent58297e1342fe5ff3446597e9ce6eef494f3a4b2f (diff)
Fixing the Dalos/Console split (and also a dos2unix it seems...)
Diffstat (limited to 'Dalos/Console.cc')
-rw-r--r--Dalos/Console.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/Dalos/Console.cc b/Dalos/Console.cc
index 1cc2b08..f4d914b 100644
--- a/Dalos/Console.cc
+++ b/Dalos/Console.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: Console.cc,v 1.2 2004-11-27 21:47:23 pixel Exp $ */
+/* $Id: Console.cc,v 1.3 2004-12-26 02:45:55 pixel Exp $ */
#include <SDL.h>
#include <SDL_thread.h>
@@ -31,6 +31,8 @@
#include <glshape.h>
+#include <font.h>
+
#include <Console.h>
SDL_mutex * console_lock;
@@ -93,9 +95,9 @@ class ReadLineInternals : public Base {
if (runit) {
SDL_SemPost(console_sem);
- prompt = "> ";
+ console_prompt = "> ";
} else {
- prompt = "- ";
+ console_prompt = "- ";
}
line = endline.trim();
}
@@ -127,12 +129,12 @@ class ReadLineInternals : public Base {
}
};
-virtual void console_keyevent::down(SDL_keysym k) {
- if (Application->Console->GetVisible()) {
+void console_keyevent::down(SDL_keysym k) {
+ if (CurrentConsole->GetVisible()) {
SDL_mutexP(key_vect_mutex);
switch (k.sym) {
case SDLK_ESCAPE:
- Application->Console->SetVisible(false);
+ CurrentConsole->SetVisible(false);
SDL_mutexV(key_vect_mutex);
return;
case SDLK_DELETE:
@@ -157,11 +159,11 @@ virtual void console_keyevent::down(SDL_keysym k) {
key_vect.push_back('E' - '@');
break;
case SDLK_PAGEUP:
- Application->Console->page_up();
+ CurrentConsole->page_up();
SDL_mutexV(key_vect_mutex);
return;
case SDLK_PAGEDOWN:
- Application->Console->page_down();
+ CurrentConsole->page_down();
SDL_mutexV(key_vect_mutex);
return;
case SDLK_c:
@@ -292,7 +294,7 @@ void console::draw() {
mogltk::ColorP::Max.A = 255;
mogltk::FixedFont->putcursor(GetAX(), GetAY() + (nlines - 1) * 13);
- mogltk::FixedFont->printf(prompt);
+ mogltk::FixedFont->printf(console_prompt);
mogltk::FixedFont->printf("%s", rl_line_buffer + start);
}
}
@@ -301,9 +303,9 @@ bool console::process_event(int mx, int my, mogltk::event_t event) {
return false;
}
-void create_console_thread {
+void console::create_console_thread() {
key_vect_mutex = SDL_CreateMutex();
key_vect_size = SDL_CreateSemaphore(0);
- SDL_CreateThread(readline_thread, 0);
+ SDL_CreateThread(ReadLineInternals::readline_thread, 0);
}