[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Adonthell-commits] CVS: adonthell/src Makefile.am,1.89,1.90 adonthell.c
From: |
Kai Sterker <address@hidden> |
Subject: |
[Adonthell-commits] CVS: adonthell/src Makefile.am,1.89,1.90 adonthell.cc,1.6,1.7 adonthell.h,1.3,1.4 fileops.cc,1.8,1.9 gamedata.cc,1.18,1.19 gamedata.h,1.11,1.12 image.cc,1.11,1.12 lex.prefs.cc,1.12,1.13 main.cc,1.46,1.47 prefs.cc,1.20,1.21 prefs.h,1.14,1.15 prefs.l,1.10,1.11 |
Date: |
Sun, 26 May 2002 05:27:30 -0400 |
Update of /cvsroot/adonthell/adonthell/src
In directory subversions:/tmp/cvs-serv16386/src
Modified Files:
Makefile.am adonthell.cc adonthell.h fileops.cc gamedata.cc
gamedata.h image.cc lex.prefs.cc main.cc prefs.cc prefs.h
prefs.l
Log Message:
ADDED quick-load feature
Index: Makefile.am
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/Makefile.am,v
retrieving revision 1.89
retrieving revision 1.90
diff -C2 -r1.89 -r1.90
*** Makefile.am 29 Apr 2002 15:57:35 -0000 1.89
--- Makefile.am 26 May 2002 09:27:27 -0000 1.90
***************
*** 48,52 ****
# Note: adonthell.py is also built by this target.
! py_adonthell_wrap.cc : py_adonthell.i
@if test "${P_SWIG}"; then \
${P_SWIG} -python -shadow ${SDL_CFLAGS} -I./ -I../ -c++
-make_default -o $*.cc py_adonthell.i; \
--- 48,52 ----
# Note: adonthell.py is also built by this target.
! py_adonthell_wrap.cc : py_adonthell.i *.h
@if test "${P_SWIG}"; then \
${P_SWIG} -python -shadow ${SDL_CFLAGS} -I./ -I../ -c++
-make_default -o $*.cc py_adonthell.i; \
Index: adonthell.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/adonthell.cc,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** adonthell.cc 25 Apr 2002 15:34:11 -0000 1.6
--- adonthell.cc 26 May 2002 09:27:27 -0000 1.7
***************
*** 45,50 ****
{
win_manager mgr;
! mgr.add (wnd /*, name */);
! mgr.set_focus (wnd);
while (letsexit == false)
--- 45,60 ----
{
win_manager mgr;
!
! if (wnd != NULL)
! {
! mgr.add (wnd /*, name */);
! mgr.set_focus (wnd);
! }
! else
! {
! mapview_start ();
! set_control_active (true);
! fade_in ();
! }
while (letsexit == false)
Index: adonthell.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/adonthell.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** adonthell.h 30 Dec 2001 12:11:40 -0000 1.3
--- adonthell.h 26 May 2002 09:27:27 -0000 1.4
***************
*** 68,72 ****
* @param name A name for that window (currently unused)
*/
! void main (win_base *wnd, const string name);
/**
--- 68,72 ----
* @param name A name for that window (currently unused)
*/
! void main (win_base *wnd = NULL, const string name = "");
/**
Index: fileops.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/fileops.cc,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** fileops.cc 29 Apr 2002 15:57:35 -0000 1.8
--- fileops.cc 26 May 2002 09:27:27 -0000 1.9
***************
*** 2,6 ****
$Id$
! Copyright (C) 1999 - 2001 The Adonthell Team
Part of the Adonthell Project http://adonthell.linuxgames.com
--- 2,6 ----
$Id$
! Copyright (C) 1999/2000/2001/2002 Alexandre Courbot
Part of the Adonthell Project http://adonthell.linuxgames.com
Index: gamedata.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gamedata.cc,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** gamedata.cc 25 Apr 2002 19:30:08 -0000 1.18
--- gamedata.cc 26 May 2002 09:27:27 -0000 1.19
***************
*** 26,29 ****
--- 26,30 ----
#include <iostream>
#include <cstdio>
+ #include <time.h>
#include <unistd.h>
#include <dirent.h>
***************
*** 40,50 ****
#define CHAR_DAT_VER 4
#define QUEST_DAT_VER 1
! #define SAVE_DAT_VER 2
!
! vector<gamedata*> gamedata::saves; // The list of available savegames
! string gamedata::user_data_dir_; // The user's private adonthell
directory
! string gamedata::game_data_dir_; // The adonthell data directory
! string gamedata::game_name; // The adonthell data directory
using namespace std;
--- 41,51 ----
#define CHAR_DAT_VER 4
#define QUEST_DAT_VER 1
! #define SAVE_DAT_VER 3
+ vector<gamedata*> gamedata::saves; // The list of available savegames
+ string gamedata::user_data_dir_; // The user's private adonthell
directory
+ string gamedata::game_data_dir_; // The adonthell data directory
+ string gamedata::game_name; // The adonthell data directory
+ u_int8 gamedata::quick_load; // Whether Quick-load is active or not
using namespace std;
***************
*** 57,62 ****
gamedata::gamedata (string dir, string desc)
{
! directory_ = dir;
! description_ = desc;
}
--- 58,64 ----
gamedata::gamedata (string dir, string desc)
{
! Timestamp = 0;
! Directory = dir;
! Description = desc;
}
***************
*** 69,76 ****
if (!fileops::get_version (file, SAVE_DAT_VER, SAVE_DAT_VER, "save.data"))
return false;
! directory_ << file;
! description_ << file;
! location_ << file;
! time_ << file;
return true;
}
--- 71,80 ----
if (!fileops::get_version (file, SAVE_DAT_VER, SAVE_DAT_VER, "save.data"))
return false;
!
! Timestamp << file;
! Description << file;
! Location << file;
! Gametime << file;
!
return true;
}
***************
*** 79,96 ****
{
fileops::put_version (file, SAVE_DAT_VER);
! directory_ >> file;
! description_ >> file;
! location_ >> file;
! time_ >> file;
}
void gamedata::set_description (string desc)
{
! description_ = desc;
}
void gamedata::set_directory (string dir)
{
! directory_ = dir;
}
--- 83,104 ----
{
fileops::put_version (file, SAVE_DAT_VER);
!
! // get current time for Quick-Loading
! Timestamp = time (NULL);
!
! Timestamp >> file;
! Description >> file;
! Location >> file;
! Gametime >> file;
}
void gamedata::set_description (string desc)
{
! Description = desc;
}
void gamedata::set_directory (string dir)
{
! Directory = dir;
}
***************
*** 249,252 ****
--- 257,283 ----
}
+ bool gamedata::load_newest ()
+ {
+ // Quick-load off / no save game available
+ if (!quick_load || saves.size () <= 1) return false;
+
+ u_int32 timestamp = 0;
+ u_int32 index = 0;
+ u_int32 newest;
+
+ for (vector<gamedata*>::iterator i = saves.begin (); i != saves.end ();
i++)
+ {
+ if ((*i)->timestamp () > timestamp)
+ {
+ timestamp = (*i)->timestamp ();
+ newest = index;
+ }
+
+ index++;
+ }
+
+ return load (newest);
+ }
+
bool gamedata::save (u_int32 pos, string desc)
{
***************
*** 269,273 ****
{
// that's the directory we're going to save to
! sprintf(t,"%03i",pos++);
filepath = user_data_dir ();
filepath += "/" + game_name + "-save-";
--- 300,304 ----
{
// that's the directory we're going to save to
! sprintf(t, "%03i", pos++);
filepath = user_data_dir ();
filepath += "/" + game_name + "-save-";
***************
*** 436,440 ****
! bool gamedata::init (string udir, string gdir, string gname)
{
DIR *dir;
--- 467,471 ----
! bool gamedata::init (string udir, string gdir, string gname, u_int8 qload)
{
DIR *dir;
***************
*** 447,450 ****
--- 478,482 ----
game_data_dir_ = gdir;
game_name = gname;
+ quick_load = qload;
// try to change into data directory
Index: gamedata.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/gamedata.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** gamedata.h 31 Dec 2001 16:55:46 -0000 1.11
--- gamedata.h 26 May 2002 09:27:27 -0000 1.12
***************
*** 2,6 ****
$Id$
! Copyright (C) 2001 by Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
--- 2,6 ----
$Id$
! Copyright (C) 2001/2002 by Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
***************
*** 103,135 ****
* Returns the directory where the saved %game lies.
*
- *
* @return Directory where the saved %game lies.
*/
! const char* directory () { return directory_.c_str (); }
/**
* Returns the description of the saved %game.
- *
*
* @return Description of the saved %game.
*/
! const char* description () { return description_.c_str (); }
/**
* Returns the location of the saved %game.
*
- *
* @return Location of the saved %game.
*/
! const char* location () { return location_.c_str (); }
/**
! * Returns the time of the saved %game.
! *
*
! * @return Time of the saved %game.
*/
! const char* time () { return time_.c_str (); }
/**
* Sets the description for this %game.
--- 103,138 ----
* Returns the directory where the saved %game lies.
*
* @return Directory where the saved %game lies.
*/
! const char* directory () { return Directory.c_str (); }
/**
* Returns the description of the saved %game.
*
* @return Description of the saved %game.
*/
! const char* description () { return Description.c_str (); }
/**
* Returns the location of the saved %game.
*
* @return Location of the saved %game.
*/
! const char* location () { return Location.c_str (); }
/**
! * Returns the in-game time of the saved %game.
*
! * @return In-game time of the saved %game.
*/
! const char* gametime () { return Gametime.c_str (); }
+ /**
+ * Returns the (real) time when this game has been saved
+ *
+ * @return (Real) time when this game has been saved
+ */
+ u_int32 timestamp () { return Timestamp; }
+
/**
* Sets the description for this %game.
***************
*** 155,162 ****
* @param gdir The %game data directory, usually
/usr/local/share/adonthell
* @param gname The name of the %game we are running, e.g. wastesedge
*
* @return \e true in case of success, false otherwise.
*/
! static bool init (string udir, string gdir, string gname);
/**
--- 158,166 ----
* @param gdir The %game data directory, usually
/usr/local/share/adonthell
* @param gname The name of the %game we are running, e.g. wastesedge
+ * @param qload Whether quick-loading should be enabled or disabled
*
* @return \e true in case of success, false otherwise.
*/
! static bool init (string udir, string gdir, string gname, u_int8 qload);
/**
***************
*** 214,217 ****
--- 218,230 ----
/**
+ * Loads the most recent saved %game. This method only takes
+ * games created by the player into account, not the initial
+ * saved %game.
+ *
+ * @return \e true in case of success, \e false otherwise.
+ */
+ static bool load_newest ();
+
+ /**
* Save a %game. When given a slot number in the range of
* the available saved games, the according %game will be
***************
*** 347,356 ****
private:
#ifndef SWIG
! string directory_; // the game's location on the
harddisk
! string description_; // user supplied description of
the game
! string location_; // the map or area the player
is on
! string time_; // the gametime of the save
static string game_name;
/**
--- 360,371 ----
private:
#ifndef SWIG
! string Directory; // the game's location on the harddisk
! string Description; // user supplied description of the game
! string Location; // the map or area the player is on
! string Gametime; // the gametime of the saved game
! u_int32 Timestamp; // time of last save to this file
static string game_name;
+ static u_int8 quick_load;
/**
***************
*** 370,374 ****
*
*/
! static string game_data_dir_;
#endif
};
--- 385,389 ----
*
*/
! static string game_data_dir_;
#endif
};
Index: image.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/image.cc,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** image.cc 27 Apr 2002 17:00:19 -0000 1.11
--- image.cc 26 May 2002 09:27:27 -0000 1.12
***************
*** 2,6 ****
$Id$
! Copyright (C) 1999/2000/2001 Alexandre Courbot
Part of the Adonthell Project http://adonthell.linuxgames.com
--- 2,6 ----
$Id$
! Copyright (C) 1999/2000/2001/2002 Alexandre Courbot
Part of the Adonthell Project http://adonthell.linuxgames.com
***************
*** 22,29 ****
*
*/
!
#include "image.h"
#include "pnm.h"
using namespace std;
--- 22,41 ----
*
*/
!
! #include <SDL/SDL_endian.h>
#include "image.h"
#include "pnm.h"
+ #if SDL_BYTEORDER == SDL_BIG_ENDIAN
+ #define R_MASK 0xff000000
+ #define G_MASK 0x00ff0000
+ #define B_MASK 0x0000ff00
+ #define A_MASK 0x000000ff
+ #else
+ #define R_MASK 0x000000ff
+ #define G_MASK 0x0000ff00
+ #define B_MASK 0x00ff0000
+ #define A_MASK 0xff000000
+ #endif
using namespace std;
***************
*** 187,192 ****
SDL_Surface *tmp2 = SDL_CreateRGBSurface (0, 1, 1, 24,
! 0x0000FF, 0x00FF00,
! 0xFF0000, 0);
image * imt;
--- 199,204 ----
SDL_Surface *tmp2 = SDL_CreateRGBSurface (0, 1, 1, 24,
! R_MASK, G_MASK,
! B_MASK, 0);
image * imt;
***************
*** 238,243 ****
{
SDL_Surface *tmp2 = SDL_CreateRGBSurface (0, 1, 1, 24,
! 0x0000FF, 0x00FF00,
! 0xFF0000, 0);
SDL_Surface * temp;
--- 250,255 ----
{
SDL_Surface *tmp2 = SDL_CreateRGBSurface (0, 1, 1, 24,
! R_MASK, G_MASK,
! B_MASK, 0);
SDL_Surface * temp;
***************
*** 372,377 ****
height (), 24,
length () * 3,
! 0x0000FF, 0x00FF00,
! 0xFF0000, 0);
vis = SDL_DisplayFormat (tmp2);
if (screen::dblmode)
--- 384,389 ----
height (), 24,
length () * 3,
! R_MASK, G_MASK,
! B_MASK, 0);
vis = SDL_DisplayFormat (tmp2);
if (screen::dblmode)
Index: lex.prefs.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/lex.prefs.cc,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** lex.prefs.cc 29 Apr 2002 15:57:35 -0000 1.12
--- lex.prefs.cc 26 May 2002 09:27:27 -0000 1.13
***************
*** 28,32 ****
#include <stdio.h>
! #include <errno.h>
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
--- 28,32 ----
#include <stdio.h>
!
/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
***************
*** 41,53 ****
#include <stdlib.h>
- #ifndef _WIN32
#include <unistd.h>
- #else
- #ifndef YY_ALWAYS_INTERACTIVE
- #ifndef YY_NEVER_INTERACTIVE
- extern int isatty YY_PROTO(( int ));
- #endif
- #endif
- #endif
/* Use prototypes in function declarations. */
--- 41,45 ----
***************
*** 312,330 ****
yy_c_buf_p = yy_cp;
! #define YY_NUM_RULES 16
! #define YY_END_OF_BUFFER 17
! static yyconst short int yy_accept[98] =
{ 0,
! 0, 0, 0, 0, 17, 15, 14, 14, 1, 13,
! 15, 15, 15, 15, 15, 10, 12, 11, 14, 1,
! 1, 13, 0, 0, 0, 0, 0, 12, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
! 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
! 0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
! 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
! 2, 0, 0, 0, 8, 0, 0, 0, 5, 0,
! 0, 0, 0, 6, 0, 7, 0
} ;
--- 304,323 ----
yy_c_buf_p = yy_cp;
! #define YY_NUM_RULES 17
! #define YY_END_OF_BUFFER 18
! static yyconst short int yy_accept[108] =
{ 0,
! 0, 0, 0, 0, 18, 16, 15, 15, 1, 14,
! 16, 16, 16, 16, 16, 16, 11, 13, 12, 15,
! 1, 1, 14, 0, 0, 0, 0, 0, 0, 13,
! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
! 0, 0, 10, 0, 0, 0, 0, 0, 4, 0,
! 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
! 0, 0, 0, 5, 0, 0, 0, 0, 0, 3,
! 2, 0, 0, 0, 9, 0, 0, 0, 6, 0,
+ 0, 0, 0, 7, 0, 8, 0
} ;
***************
*** 339,348 ****
1, 1, 1, 1, 7, 1, 1, 8, 1, 1,
1, 1, 1, 1, 1, 9, 1, 1, 1, 1,
! 1, 1, 10, 1, 1, 11, 1, 1, 1, 1,
! 12, 1, 13, 1, 1, 1, 14, 15, 16, 17,
! 18, 1, 19, 20, 21, 1, 1, 22, 23, 24,
! 25, 26, 1, 27, 28, 29, 30, 31, 1, 1,
! 1, 32, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
--- 332,341 ----
1, 1, 1, 1, 7, 1, 1, 8, 1, 1,
1, 1, 1, 1, 1, 9, 1, 1, 1, 1,
! 10, 1, 11, 1, 1, 12, 1, 1, 1, 1,
! 13, 1, 14, 1, 1, 1, 15, 16, 17, 18,
! 19, 1, 20, 21, 22, 1, 23, 24, 25, 26,
! 27, 28, 1, 29, 30, 31, 32, 33, 1, 1,
! 1, 34, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
***************
*** 361,442 ****
} ;
! static yyconst int yy_meta[33] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
! 1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
! 1, 1
} ;
! static yyconst short int yy_base[102] =
{ 0,
! 0, 11, 102, 101, 113, 116, 22, 24, 109, 105,
! 80, 84, 94, 91, 88, 116, 0, 116, 26, 102,
! 116, 98, 86, 72, 77, 73, 72, 0, 77, 82,
! 77, 77, 66, 68, 70, 61, 72, 68, 83, 69,
! 72, 61, 59, 14, 78, 63, 76, 56, 59, 60,
! 63, 51, 47, 56, 50, 116, 58, 43, 47, 47,
! 47, 116, 42, 42, 40, 38, 33, 30, 44, 36,
! 37, 36, 34, 38, 37, 36, 23, 34, 26, 116,
! 116, 21, 11, 34, 116, 10, 16, 9, 116, 10,
! 20, 9, 3, 116, 13, 116, 116, 45, 47, 49,
0
} ;
! static yyconst short int yy_def[102] =
{ 0,
! 98, 98, 99, 99, 97, 97, 97, 97, 100, 97,
! 97, 97, 97, 97, 97, 97, 101, 97, 97, 100,
! 97, 97, 97, 97, 97, 97, 97, 101, 97, 97,
! 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
! 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
! 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
! 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
! 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
! 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
! 97, 97, 97, 97, 97, 97, 0, 97, 97, 97,
! 97
} ;
! static yyconst short int yy_nxt[149] =
{ 0,
! 28, 7, 8, 9, 97, 10, 11, 12, 13, 14,
! 15, 16, 7, 8, 9, 97, 10, 11, 12, 13,
! 14, 15, 16, 19, 19, 19, 19, 19, 19, 49,
! 96, 95, 94, 93, 92, 91, 90, 89, 88, 87,
! 50, 51, 86, 85, 52, 6, 6, 17, 17, 20,
! 20, 84, 83, 82, 81, 80, 79, 78, 77, 76,
! 75, 74, 73, 72, 71, 70, 69, 68, 67, 66,
! 65, 64, 63, 62, 61, 60, 59, 58, 57, 56,
! 55, 54, 53, 48, 47, 46, 45, 44, 43, 42,
! 41, 40, 39, 38, 37, 36, 35, 34, 33, 32,
!
! 31, 30, 29, 22, 21, 27, 26, 25, 24, 23,
! 22, 21, 97, 18, 18, 5, 97, 97, 97, 97,
! 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
! 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
! 97, 97, 97, 97, 97, 97, 97, 97
} ;
! static yyconst short int yy_chk[149] =
{ 0,
! 101, 1, 1, 1, 0, 1, 1, 1, 1, 1,
! 1, 1, 2, 2, 2, 0, 2, 2, 2, 2,
! 2, 2, 2, 7, 7, 8, 8, 19, 19, 44,
! 95, 93, 92, 91, 90, 88, 87, 86, 84, 83,
! 44, 44, 82, 79, 44, 98, 98, 99, 99, 100,
! 100, 78, 77, 76, 75, 74, 73, 72, 71, 70,
! 69, 68, 67, 66, 65, 64, 63, 61, 60, 59,
! 58, 57, 55, 54, 53, 52, 51, 50, 49, 48,
! 47, 46, 45, 43, 42, 41, 40, 39, 38, 37,
! 36, 35, 34, 33, 32, 31, 30, 29, 27, 26,
!
! 25, 24, 23, 22, 20, 15, 14, 13, 12, 11,
! 10, 9, 5, 4, 3, 97, 97, 97, 97, 97,
! 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
! 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
! 97, 97, 97, 97, 97, 97, 97, 97
} ;
--- 354,441 ----
} ;
! static yyconst int yy_meta[35] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
! 1, 1, 1, 2, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
! 1, 1, 1, 1
} ;
! static yyconst short int yy_base[112] =
{ 0,
! 0, 12, 112, 111, 124, 127, 24, 26, 120, 116,
! 89, 93, 104, 86, 100, 97, 127, 0, 127, 28,
! 112, 127, 108, 95, 80, 85, 88, 80, 79, 0,
! 85, 90, 85, 87, 84, 72, 74, 76, 67, 75,
! 78, 74, 90, 75, 78, 87, 65, 63, 15, 84,
! 68, 63, 81, 59, 63, 64, 67, 54, 50, 60,
! 51, 52, 127, 61, 45, 49, 49, 50, 127, 56,
! 43, 43, 41, 39, 34, 31, 46, 45, 36, 37,
! 36, 34, 39, 127, 38, 37, 23, 28, 27, 127,
! 127, 19, 11, 36, 127, 10, 17, 9, 127, 10,
+ 21, 9, 3, 127, 14, 127, 127, 48, 50, 52,
0
} ;
! static yyconst short int yy_def[112] =
{ 0,
! 108, 108, 109, 109, 107, 107, 107, 107, 110, 107,
! 107, 107, 107, 107, 107, 107, 107, 111, 107, 107,
! 110, 107, 107, 107, 107, 107, 107, 107, 107, 111,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 0, 107, 107, 107,
! 107
} ;
! static yyconst short int yy_nxt[162] =
{ 0,
! 30, 7, 8, 9, 107, 10, 11, 12, 13, 14,
! 15, 16, 17, 7, 8, 9, 107, 10, 11, 12,
! 13, 14, 15, 16, 17, 20, 20, 20, 20, 20,
! 20, 55, 106, 105, 104, 103, 102, 101, 100, 99,
! 98, 97, 96, 56, 57, 95, 94, 58, 6, 6,
! 18, 18, 21, 21, 93, 92, 91, 90, 89, 88,
! 87, 86, 85, 84, 83, 82, 81, 80, 79, 78,
! 77, 76, 75, 74, 73, 72, 71, 70, 69, 68,
! 67, 66, 65, 64, 63, 62, 61, 60, 59, 54,
! 53, 52, 51, 50, 49, 48, 47, 46, 45, 44,
!
! 43, 42, 41, 40, 39, 38, 37, 36, 35, 34,
! 33, 32, 31, 23, 22, 29, 28, 27, 26, 25,
! 24, 23, 22, 107, 19, 19, 5, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107
} ;
! static yyconst short int yy_chk[162] =
{ 0,
! 111, 1, 1, 1, 0, 1, 1, 1, 1, 1,
! 1, 1, 1, 2, 2, 2, 0, 2, 2, 2,
! 2, 2, 2, 2, 2, 7, 7, 8, 8, 20,
! 20, 49, 105, 103, 102, 101, 100, 98, 97, 96,
! 94, 93, 92, 49, 49, 89, 88, 49, 108, 108,
! 109, 109, 110, 110, 87, 86, 85, 83, 82, 81,
! 80, 79, 78, 77, 76, 75, 74, 73, 72, 71,
! 70, 68, 67, 66, 65, 64, 62, 61, 60, 59,
! 58, 57, 56, 55, 54, 53, 52, 51, 50, 48,
! 47, 46, 45, 44, 43, 42, 41, 40, 39, 38,
!
! 37, 36, 35, 34, 33, 32, 31, 29, 28, 27,
! 26, 25, 24, 23, 21, 16, 15, 14, 13, 12,
! 11, 10, 9, 5, 4, 3, 107, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
! 107
} ;
***************
*** 478,482 ****
#define YY_NO_UNPUT 1
#define YY_NEVER_INTERACTIVE 1
! #line 481 "lex.prefs.cc"
/* Macros after this point can all be overridden by user definitions in
--- 477,481 ----
#define YY_NO_UNPUT 1
#define YY_NEVER_INTERACTIVE 1
! #line 480 "lex.prefs.cc"
/* Macros after this point can all be overridden by user definitions in
***************
*** 578,595 ****
result = n; \
} \
! else \
! { \
! errno=0; \
! while ( (result = fread(buf, 1, max_size, yyin))==0 &&
ferror(yyin)) \
! { \
! if( errno != EINTR) \
! { \
! YY_FATAL_ERROR( "input in flex scanner failed"
); \
! break; \
! } \
! errno=0; \
! clearerr(yyin); \
! } \
! }
#endif
--- 577,583 ----
result = n; \
} \
! else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
! && ferror( yyin ) ) \
! YY_FATAL_ERROR( "input in flex scanner failed" );
#endif
***************
*** 643,647 ****
! #line 646 "lex.prefs.cc"
if ( yy_init )
--- 631,635 ----
! #line 634 "lex.prefs.cc"
if ( yy_init )
***************
*** 694,698 ****
{
yy_current_state = (int)
yy_def[yy_current_state];
! if ( yy_current_state >= 98 )
yy_c = yy_meta[(unsigned int) yy_c];
}
--- 682,686 ----
{
yy_current_state = (int)
yy_def[yy_current_state];
! if ( yy_current_state >= 108 )
yy_c = yy_meta[(unsigned int) yy_c];
}
***************
*** 700,704 ****
++yy_cp;
}
! while ( yy_base[yy_current_state] != 116 );
yy_find_action:
--- 688,692 ----
++yy_cp;
}
! while ( yy_base[yy_current_state] != 127 );
yy_find_action:
***************
*** 749,810 ****
YY_RULE_SETUP
#line 36 "prefs.l"
! return PREFS_AUDIO_CHANNELS;
YY_BREAK
case 6:
YY_RULE_SETUP
#line 37 "prefs.l"
! return PREFS_AUDIO_RESOLUTION;
YY_BREAK
case 7:
YY_RULE_SETUP
#line 38 "prefs.l"
! return PREFS_AUDIO_SAMPLE_RATE;
YY_BREAK
case 8:
YY_RULE_SETUP
#line 39 "prefs.l"
! return PREFS_AUDIO_VOLUME;
YY_BREAK
case 9:
YY_RULE_SETUP
#line 40 "prefs.l"
! return PREFS_VERSION;
YY_BREAK
case 10:
YY_RULE_SETUP
! #line 42 "prefs.l"
! mytext = ""; BEGIN(text);
YY_BREAK
case 11:
YY_RULE_SETUP
#line 43 "prefs.l"
! BEGIN(INITIAL); return PREFS_STR;
YY_BREAK
case 12:
YY_RULE_SETUP
#line 44 "prefs.l"
! mytext += yytext;
YY_BREAK
case 13:
YY_RULE_SETUP
! #line 46 "prefs.l"
! mynum = atoi (yytext); return PREFS_NUM;
YY_BREAK
case 14:
YY_RULE_SETUP
! #line 48 "prefs.l"
! ;
YY_BREAK
case 15:
YY_RULE_SETUP
#line 49 "prefs.l"
! return PREFS_UNKNOWN;
YY_BREAK
case 16:
YY_RULE_SETUP
#line 50 "prefs.l"
ECHO;
YY_BREAK
! #line 809 "lex.prefs.cc"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(text):
--- 737,803 ----
YY_RULE_SETUP
#line 36 "prefs.l"
! return PREFS_QUICK_LOAD;
YY_BREAK
case 6:
YY_RULE_SETUP
#line 37 "prefs.l"
! return PREFS_AUDIO_CHANNELS;
YY_BREAK
case 7:
YY_RULE_SETUP
#line 38 "prefs.l"
! return PREFS_AUDIO_RESOLUTION;
YY_BREAK
case 8:
YY_RULE_SETUP
#line 39 "prefs.l"
! return PREFS_AUDIO_SAMPLE_RATE;
YY_BREAK
case 9:
YY_RULE_SETUP
#line 40 "prefs.l"
! return PREFS_AUDIO_VOLUME;
YY_BREAK
case 10:
YY_RULE_SETUP
! #line 41 "prefs.l"
! return PREFS_VERSION;
YY_BREAK
case 11:
YY_RULE_SETUP
#line 43 "prefs.l"
! mytext = ""; BEGIN(text);
YY_BREAK
case 12:
YY_RULE_SETUP
#line 44 "prefs.l"
! BEGIN(INITIAL); return PREFS_STR;
YY_BREAK
case 13:
YY_RULE_SETUP
! #line 45 "prefs.l"
! mytext += yytext;
YY_BREAK
case 14:
YY_RULE_SETUP
! #line 47 "prefs.l"
! mynum = atoi (yytext); return PREFS_NUM;
YY_BREAK
case 15:
YY_RULE_SETUP
#line 49 "prefs.l"
! ;
YY_BREAK
case 16:
YY_RULE_SETUP
#line 50 "prefs.l"
+ return PREFS_UNKNOWN;
+ YY_BREAK
+ case 17:
+ YY_RULE_SETUP
+ #line 51 "prefs.l"
ECHO;
YY_BREAK
! #line 802 "lex.prefs.cc"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(text):
***************
*** 1099,1103 ****
{
yy_current_state = (int) yy_def[yy_current_state];
! if ( yy_current_state >= 98 )
yy_c = yy_meta[(unsigned int) yy_c];
}
--- 1092,1096 ----
{
yy_current_state = (int) yy_def[yy_current_state];
! if ( yy_current_state >= 108 )
yy_c = yy_meta[(unsigned int) yy_c];
}
***************
*** 1134,1142 ****
{
yy_current_state = (int) yy_def[yy_current_state];
! if ( yy_current_state >= 98 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)
yy_c];
! yy_is_jam = (yy_current_state == 97);
return yy_is_jam ? 0 : yy_current_state;
--- 1127,1135 ----
{
yy_current_state = (int) yy_def[yy_current_state];
! if ( yy_current_state >= 108 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int)
yy_c];
! yy_is_jam = (yy_current_state == 107);
return yy_is_jam ? 0 : yy_current_state;
***************
*** 1371,1381 ****
- #ifndef _WIN32
- #include <unistd.h>
- #else
#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
! extern int isatty YY_PROTO(( int ));
! #endif
#endif
#endif
--- 1364,1370 ----
#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
! #include<unistd.h>
#endif
#endif
***************
*** 1697,1699 ****
}
#endif
! #line 50 "prefs.l"
--- 1686,1688 ----
}
#endif
! #line 51 "prefs.l"
Index: main.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/main.cc,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -r1.46 -r1.47
*** main.cc 28 Apr 2002 14:36:59 -0000 1.46
--- main.cc 26 May 2002 09:27:27 -0000 1.47
***************
*** 2,6 ****
$Id$
! Copyright (C) 1999/2000/2001 Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
--- 2,6 ----
$Id$
! Copyright (C) 1999/2000/2001/2002 Kai Sterker <address@hidden>
Part of the Adonthell Project http://adonthell.linuxgames.com
***************
*** 127,131 ****
// init game loading/saving system
! gamedata::init (game::user_data_dir(), game::game_data_dir(),
myconfig.game_name);
// init video subsystem
--- 127,132 ----
// init game loading/saving system
! gamedata::init (game::user_data_dir(), game::game_data_dir(),
! myconfig.game_name, myconfig.quick_load);
// init video subsystem
Index: prefs.cc
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/prefs.cc,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** prefs.cc 27 Apr 2002 19:40:46 -0000 1.20
--- prefs.cc 26 May 2002 09:27:27 -0000 1.21
***************
*** 46,49 ****
--- 46,50 ----
screen_mode = 0; // Fullscreen
double_screen = 1; // Double screen
+ quick_load = 1; // Quick-load enabled
audio_channels = 1; // Stereo
audio_resolution = 1; // 16 bit
***************
*** 268,275 ****
<< "# edit to your needs!\n\n"
<< "# Screen-mode num\n# 0 Windowed mode\n"
! << "# 1 Fullscreen mode\n Screen-mode " << (int) screen_mode <<
"\n\n"
! << "# Double-size num\n# 0 320x240 mode\n"
! << "# 1 640x480 (double) mode\n Double-size " << (int)
double_screen << "\n\n"
<< "# Language [locale]\n# Where locale has the form fr_FR or de_DE,
etc.\n Language [" << language << "]\n\n"
<< "# Audio-channels num\n# 0 Mono\n# 1 Stereo\n"
<< " Audio-channels " << (int) audio_channels << "\n\n"
--- 269,279 ----
<< "# edit to your needs!\n\n"
<< "# Screen-mode num\n# 0 Windowed mode\n"
! << "# 1 Fullscreen mode\n Screen-mode " << (int) screen_mode
! << "\n\n" << "# Double-size num\n# 0 320x240 mode\n"
! << "# 1 640x480 (double) mode\n Double-size "
! << (int) double_screen << "\n\n"
<< "# Language [locale]\n# Where locale has the form fr_FR or de_DE,
etc.\n Language [" << language << "]\n\n"
+ << "# Quick-load num\n# 0 off\n# 1 on\n Quick-load "
+ << (int) quick_load << "\n\n"
<< "# Audio-channels num\n# 0 Mono\n# 1 Stereo\n"
<< " Audio-channels " << (int) audio_channels << "\n\n"
***************
*** 280,284 ****
<< "# Audio-volume num\n# 0 - 100 %\n"
<< " Audio-volume " << (int) audio_volume << "\n\n"
! << "# Version of this file. Don't Edit\n Version [" << VERSION <<
"]\n";
rc.close ();
--- 284,288 ----
<< "# Audio-volume num\n# 0 - 100 %\n"
<< " Audio-volume " << (int) audio_volume << "\n\n"
! << "# Version number of this file. Please don't edit\n Version ["
<< VERSION << "]\n";
rc.close ();
***************
*** 340,343 ****
--- 344,353 ----
{
if (parse_adonthellrc (n, s) == PREFS_NUM) double_screen = n;
+ break;
+ }
+
+ case PREFS_QUICK_LOAD:
+ {
+ if (parse_adonthellrc (n, s) == PREFS_NUM) quick_load = n;
break;
}
Index: prefs.h
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/prefs.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** prefs.h 27 Apr 2002 17:00:19 -0000 1.14
--- prefs.h 26 May 2002 09:27:27 -0000 1.15
***************
*** 51,62 ****
PREFS_SCREEN_MODE = 1,
PREFS_LANGUAGE = 2,
! PREFS_AUDIO_CHANNELS = 3,
! PREFS_AUDIO_RESOLUTION = 4,
! PREFS_AUDIO_SAMPLE_RATE = 5,
! PREFS_AUDIO_VOLUME = 6,
! PREFS_VERSION = 7,
! PREFS_NUM = 8,
! PREFS_STR = 9,
! PREFS_DOUBLE_SCREEN = 10,
};
--- 51,63 ----
PREFS_SCREEN_MODE = 1,
PREFS_LANGUAGE = 2,
! PREFS_QUICK_LOAD = 3,
! PREFS_AUDIO_CHANNELS = 4,
! PREFS_AUDIO_RESOLUTION = 5,
! PREFS_AUDIO_SAMPLE_RATE = 6,
! PREFS_AUDIO_VOLUME = 7,
! PREFS_VERSION = 8,
! PREFS_NUM = 9,
! PREFS_STR = 10,
! PREFS_DOUBLE_SCREEN = 11,
};
***************
*** 73,77 ****
* values.
* - Language: English
! * - Screen mode: Windowed
* - Audio: High quality (44.1kHz, 16 bit, stereo)
* - Volume: 100%
--- 74,79 ----
* values.
* - Language: English
! * - Screen mode: windowed
! * - Quick load: enabled
* - Audio: High quality (44.1kHz, 16 bit, stereo)
* - Volume: 100%
***************
*** 135,138 ****
--- 137,144 ----
u_int8 screen_mode;
u_int8 double_screen;
+ /**
+ * Whether the quick-load feature is enabled (1) or not (0)
+ */
+ u_int8 quick_load;
/**
* The number of channels: mono (0) or stereo (1).
Index: prefs.l
===================================================================
RCS file: /cvsroot/adonthell/adonthell/src/prefs.l,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** prefs.l 27 Apr 2002 19:40:46 -0000 1.10
--- prefs.l 26 May 2002 09:27:27 -0000 1.11
***************
*** 34,37 ****
--- 34,38 ----
Double-size return PREFS_DOUBLE_SCREEN;
Language return PREFS_LANGUAGE;
+ Quick-load return PREFS_QUICK_LOAD;
Audio-channels return PREFS_AUDIO_CHANNELS;
Audio-resolution return PREFS_AUDIO_RESOLUTION;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Adonthell-commits] CVS: adonthell/src Makefile.am,1.89,1.90 adonthell.cc,1.6,1.7 adonthell.h,1.3,1.4 fileops.cc,1.8,1.9 gamedata.cc,1.18,1.19 gamedata.h,1.11,1.12 image.cc,1.11,1.12 lex.prefs.cc,1.12,1.13 main.cc,1.46,1.47 prefs.cc,1.20,1.21 prefs.h,1.14,1.15 prefs.l,1.10,1.11,
Kai Sterker <address@hidden> <=
- Prev by Date:
[Adonthell-commits] CVS: adonthell README,1.25,1.26 config.status,1.12,1.13 configure.in,1.64,1.65
- Previous by thread:
[Adonthell-commits] CVS: adonthell README,1.25,1.26 config.status,1.12,1.13 configure.in,1.64,1.65
- Index(es):