From cf676c6c981d98535e25b2cdcb2768d5f2fac67d Mon Sep 17 00:00:00 2001 From: pixel Date: Sun, 26 Dec 2004 02:45:55 +0000 Subject: Fixing the Dalos/Console split (and also a dos2unix it seems...) --- Dalos/Console.cc | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'Dalos/Console.cc') 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 #include @@ -31,6 +31,8 @@ #include +#include + #include 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); } -- cgit v1.2.3