From 8587b087d9c686dd4a35a4f90c56856249f704e6 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 27 Dec 2004 18:46:43 +0000 Subject: A few minor changes... --- Dalos/Dalos.cc | 9 ++++++--- MSVC/Baltisot - generic/Baltisot - generic.vcproj | 4 ++-- MSVC/Dalos/Dalos.vcproj | 10 ++++++++++ cd-tool.cpp | 11 ++++++----- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Dalos/Dalos.cc b/Dalos/Dalos.cc index 6ab2153..bbfdadf 100644 --- a/Dalos/Dalos.cc +++ b/Dalos/Dalos.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: Dalos.cc,v 1.12 2004-12-26 03:29:10 pixel Exp $ */ +/* $Id: Dalos.cc,v 1.13 2004-12-27 18:46:43 pixel Exp $ */ #include #include @@ -48,6 +48,8 @@ #define main SDL_main #endif + +// all these global variables are ugly... bool auto_exec = true; bool lua_started = false; bool do_lua_break = false; @@ -196,7 +198,7 @@ class myprinter : public printer_t { SDL_mutexP(lock); - vsprintf(buffer, m, ap); + vsnprintf(buffer, 20479, m, ap); if (level >= 0) CurrentConsole->add_line("(" + heads[level] + ") " + buffer); else @@ -322,7 +324,8 @@ virtual int startup() throw (GeneralException) { CurrentConsole = new console(sh, Root, 0, 8); console::create_console_thread(); CurrentConsole->move(0, Root->GetH() - CurrentConsole->GetH()); - CurrentConsole->add_line("Dalos v0.1 - LUA console"); + CurrentConsole->add_line("Dalos v0.1 - LUA console - Press ESC to show/hide it."); + CurrentConsole->SetVisible(true); printer = new myprinter(); locker = new threaded_locker(); diff --git a/MSVC/Baltisot - generic/Baltisot - generic.vcproj b/MSVC/Baltisot - generic/Baltisot - generic.vcproj index 11afd5e..eef7467 100644 --- a/MSVC/Baltisot - generic/Baltisot - generic.vcproj +++ b/MSVC/Baltisot - generic/Baltisot - generic.vcproj @@ -40,7 +40,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="..\..\generic\include;..\..\generic\lib\zlib\include;..\..\generic\lib\lua\includes;..\..\generic\lib\lua\include;..\dirent;..\regex" - PreprocessorDefinitions="_WINDOWS;ZLIB_DLL;READLINE_STATIC;READLINE_LIBRARY;STDC_HEADERS" + PreprocessorDefinitions="_WINDOWS;ZLIB_DLL;READLINE_STATIC;READLINE_LIBRARY;STDC_HEADERS;STDC" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -107,7 +107,7 @@ InlineFunctionExpansion="1" OmitFramePointers="TRUE" AdditionalIncludeDirectories="..\..\generic\include;..\..\generic\lib\zlib\include;..\..\generic\lib\lua\includes;..\..\generic\lib\lua\include;..\dirent;..\regex" - PreprocessorDefinitions="_WINDOWS;ZLIB_DLL;READLINE_STATIC;READLINE_LIBRARY;STDC_HEADERS" + PreprocessorDefinitions="_WINDOWS;ZLIB_DLL;READLINE_STATIC;READLINE_LIBRARY;STDC_HEADERS;STDC" StringPooling="TRUE" RuntimeLibrary="0" EnableFunctionLevelLinking="TRUE" diff --git a/MSVC/Dalos/Dalos.vcproj b/MSVC/Dalos/Dalos.vcproj index 57186c5..8cfc241 100644 --- a/MSVC/Dalos/Dalos.vcproj +++ b/MSVC/Dalos/Dalos.vcproj @@ -189,5 +189,15 @@ RelativePath="..\..\Dalos\Dalos.cc" > + + + + + + diff --git a/cd-tool.cpp b/cd-tool.cpp index 85f4a8a..3774168 100644 --- a/cd-tool.cpp +++ b/cd-tool.cpp @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: cd-tool.cpp,v 1.38 2004-12-21 11:14:16 pixel Exp $ */ +/* $Id: cd-tool.cpp,v 1.39 2004-12-27 18:46:44 pixel Exp $ */ #define WIP @@ -279,10 +279,11 @@ int sLua_cdtool::cdtool_proceed_statics(Lua * L, int n, int caller) { case CDTOOL_PRINT: eol = "\n"; case CDTOOL_PRINTN: - if (n) - p = L->tostring(1) + eol; - else + if (n) { + p = L->tostring(1) + eol; + } else { p = eol; + } tc = p.strdup(); printm(M_BARE, "%s", tc); free(tc); @@ -567,7 +568,6 @@ virtual int startup() throw (GeneralException) { } catch (GeneralException e) { printm(M_WARNING, "There was an error loading built-in cd-tool.lua: %s\n", e.GetMsg()); - builtin = true; } } @@ -676,6 +676,7 @@ virtual int startup() throw (GeneralException) { /* If there was an error, ignore it, and free the stack */ while(L->gettop()) L->pop(); + printm(M_ERROR, "%s\n", e.GetMsg()); } catch (GeneralException e) { /* A more severe exception... */ -- cgit v1.2.3