[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Enigma-cvs] enigma/src main.cc,1.23,1.24
From: |
Daniel Heck <address@hidden> |
Subject: |
[Enigma-cvs] enigma/src main.cc,1.23,1.24 |
Date: |
Sun, 16 Nov 2003 18:45:36 +0000 |
Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv32438/src
Modified Files:
main.cc
Log Message:
- Call lua::GlobalState(), lua::ShutdownGlobal()
- Adapt to changes in options.hh
Index: main.cc
===================================================================
RCS file: /cvsroot/enigma/enigma/src/main.cc,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** main.cc 20 Oct 2003 16:21:41 -0000 1.23
--- main.cc 16 Nov 2003 18:45:34 -0000 1.24
***************
*** 54,70 ****
{
Application app;
- }
! /* The stream object that is used for logging messages. As defined
! here, it is not connected to any file or buffer.
! (Note: I think writing to a stream without a streambuffer *should*
! be a no-op, but it leads to crashes with g++ 2.95. to circumvent
! this, Log is initialized with a dummy streambuf in init(). )
! */
std::ostream enigma::Log(0);
! /* This is the stream object that is used when logging to a file. In
! this case, enigma::Log uses this object's streambuffer. */
static std::fstream logfile;
--- 54,79 ----
{
Application app;
! bool WizardMode = false;
! bool Nozoom = true;
! //! If true, do not ``grab'' the mouse and keyboard
! bool Nograb = false;
! }
!
! /*!
! * The stream object that is used for logging messages. As defined
! * here, it is not connected to any file or buffer.
! *
! * (Note: I think writing to a stream without a streambuffer *should*
! * be a no-op, but it leads to crashes with g++ 2.95. to circumvent
! * this, Log is initialized with a dummy streambuf in init(). )
! */
std::ostream enigma::Log(0);
! /*!
! * This is the stream object that is used when logging to a file. In
! * this case, enigma::Log uses this object's streambuffer.
! */
static std::fstream logfile;
***************
*** 103,108 ****
def (&show_version, "version");
def (&show_help, "help", 'h');
! def (&options::WizardMode, "wizard");
! def (&options::Nograb, "nograb");
def (&do_log, "log", 'l');
def (&dumpinfo, "dumpinfo");
--- 112,117 ----
def (&show_version, "version");
def (&show_help, "help", 'h');
! def (&WizardMode, "wizard");
! def (&Nograb, "nograb");
def (&do_log, "log", 'l');
def (&dumpinfo, "dumpinfo");
***************
*** 120,125 ****
void on_option (int id, const string ¶m) {
switch (id) {
! case OPT_WINDOW: options::FullScreen=false; break;
! case OPT_ZOOM: options::Nozoom=false; break;
case OPT_GAME: gamename = param; break;
}
--- 129,134 ----
void on_option (int id, const string ¶m) {
switch (id) {
! // case OPT_WINDOW: options::FullScreen=false; break;
! case OPT_ZOOM: enigma::Nozoom=false; break;
case OPT_GAME: gamename = param; break;
}
***************
*** 141,148 ****
enigma::Log.rdbuf(::nullbuffer);
! lua::Init();
// Run initialization scripts
! if (lua::Dofile("startup.lua") != 0) {
fprintf(stderr, "There was an error loading 'startup.lua'.\n");
fprintf(stderr, "Your installation may be incomplete or invalid.\n");
--- 150,157 ----
enigma::Log.rdbuf(::nullbuffer);
! lua_State *L = lua::GlobalState();
// Run initialization scripts
! if (lua::Dofile(L, "startup.lua") != 0) {
fprintf(stderr, "There was an error loading 'startup.lua'.\n");
fprintf(stderr, "Your installation may be incomplete or invalid.\n");
***************
*** 150,156 ****
}
- lua::Dofile("levels/index.lua");
- lua::DoSubfolderfile("levels", "index.lua");
-
// Load preferences
if (!options::Load()) {
--- 159,162 ----
***************
*** 158,161 ****
--- 164,170 ----
}
+ lua::Dofile(L, "levels/index.lua");
+ lua::DoSubfolderfile(L, "levels", "index.lua");
+
// Evaluate command line arguments.
AP ap;
***************
*** 206,210 ****
oxyd::Init();
! oxyd::ChangeSoundset(options::SoundSet, 1);
}
--- 215,219 ----
oxyd::Init();
! oxyd::ChangeSoundset(options::GetInt("SoundSet"), 1);
}
***************
*** 216,219 ****
--- 225,229 ----
sound::Shutdown();
options::Save();
+ lua::ShutdownGlobal();
delete_sequence(enigma::LevelPacks.begin(),
enigma::LevelPacks.end());
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Enigma-cvs] enigma/src main.cc,1.23,1.24,
Daniel Heck <address@hidden> <=