[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus doc/ChangeLog.html src/clone/construc...
From: |
Martin Renold |
Subject: |
[Stratagus-CVS] stratagus doc/ChangeLog.html src/clone/construc... |
Date: |
Sat, 09 Aug 2003 16:08:39 -0400 |
CVSROOT: /cvsroot/stratagus
Module name: stratagus
Branch:
Changes by: Martin Renold <address@hidden> 03/08/09 16:08:39
Modified files:
doc : ChangeLog.html
src/clone : construct.c player.c unit.c unit_draw.c
src/game : loadgame.c savegame.c
src/include : depend.h icons.h missile.h tileset.h unit.h
src/map : tileset.c
src/missile : missile.c
src/ui : icons.c ui.c
src/unit : depend.c unittype.c upgrade.c
src/video : cursor.c graphic.c
Log message:
reverting save/load simplifications
Patches:
Index: stratagus/doc/ChangeLog.html
diff -u stratagus/doc/ChangeLog.html:1.508 stratagus/doc/ChangeLog.html:1.509
--- stratagus/doc/ChangeLog.html:1.508 Fri Aug 8 15:31:36 2003
+++ stratagus/doc/ChangeLog.html Sat Aug 9 16:08:38 2003
@@ -2,7 +2,7 @@
<html>
<head>
<!--
----- $Id: ChangeLog.html,v 1.508 2003/08/08 19:31:36 n0body Exp $
+---- $Id: ChangeLog.html,v 1.509 2003/08/09 20:08:38 martinxyz Exp $
---- (c) Copyright 1998-2003 by Lutz Sammer
@@ -38,7 +38,6 @@
<li>++
<li>A lot of progress in resource configurability (from Crestez Dan
Leonard).
<li>Minimap panel can have its own palette now (from Martin Renold).
- <li>Simplified save/load, fewer things are now saved (from Martin Renold).
<li>NEW_UI: Dropped of displaying the current unit action with the buttons
(from Martin Renold).
<li>NEW_UI: Dropped Alt-Buttons support (did anybody use this?) (from
Martin Renold).
<li>NEW_UI: Button actions are now custom scheme scripts (from Martin
Renold).
Index: stratagus/src/clone/construct.c
diff -u stratagus/src/clone/construct.c:1.32
stratagus/src/clone/construct.c:1.33
--- stratagus/src/clone/construct.c:1.32 Fri Aug 8 06:16:43 2003
+++ stratagus/src/clone/construct.c Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: construct.c,v 1.32 2003/08/08 10:16:43 martinxyz Exp $
+// $Id: construct.c,v 1.33 2003/08/09 20:08:38 martinxyz Exp $
//@{
@@ -141,14 +141,32 @@
global void SaveConstructions(FILE* file)
{
int j;
+ int i;
+ char** cp;
Construction** cop;
ConstructionFrame* cframe;
fprintf(file,"\n;;; -----------------------------------------\n");
- fprintf(file,";;; MODULE: constructions $Id: construct.c,v 1.32 2003/08/08
10:16:43 martinxyz Exp $\n\n");
+ fprintf(file,";;; MODULE: constructions $Id: construct.c,v 1.33 2003/08/09
20:08:38 martinxyz Exp $\n\n");
// FIXME: needed?
+ //
+ // Dump table wc2 construction numbers -> internal symbol.
+ //
+ if( (cp=ConstructionWcNames) ) {
+ fprintf(file,"(define-construction-wc-names");
+
+ i=90;
+ while( *cp ) {
+ if( i+strlen(*cp)>79 ) {
+ i=fprintf(file,"\n ");
+ }
+ i+=fprintf(file," '%s",*cp++);
+ }
+ fprintf(file,")\n\n");
+ }
+
//
// Dump table of all constructions
//
Index: stratagus/src/clone/player.c
diff -u stratagus/src/clone/player.c:1.87 stratagus/src/clone/player.c:1.88
--- stratagus/src/clone/player.c:1.87 Fri Aug 8 06:16:43 2003
+++ stratagus/src/clone/player.c Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: player.c,v 1.87 2003/08/08 10:16:43 martinxyz Exp $
+// $Id: player.c,v 1.88 2003/08/09 20:08:38 martinxyz Exp $
//@{
@@ -189,7 +189,7 @@
int j;
fprintf(file,"\n;;; -----------------------------------------\n");
- fprintf(file,";;; MODULE: players $Id: player.c,v 1.87 2003/08/08 10:16:43
martinxyz Exp $\n\n");
+ fprintf(file,";;; MODULE: players $Id: player.c,v 1.88 2003/08/09 20:08:38
martinxyz Exp $\n\n");
#ifndef NEW_UI
//
@@ -210,6 +210,24 @@
fprintf(file,")\n\n");
}
#endif
+
+ //
+ // Dump table wc2 race numbers -> internal symbol.
+ //
+ if( PlayerRaces.Count ) {
+ fprintf(file,"(define-race-names");
+ for( i=0; i<PlayerRaces.Count; ++i ) {
+ fprintf(file,"\n 'race '(");
+ fprintf(file,"\n race %d",PlayerRaces.Race[i]);
+ fprintf(file,"\n name %s",PlayerRaces.Name[i]);
+ fprintf(file,"\n display %s",PlayerRaces.Display[i]);
+ if( PlayerRaces.Visible[i] ) {
+ fprintf(file,"\n visible");
+ }
+ fprintf(file,")");
+ }
+ fprintf(file,")\n\n");
+ }
//
// Dump all players
Index: stratagus/src/clone/unit.c
diff -u stratagus/src/clone/unit.c:1.283 stratagus/src/clone/unit.c:1.284
--- stratagus/src/clone/unit.c:1.283 Fri Aug 8 15:31:36 2003
+++ stratagus/src/clone/unit.c Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.c,v 1.283 2003/08/08 19:31:36 n0body Exp $
+// $Id: unit.c,v 1.284 2003/08/09 20:08:38 martinxyz Exp $
//@{
@@ -4271,14 +4271,11 @@
int InRun, RunStart;
fprintf(file,"\n;;; -----------------------------------------\n");
- fprintf(file,";;; MODULE: units $Id: unit.c,v 1.283 2003/08/08 19:31:36
n0body Exp $\n\n");
+ fprintf(file,";;; MODULE: units $Id: unit.c,v 1.284 2003/08/09 20:08:38
martinxyz Exp $\n\n");
//
// Local variables
//
-
- // FIXME: is this map specifig or global for the game?
- // if it is global, don't save it
fprintf(file,"(set-hitpoint-regeneration! #%s)\n",
HitPointRegeneration ? "t" : "f");
fprintf(file,"(set-xp-damage! #%s)\n",
@@ -4339,7 +4336,6 @@
*/
global void InitUnits(void)
{
- // probably call CleanUnits() here?
}
/**
Index: stratagus/src/clone/unit_draw.c
diff -u stratagus/src/clone/unit_draw.c:1.148
stratagus/src/clone/unit_draw.c:1.149
--- stratagus/src/clone/unit_draw.c:1.148 Fri Aug 8 15:31:36 2003
+++ stratagus/src/clone/unit_draw.c Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit_draw.c,v 1.148 2003/08/08 19:31:36 n0body Exp $
+// $Id: unit_draw.c,v 1.149 2003/08/09 20:08:38 martinxyz Exp $
//@{
@@ -640,6 +640,69 @@
ShowLoadProgress("\tDecorations `%s'\n",SpellSprite.File);
SpellSprite.Sprite=LoadSprite(SpellSprite.File
,SpellSprite.Width,SpellSprite.Height);
+ }
+}
+
+/**
+** Save decorations.
+*/
+global void SaveDecorations(FILE* file)
+{
+ fprintf(file,"\n;;; -----------------------------------------\n");
+ fprintf(file,";;; MODULE: decorations $Id: unit_draw.c,v 1.149 2003/08/09
20:08:38 martinxyz Exp $\n\n");
+
+ fprintf(file,"(mana-sprite \"%s\" %d %d %d %d)\n",
+ ManaSprite.File,ManaSprite.HotX,ManaSprite.HotY,
+ ManaSprite.Width,ManaSprite.Height);
+ fprintf(file,"(health-sprite \"%s\" %d %d %d %d)\n",
+ HealthSprite.File,HealthSprite.HotX,HealthSprite.HotY,
+ HealthSprite.Width,HealthSprite.Height);
+ fprintf(file,"(shadow-sprite \"%s\" %d %d %d %d)\n",
+ ShadowSprite.File,ShadowSprite.HotX,ShadowSprite.HotY,
+ ShadowSprite.Width,ShadowSprite.Height);
+ fprintf(file,"(spell-sprite \"%s\" %d %d %d %d)\n",
+ SpellSprite.File,SpellSprite.HotX,SpellSprite.HotY,
+ SpellSprite.Width,SpellSprite.Height);
+
+ // This belongs to the config and not save file
+ if( ShowHealthBar ) {
+ fprintf(file,";(show-health-bar)\n");
+ }
+ if( ShowHealthDot ) {
+ fprintf(file,";(show-health-dot)\n");
+ }
+ if( ShowHealthHorizontal ) {
+ fprintf(file,";(show-health-horizontal)\n");
+ } else {
+ fprintf(file,";(show-health-vertical)\n");
+ }
+ if( ShowHealthBackgroundLong ) {
+ fprintf(file,";(show-health-blackground-long)\n");
+ }
+ if( ShowManaBar ) {
+ fprintf(file,";(show-mana-bar)\n");
+ }
+ if( ShowManaDot ) {
+ fprintf(file,";(show-mana-dot)\n");
+ }
+ if( ShowManaHorizontal ) {
+ fprintf(file,";(show-mana-horizontal)\n");
+ } else {
+ fprintf(file,";(show-mana-vertical)\n");
+ }
+ if( ShowManaBackgroundLong ) {
+ fprintf(file,";(show-mana-blackground-long)\n");
+ }
+ if( ShowEnergySelectedOnly ) {
+ fprintf(file,";(show-energy-selected-only)\n");
+ }
+ if( ShowNoFull ) {
+ fprintf(file,";(show-no-full)\n");
+ } else {
+ fprintf(file,";(show-full)\n");
+ }
+ if( DecorationOnTop ) {
+ fprintf(file,";(decoration-on-top)\n");
}
}
Index: stratagus/src/game/loadgame.c
diff -u stratagus/src/game/loadgame.c:1.56 stratagus/src/game/loadgame.c:1.57
--- stratagus/src/game/loadgame.c:1.56 Fri Aug 8 06:16:43 2003
+++ stratagus/src/game/loadgame.c Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: loadgame.c,v 1.56 2003/08/08 10:16:43 martinxyz Exp $
+// $Id: loadgame.c,v 1.57 2003/08/09 20:08:38 martinxyz Exp $
//@{
@@ -121,7 +121,7 @@
/**
** Initialize all modules.
**
-** Call each module to initialize (for LoadGame).
+** Call each module to initialize.
*/
global void InitModules(void)
{
@@ -217,57 +217,8 @@
int old_siod_verbose_level;
unsigned long game_cycle;
- // protect from hooks
-
- //LoadCcl(); // Reload the main config file
- { // maxy: added instead of CleanModules(); untested
- // FIXME: those things should be somehow either in InitModules
- // or be cleaned implicitely when things get overriden from
- // the savegame
-
- EndReplayLog();
- CleanMessages();
-
- DestroyCursorBackground();
- CursorBuilding=0;
- GameCursor=0;
- UnitUnderCursor=NoUnitP;
- CleanAi();
- { //CleanPlayers(); //?
- int p;
-
- for( p=0; p<PlayerMax; ++p ) {
- if( Players[p].Name ) {
- free(Players[p].Name);
- }
- if( Players[p].Units ) {
- free(Players[p].Units);
- }
- }
- ThisPlayer=NULL;
- memset(Players,0,sizeof(Players));
- NumPlayers=0;
- // ? NoRescueCheck=0;
- }
-
- CleanUnits();
- CleanSelections();
- CleanGroups();
- // CleanUpgrades() ?
- // CleanDependencies() ?
- // should not be necessary: CleanButtons()
- CleanMissiles();
- CleanMap();
- CleanReplayLog();
-#ifdef HIERARCHIC_PATHFINDER
- PfHierClean ();
-#endif
- if (AStarOn) {
- FreeAStar();
- }
- }
+ CleanModules();
- // collect garbage, then eval the savegame
old_siod_verbose_level=siod_verbose_level;
siod_verbose_level=4;
user_gc(SCM_BOOL_F);
@@ -285,8 +236,8 @@
GameCycle=game_cycle;
//GameCursor=TheUI.Point.Cursor; // FIXME: just a default.
GameCursor=CursorTypeByIdent("cursor-point"); // TheUI not cleaned
- SelectionChanged();
- MustRedraw=RedrawEverything;
+ UpdateButtonPanel();
+ MustRedraw=RedrawEverything; // redraw everything
}
/**
Index: stratagus/src/game/savegame.c
diff -u stratagus/src/game/savegame.c:1.29 stratagus/src/game/savegame.c:1.30
--- stratagus/src/game/savegame.c:1.29 Fri Aug 8 06:16:43 2003
+++ stratagus/src/game/savegame.c Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: savegame.c,v 1.29 2003/08/08 10:16:43 martinxyz Exp $
+// $Id: savegame.c,v 1.30 2003/08/09 20:08:38 martinxyz Exp $
//@{
@@ -101,7 +101,7 @@
fprintf(file,";;;(save-game\n");
fprintf(file,";;; 'comment\t\"Generated by Stratagus Version " VERSION
"\"\n");
fprintf(file,";;; 'comment\t\"Visit http://Stratagus.Org for more
informations\"\n");
- fprintf(file,";;; 'comment\t\"$Id: savegame.c,v 1.29 2003/08/08 10:16:43
martinxyz Exp $\"\n");
+ fprintf(file,";;; 'comment\t\"$Id: savegame.c,v 1.30 2003/08/09 20:08:38
martinxyz Exp $\"\n");
fprintf(file,";;; 'type\t\"%s\"\n","single-player");
fprintf(file,";;; 'date\t\"%s\"\n",s);
fprintf(file,";;; 'map\t\"%s\"\n",TheMap.Description);
@@ -127,11 +127,17 @@
fprintf(file,"(set-game-cycle! %lu)\n",GameCycle);
SaveCcl(file);
+ SaveIcons(file);
+ SaveCursors(file);
SaveUserInterface(file);
+ SaveTilesets(file);
SaveConstructions(file);
+ SaveDecorations(file);
SaveUnitTypes(file);
SaveUpgrades(file);
+ SaveDependencies(file);
SaveButtons(file);
+ SaveMissileTypes(file);
SavePlayers(file);
SaveMap(file);
SaveUnits(file);
Index: stratagus/src/include/depend.h
diff -u stratagus/src/include/depend.h:1.15 stratagus/src/include/depend.h:1.16
--- stratagus/src/include/depend.h:1.15 Fri Aug 8 06:16:44 2003
+++ stratagus/src/include/depend.h Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: depend.h,v 1.15 2003/08/08 10:16:44 martinxyz Exp $
+// $Id: depend.h,v 1.16 2003/08/09 20:08:38 martinxyz Exp $
#ifndef __DEPEND_H__
#define __DEPEND_H__
@@ -137,6 +137,8 @@
extern void InitDependencies(void);
/// Load the dependencies
extern void LoadDependencies(FILE* file);
+ /// Save the dependencies
+extern void SaveDependencies(FILE* file);
/// Cleanup dependencies module
extern void CleanDependencies();
Index: stratagus/src/include/icons.h
diff -u stratagus/src/include/icons.h:1.36 stratagus/src/include/icons.h:1.37
--- stratagus/src/include/icons.h:1.36 Fri Aug 8 06:16:44 2003
+++ stratagus/src/include/icons.h Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: icons.h,v 1.36 2003/08/08 10:16:44 martinxyz Exp $
+// $Id: icons.h,v 1.37 2003/08/09 20:08:38 martinxyz Exp $
#ifndef __ICONS_H__
#define __ICONS_H__
@@ -219,6 +219,7 @@
/// Draw icon of an unit
extern void DrawUnitIcon(const Player*,Icon*,unsigned,int,int);
+extern void SaveIcons(FILE*); /// Save icons
extern void IconCclRegister(void); /// Register CCL features
//@}
Index: stratagus/src/include/missile.h
diff -u stratagus/src/include/missile.h:1.60
stratagus/src/include/missile.h:1.61
--- stratagus/src/include/missile.h:1.60 Fri Aug 8 06:16:44 2003
+++ stratagus/src/include/missile.h Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: missile.h,v 1.60 2003/08/08 10:16:44 martinxyz Exp $
+// $Id: missile.h,v 1.61 2003/08/09 20:08:38 martinxyz Exp $
#ifndef __MISSILE_H__
#define __MISSILE_H__
@@ -529,6 +529,8 @@
/// distance from view point to missile
extern int ViewPointDistanceToMissile(const Missile*);
+ /// Save missile-types
+extern void SaveMissileTypes(FILE*);
/// Save missiles
extern void SaveMissiles(FILE*);
Index: stratagus/src/include/tileset.h
diff -u stratagus/src/include/tileset.h:1.43
stratagus/src/include/tileset.h:1.44
--- stratagus/src/include/tileset.h:1.43 Fri Aug 8 06:16:44 2003
+++ stratagus/src/include/tileset.h Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: tileset.h,v 1.43 2003/08/08 10:16:44 martinxyz Exp $
+// $Id: tileset.h,v 1.44 2003/08/09 20:08:38 martinxyz Exp $
#ifndef __TILESET_H__
#define __TILESET_H__
@@ -334,6 +334,7 @@
----------------------------------------------------------------------------*/
extern void LoadTileset(void); /// Load tileset definition
+extern void SaveTilesets(FILE*); /// Save the tileset configuration
extern void CleanTilesets(void); /// Cleanup the tileset module
extern void TilesetCclRegister(void); /// Register CCL features for tileset
Index: stratagus/src/include/unit.h
diff -u stratagus/src/include/unit.h:1.201 stratagus/src/include/unit.h:1.202
--- stratagus/src/include/unit.h:1.201 Fri Aug 8 15:31:36 2003
+++ stratagus/src/include/unit.h Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unit.h,v 1.201 2003/08/08 19:31:36 n0body Exp $
+// $Id: unit.h,v 1.202 2003/08/09 20:08:38 martinxyz Exp $
#ifndef __UNIT_H__
#define __UNIT_H__
@@ -942,6 +942,8 @@
extern void DecorationCclRegister(void);
/// Load the decorations (health,mana) of units
extern void LoadDecorations(void);
+ /// Save the decorations (health,mana) of units
+extern void SaveDecorations(FILE* file);
/// Clean the decorations (health,mana) of units
extern void CleanDecorations(void);
Index: stratagus/src/map/tileset.c
diff -u stratagus/src/map/tileset.c:1.48 stratagus/src/map/tileset.c:1.49
--- stratagus/src/map/tileset.c:1.48 Fri Aug 8 06:16:44 2003
+++ stratagus/src/map/tileset.c Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: tileset.c,v 1.48 2003/08/08 10:16:44 martinxyz Exp $
+// $Id: tileset.c,v 1.49 2003/08/09 20:08:38 martinxyz Exp $
//@{
@@ -517,6 +517,233 @@
}
}
};
+
+/**
+** Save flag part of tileset.
+**
+** @param file File handle for the saved flags.
+** @param flags Bit field of the flags.
+*/
+local void SaveTilesetFlags(FILE* file, unsigned flags)
+{
+ if (flags & MapFieldWaterAllowed) {
+ fprintf(file, " 'water");
+ }
+ if (flags & MapFieldLandAllowed) {
+ fprintf(file, " 'land");
+ }
+ if (flags & MapFieldCoastAllowed) {
+ fprintf(file, " 'coast");
+ }
+ if (flags & MapFieldNoBuilding) {
+ fprintf(file, " 'no-building");
+ }
+ if (flags & MapFieldUnpassable) {
+ fprintf(file, " 'unpassable");
+ }
+ if (flags & MapFieldWall) {
+ fprintf(file, " 'wall");
+ }
+ if (flags & MapFieldRocks) {
+ fprintf(file, " 'rock");
+ }
+ if (flags & MapFieldForest) {
+ fprintf(file, " 'forest");
+ }
+ if (flags & MapFieldLandUnit) {
+ fprintf(file, " 'land-unit");
+ }
+ if (flags & MapFieldAirUnit) {
+ fprintf(file, " 'air-unit");
+ }
+ if (flags & MapFieldSeaUnit) {
+ fprintf(file, " 'sea-unit");
+ }
+ if (flags & MapFieldBuilding) {
+ fprintf(file, " 'building");
+ }
+ if (flags & MapFieldHuman) {
+ fprintf(file, " 'human");
+ }
+}
+
+/**
+** Save solid part of tileset.
+**
+** @param file File handle to save the solid part.
+** @param table Tile numbers.
+** @param name Ascii name of solid tile
+** @param flags Tile attributes.
+** @param start Start index into table.
+*/
+local void SaveTilesetSolid(FILE* file, const unsigned short* table,
+ const char* name, unsigned flags, int start)
+{
+ int i;
+ int j;
+ int n;
+
+ fprintf(file, " 'solid (list \"%s\"", name);
+ SaveTilesetFlags(file, flags);
+ // Remove empty tiles at end of block
+ for (n = 15; n >= 0 && !table[start + n]; n--) {
+ }
+ i = fprintf(file, "\n #(");
+ for (j = 0; j <= n; ++j) {
+ i += fprintf(file, " %3d", table[start + j]);
+ }
+ i += fprintf(file, "))");
+
+ while ((i += 8) < 80) {
+ fprintf(file, "\t");
+ }
+ fprintf(file, "; %03X\n", start);
+}
+
+/**
+** Save mixed part of tileset.
+**
+** @param file File handle to save the mixed part.
+** @param table Tile numbers.
+** @param name1 First ascii name of mixed tiles.
+** @param name2 Second Ascii name of mixed tiles.
+** @param flags Tile attributes.
+** @param start Start index into table.
+** @param end End of tiles.
+*/
+local void SaveTilesetMixed(FILE* file, const unsigned short* table,
+ const char* name1, const char* name2, unsigned flags, int start, int end)
+{
+ int x;
+ int i;
+ int j;
+ int n;
+
+ fprintf(file, " 'mixed (list \"%s\" \"%s\"", name1, name2);
+ SaveTilesetFlags(file, flags);
+ fprintf(file,"\n");
+ for (x = 0; x < 0x100; x += 0x10) {
+ if (start + x >= end) { // Check end must be 0x10 aligned
+ break;
+ }
+ fprintf(file, " #(");
+ // Remove empty slots at end of table
+ for (n = 15; n >= 0 && !table[start + x + n]; n--) {
+ }
+ i = 6;
+ for (j = 0; j <= n; ++j) {
+ i += fprintf(file, " %3d", table[start + x + j]);
+ }
+ if (x == 0xF0 ) {
+ i += fprintf(file, "))");
+ } else {
+ i += fprintf(file, ")");
+ }
+
+ while ((i += 8) < 80) {
+ fprintf(file, "\t");
+ }
+ fprintf(file, "; %03X\n", start + x);
+ }
+}
+
+/**
+** Save the tileset.
+**
+** @param file Output file.
+** @param tileset Save the content of this tileset.
+*/
+local void SaveTileset(FILE* file, const Tileset* tileset)
+{
+ const unsigned short* table;
+ int i;
+ int n;
+
+ fprintf(file, "\n(define-tileset\n '%s 'class '%s", tileset->Ident,
+ tileset->Class);
+ fprintf(file, "\n 'name \"%s\"", tileset->Name);
+ fprintf(file, "\n 'image \"%s\"", tileset->ImageFile);
+ fprintf(file, "\n 'palette \"%s\"", tileset->PaletteFile);
+ fprintf(file, "\n ;; Slots descriptions");
+ fprintf(file,
+ "\n 'slots (list\n 'special (list\t\t;; Can't be in pud\n");
+ fprintf(file, " 'extra-trees #( %d %d %d %d %d %d )\n",
+ tileset->ExtraTrees[0], tileset->ExtraTrees[1]
+ , tileset->ExtraTrees[2], tileset->ExtraTrees[3]
+ , tileset->ExtraTrees[4], tileset->ExtraTrees[5]);
+ fprintf(file, " 'top-one-tree %d 'mid-one-tree %d 'bot-one-tree %d\n",
+ tileset->TopOneTree, tileset->MidOneTree, tileset->BotOneTree);
+ fprintf(file, " 'removed-tree %d\n", tileset->RemovedTree);
+ fprintf(file, " 'growing-tree #( %d %d )\n", tileset->GrowingTree[0],
+ tileset->GrowingTree[1]);
+ fprintf(file, " 'extra-rocks #( %d %d %d %d %d %d )\n",
+ tileset->ExtraRocks[0], tileset->ExtraRocks[1]
+ , tileset->ExtraRocks[2], tileset->ExtraRocks[3]
+ , tileset->ExtraRocks[4], tileset->ExtraRocks[5]);
+ fprintf(file, " 'top-one-rock %d 'mid-one-rock %d 'bot-one-rock %d\n",
+ tileset->TopOneRock, tileset->MidOneRock, tileset->BotOneRock);
+ fprintf(file, " 'removed-rock %d )\n", tileset->RemovedRock);
+
+ table = tileset->Table;
+ n = tileset->NumTiles;
+
+ for (i = 0; i < n;) {
+ //
+ // Mixeds
+ //
+ if (tileset->BasicNameTable[i] && tileset->MixedNameTable[i]) {
+ SaveTilesetMixed(file, table,
+ tileset->TileNames[tileset->BasicNameTable[i]],
+ tileset->TileNames[tileset->MixedNameTable[i]],
+ tileset->FlagsTable[i], i, n);
+ i += 256;
+ //
+ // Solids
+ //
+ } else {
+ SaveTilesetSolid(file, table,
+ tileset->TileNames[tileset->BasicNameTable[i]],
+ tileset->FlagsTable[i], i);
+ i += 16;
+ }
+ }
+ fprintf(file, " )\n");
+ fprintf(file, " ;; Animated tiles\n");
+ fprintf(file, " 'animations (list #( ) )\n");
+ fprintf(file, " 'objects (list #( ) ))\n");
+}
+
+/**
+** Save the current tileset module.
+**
+** @param file Output file.
+*/
+global void SaveTilesets(FILE* file)
+{
+ int i;
+ char** sp;
+
+ fprintf(file, "\n;;; -----------------------------------------\n");
+ fprintf(file,
+ ";;; MODULE: tileset $Id: tileset.c,v 1.49 2003/08/09 20:08:38
martinxyz Exp $\n\n");
+
+ // Original number to internal tileset name
+
+ i = fprintf(file, "(define-tileset-wc-names");
+ for (sp = TilesetWcNames; *sp; ++sp) {
+ if (i + strlen(*sp) > 79) {
+ i = fprintf(file, "\n ");
+ }
+ i += fprintf(file, " '%s", *sp);
+ }
+ fprintf(file, ")\n");
+
+ // Save all loaded tilesets
+
+ for (i = 0; i < NumTilesets; ++i) {
+ SaveTileset(file, Tilesets[i]);
+ }
+}
/**
** Cleanup the tileset module.
Index: stratagus/src/missile/missile.c
diff -u stratagus/src/missile/missile.c:1.74
stratagus/src/missile/missile.c:1.75
--- stratagus/src/missile/missile.c:1.74 Fri Aug 8 06:16:44 2003
+++ stratagus/src/missile/missile.c Sat Aug 9 16:08:38 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: missile.c,v 1.74 2003/08/08 10:16:44 martinxyz Exp $
+// $Id: missile.c,v 1.75 2003/08/09 20:08:38 martinxyz Exp $
//@{
@@ -1511,6 +1511,75 @@
}
/**
+** Save the missile-types to file.
+**
+** @param file Output file.
+**
+** @todo FIXME: CanHitOwner and FriendlyFire not supported!
+*/
+global void SaveMissileTypes(FILE* file)
+{
+ MissileType* mtype;
+ char** sp;
+ int i;
+
+ fprintf(file,"\n;;; -----------------------------------------\n");
+ fprintf(file,";;; MODULE: missile-types $Id: missile.c,v 1.75 2003/08/09
20:08:38 martinxyz Exp $\n\n");
+
+ //
+ // Original number to internal missile-type name.
+ //
+ i=fprintf(file,"(define-missiletype-wc-names");
+ for( sp=MissileTypeWcNames; *sp; ++sp ) {
+ if( i+strlen(*sp)>79 ) {
+ i=fprintf(file,"\n ");
+ }
+ i+=fprintf(file," '%s",*sp);
+ }
+ fprintf(file,")\n\n");
+
+ //
+ // Missile types
+ //
+ for( mtype=MissileTypes; mtype<&MissileTypes[NumMissileTypes]; ++mtype ) {
+ fprintf(file,"(define-missile-type '%s\n ",mtype->Ident);
+ if( mtype->File ) {
+ fprintf(file," 'file \"%s\"",mtype->File);
+ }
+ fprintf(file," 'size '(%d %d)",mtype->Width,mtype->Height);
+ if( mtype->Sprite ) {
+ fprintf(file," 'frames %d",mtype->SpriteFrames);
+ }
+ fprintf(file,"\n 'num-directions %d",mtype->NumDirections);
+ fprintf(file,"\n ");
+ if( mtype->FiredSound.Name ) {
+ fprintf(file," 'fired-sound \"%s\"",mtype->FiredSound.Name);
+ }
+ if( mtype->ImpactSound.Name ) {
+ fprintf(file," 'impact-sound \"%s\"",mtype->ImpactSound.Name);
+ }
+ if( mtype->FiredSound.Name || mtype->ImpactSound.Name ) {
+ fprintf(file,"\n ");
+ }
+ fprintf(file," 'class '%s",MissileClassNames[mtype->Class]);
+ fprintf(file," 'draw-level %d ",mtype->DrawLevel);
+ if( mtype->StartDelay ) {
+ fprintf(file," 'delay %d",mtype->StartDelay);
+ }
+ fprintf(file," 'sleep %d",mtype->Sleep);
+ fprintf(file," 'speed %d",mtype->Speed);
+ fprintf(file," 'range %d",mtype->Range);
+ if( mtype->ImpactMissile ) {
+ fprintf(file,"\n 'impact-missile '%s",mtype->ImpactMissile->Ident);
+ }
+ fprintf(file,"\n ");
+ fprintf(file," 'can-hit-owner #%c",mtype->CanHitOwner ? 't' : 'f');
+ fprintf(file," 'friendly-fire #%c",mtype->FriendlyFire ? 't' : 'f');
+ fprintf(file,")\n");
+ }
+}
+
+/**
** Save the state of a missile to file.
*/
local void SaveMissile(const Missile* missile,FILE* file)
@@ -1550,7 +1619,7 @@
Missile* const* missiles;
fprintf(file,"\n;;; -----------------------------------------\n");
- fprintf(file,";;; MODULE: missiles $Id: missile.c,v 1.74 2003/08/08
10:16:44 martinxyz Exp $\n\n");
+ fprintf(file,";;; MODULE: missiles $Id: missile.c,v 1.75 2003/08/09
20:08:38 martinxyz Exp $\n\n");
for( missiles=GlobalMissiles; *missiles; ++missiles ) {
SaveMissile(*missiles,file);
Index: stratagus/src/ui/icons.c
diff -u stratagus/src/ui/icons.c:1.43 stratagus/src/ui/icons.c:1.44
--- stratagus/src/ui/icons.c:1.43 Fri Aug 8 06:16:44 2003
+++ stratagus/src/ui/icons.c Sat Aug 9 16:08:39 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: icons.c,v 1.43 2003/08/08 10:16:44 martinxyz Exp $
+// $Id: icons.c,v 1.44 2003/08/09 20:08:39 martinxyz Exp $
//@{
@@ -415,6 +415,58 @@
VideoDrawRectangleClip(ColorGreen, x, y, width, height);
} else if (flags & IconAutoCast) {
VideoDrawRectangleClip(ColorBlue, x, y, width, height);
+ }
+}
+
+/**
+** Save state of the icons to file.
+**
+** @param file Output file.
+*/
+global void SaveIcons(FILE* file)
+{
+ char* const* cp;
+ int i;
+
+ fprintf(file, "\n;;; -----------------------------------------\n");
+ fprintf(file, ";;; MODULE: icons $Id: icons.c,v 1.44 2003/08/09 20:08:39
martinxyz Exp $\n\n");
+
+ //
+ // Mapping the original icon numbers in puds to our internal strings
+ //
+ if ((cp = IconWcNames)) {
+ fprintf(file, "(define-icon-wc-names");
+
+ i = 90;
+ while (*cp) {
+ if (i + strlen(*cp) > 79) {
+ i = fprintf(file, "\n ");
+ }
+ i += fprintf(file, " '%s", *cp++);
+ }
+ fprintf(file, ")\n\n");
+ }
+
+ //
+ // Icons
+ //
+ for (i = 0; i < NumIcons; ++i) {
+ fprintf(file, "(define-icon '%s", Icons[i]->Ident);
+ if (Icons[i]->Tileset) {
+ fprintf(file, " 'tileset '%s", Icons[i]->Tileset);
+ }
+ fprintf(file, "\n 'size '(%d %d) 'normal '(%d \"%s\"))\n",
+ Icons[i]->Width, Icons[i]->Height,
+ Icons[i]->Index, Icons[i]->File->FileName);
+ }
+ fprintf(file, "\n");
+
+ //
+ // Icons aliases
+ //
+ for (i = 0; i < NumIconAliases; ++i) {
+ fprintf(file, "(define-icon-alias '%s '%s)\n",
+ IconAliases[i * 2 + 0], IconAliases[i * 2 + 1]);
}
}
Index: stratagus/src/ui/ui.c
diff -u stratagus/src/ui/ui.c:1.70 stratagus/src/ui/ui.c:1.71
--- stratagus/src/ui/ui.c:1.70 Fri Aug 8 06:16:44 2003
+++ stratagus/src/ui/ui.c Sat Aug 9 16:08:39 2003
@@ -27,7 +27,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: ui.c,v 1.70 2003/08/08 10:16:44 martinxyz Exp $
+// $Id: ui.c,v 1.71 2003/08/09 20:08:39 martinxyz Exp $
//@{
@@ -295,6 +295,188 @@
}
/**
+** Save the UI structure.
+**
+** @param file Save file handle
+** @param ui User interface to save
+*/
+local void SaveUi(FILE* file,const UI* ui)
+{
+ int i;
+ MenuPanel* menupanel;
+
+ fprintf(file,"(define-ui '%s %d %d\t; Selector",
+ ui->Name,ui->Width,ui->Height);
+
+ fprintf(file,"\n 'normal-font-color '%s"
+ "\n 'reverse-font-color '%s",
+ ui->NormalFontColor, ui->ReverseFontColor);
+ fprintf(file,"\n");
+
+ fprintf(file,"\n 'filler (list");
+ fprintf(file,"\n 'file \"%s\"",ui->Filler[0].File);
+ fprintf(file,"\n 'pos '(%3d %3d)",ui->FillerX[0],ui->FillerY[0]);
+ fprintf(file,")\n");
+
+ fprintf(file,"\n ; Resource line");
+ fprintf(file,"\n 'resource-line (list \"%s\" %d %d)",
+ ui->Resource.File,ui->ResourceX,ui->ResourceY);
+
+ fprintf(file,"\n 'resources (list");
+ for( i=1; i<MaxCosts+2; ++i ) {
+ if( !ui->Resources[i].Icon.File ) {
+ continue;
+ }
+ fprintf(file,"\n '%s",
+ i<MaxCosts ? DefaultResourceNames[i] :
+ i==FoodCost ? "food" : "score");
+ fprintf(file," (list 'file \"%s\" 'row %d\n"
+ " 'pos '(%d %d) 'size '(%d %d) 'text-pos '(%d %d))",
+ ui->Resources[i].Icon.File,ui->Resources[i].IconRow,
+ ui->Resources[i].IconX,ui->Resources[i].IconY,
+ ui->Resources[i].IconW,ui->Resources[i].IconH,
+ ui->Resources[i].TextX,ui->Resources[i].TextY);
+ }
+ fprintf(file,")\n");
+
+ fprintf(file," 'info-panel (list \"%s\" %d %d %d %d)\n",
+ ui->InfoPanel.File,
+ ui->InfoPanelX,ui->InfoPanelY,
+ ui->InfoPanelW,ui->InfoPanelH);
+
+ fprintf(file,"\n 'completed-bar '(");
+ fprintf(file,"\n color %d",ui->CompleteBarColor);
+ fprintf(file,"\n pos (%3d %3d)",ui->CompleteBarX,ui->CompleteBarY);
+ fprintf(file,"\n size (%d %d)",ui->CompleteBarW,ui->CompleteBarH);
+ fprintf(file,"\n text \"%s\"",ui->CompleteBarText);
+ fprintf(file,"\n font %s",FontNames[ui->CompleteBarFont]);
+ fprintf(file,"\n text-pos (%3d %3d)",
+ ui->CompleteTextX,ui->CompleteTextY);
+ fprintf(file,")\n\n");
+
+ fprintf(file," 'button-panel (list \"%s\" %d %d)\n",
+ ui->ButtonPanel.File,ui->ButtonPanelX,ui->ButtonPanelY);
+
+ fprintf(file,"\n 'map-area (list");
+ fprintf(file,"\n 'pos '(%3d %3d)",
+ ui->MapArea.X, ui->MapArea.Y);
+ fprintf(file,"\n 'size '(%d %d)",
+ ui->MapArea.EndX-ui->MapArea.X+1,
+ ui->MapArea.EndY-ui->MapArea.Y+1);
+ fprintf(file,")\n\n");
+
+ fprintf(file," ; Menu button background\n");
+ fprintf(file," 'menu-panel (list \"%s\" %d %d)\n",
+ ui->MenuButtonGraphic.File,ui->MenuButtonGraphicX,
+ ui->MenuButtonGraphicY);
+
+ fprintf(file," ; Minimap background\n");
+ fprintf(file," 'minimap-panel (list \"%s\" %d %d)\n",
+ ui->MinimapPanel.File,ui->MinimapPanelX,ui->MinimapPanelY);
+ fprintf(file," ; Minimap position\n");
+ fprintf(file," 'minimap-pos (list %d %d)\n",
+ ui->MinimapPosX,ui->MinimapPosY);
+
+ fprintf(file,"\n 'status-line '(");
+ fprintf(file,"\n file \"%s\"",ui->StatusLine.File);
+ fprintf(file,"\n pos (%d %d)",ui->StatusLineX,ui->StatusLineY);
+ fprintf(file,"\n text-pos (%d %d)",
+ ui->StatusLineTextX,ui->StatusLineTextY);
+ fprintf(file,"\n font %s",FontNames[ui->StatusLineFont]);
+ fprintf(file,")\n");
+
+ fprintf(file,"\n 'menu-button '(");
+ fprintf(file,"\n pos (%d %d)",
+ ui->MenuButton.X,ui->MenuButton.Y);
+ fprintf(file,"\n size (%d %d)",
+ ui->MenuButton.Width,ui->MenuButton.Height);
+ fprintf(file,"\n caption \"%s\"",
+ ui->MenuButton.Text);
+ fprintf(file,"\n style %s",
+ MenuButtonStyle(ui->MenuButton.Button));
+ fprintf(file,")");
+
+ fprintf(file,"\n 'network-menu-button '(");
+ fprintf(file,"\n pos (%d %d)",
+ ui->NetworkMenuButton.X,ui->NetworkMenuButton.Y);
+ fprintf(file,"\n size (%d %d)",
+ ui->NetworkMenuButton.Width,ui->NetworkMenuButton.Height);
+ fprintf(file,"\n caption \"%s\"",
+ ui->NetworkMenuButton.Text);
+ fprintf(file,"\n style %s",
+ MenuButtonStyle(ui->NetworkMenuButton.Button));
+ fprintf(file,")");
+
+ fprintf(file,"\n 'network-diplomacy-button '(");
+ fprintf(file,"\n pos (%d %d)",
+ ui->NetworkDiplomacyButton.X,ui->NetworkDiplomacyButton.Y);
+ fprintf(file,"\n size (%d %d)",
+ ui->NetworkDiplomacyButton.Width,ui->NetworkDiplomacyButton.Height);
+ fprintf(file,"\n caption \"%s\"",
+ ui->NetworkDiplomacyButton.Text);
+ fprintf(file,"\n style %s",
+ MenuButtonStyle(ui->NetworkDiplomacyButton.Button));
+ fprintf(file,")");
+
+ fprintf(file,"\n\n 'info-buttons '(");
+ for( i=0; i<ui->NumInfoButtons; ++i ) {
+ fprintf(file,"\n (pos (%3d %3d) size (%d %d))",
+ ui->InfoButtons[i].X,ui->InfoButtons[i].Y,
+ ui->InfoButtons[i].Width,ui->InfoButtons[i].Height);
+ }
+ fprintf(file,")");
+ fprintf(file,"\n 'training-buttons '(");
+ for( i=0; i<ui->NumTrainingButtons; ++i ) {
+ fprintf(file,"\n (pos (%3d %3d) size (%d %d))",
+ ui->TrainingButtons[i].X,ui->TrainingButtons[i].Y,
+ ui->TrainingButtons[i].Width,ui->TrainingButtons[i].Height);
+ }
+ fprintf(file,")");
+ fprintf(file,"\n 'button-buttons '(");
+ for( i=0; i<ui->NumButtonButtons; ++i ) {
+ fprintf(file,"\n (pos (%3d %3d) size (%d %d))",
+ ui->ButtonButtons[i].X,ui->ButtonButtons[i].Y,
+ ui->ButtonButtons[i].Width,ui->ButtonButtons[i].Height);
+ }
+ fprintf(file,")");
+
+ fprintf(file,"\n\n 'cursors '(");
+ fprintf(file,"\n point %s", ui->Point.Name);
+ fprintf(file,"\n glass %s", ui->Glass.Name);
+ fprintf(file,"\n cross %s", ui->Cross.Name);
+ fprintf(file,"\n yellow %s", ui->YellowHair.Name);
+ fprintf(file,"\n green %s", ui->GreenHair.Name);
+ fprintf(file,"\n red %s", ui->RedHair.Name);
+ fprintf(file,"\n scroll %s", ui->Scroll.Name);
+
+ fprintf(file,"\n arrow-e %s", ui->ArrowE.Name);
+ fprintf(file,"\n arrow-ne %s", ui->ArrowNE.Name);
+ fprintf(file,"\n arrow-n %s", ui->ArrowN.Name);
+ fprintf(file,"\n arrow-nw %s", ui->ArrowNW.Name);
+ fprintf(file,"\n arrow-w %s", ui->ArrowW.Name);
+ fprintf(file,"\n arrow-sw %s", ui->ArrowSW.Name);
+ fprintf(file,"\n arrow-s %s", ui->ArrowS.Name);
+ fprintf(file,"\n arrow-se %s", ui->ArrowSE.Name);
+ fprintf(file,")\n");
+
+ fprintf(file,"\n 'menu-panels '(");
+ menupanel=ui->MenuPanels;
+ while( menupanel ) {
+ fprintf(file,"\n %s \"%s\"",
+ menupanel->Ident,menupanel->Panel.File);
+ menupanel=menupanel->Next;
+ }
+ fprintf(file,")\n");
+
+ fprintf(file,"\n 'victory-background \"%s\"",
+ ui->VictoryBackground.File);
+ fprintf(file,"\n 'defeat-background \"%s\"",
+ ui->DefeatBackground.File);
+
+ fprintf(file," )\n\n");
+}
+
+/**
** Save the viewports.
**
** @param file Save file handle
@@ -320,8 +502,33 @@
*/
global void SaveUserInterface(FILE* file)
{
+ int i;
+
fprintf(file,"\n;;; -----------------------------------------\n");
- fprintf(file,";;; MODULE: ui $Id: ui.c,v 1.70 2003/08/08 10:16:44
martinxyz Exp $\n\n");
+ fprintf(file,";;; MODULE: ui $Id: ui.c,v 1.71 2003/08/09 20:08:39
martinxyz Exp $\n\n");
+
+ // Contrast, Brightness, Saturation
+ fprintf(file,"(set-contrast! %d)\n",TheUI.Contrast);
+ fprintf(file,"(set-brightness! %d)\n",TheUI.Brightness);
+ fprintf(file,"(set-saturation! %d)\n\n",TheUI.Saturation);
+ // Scrolling
+ fprintf(file,"(set-mouse-scroll! %s)\n",TheUI.MouseScroll ? "#t" : "#f");
+ fprintf(file,"(set-mouse-scroll-speed! %d)\n",SpeedMouseScroll);
+ fprintf(file,"(set-key-scroll! %s)\n",TheUI.KeyScroll ? "#t" : "#f");
+ fprintf(file,"(set-key-scroll-speed! %d)\n",SpeedKeyScroll);
+ fprintf(file,"(set-reverse-map-move! %s)\n\n",
+ TheUI.ReverseMouseMove ? "#t" : "#f");
+
+ fprintf(file,"(set-mouse-adjust! %d)\n",TheUI.MouseAdjust);
+ fprintf(file,"(set-mouse-scale! %d)\n\n",TheUI.MouseScale);
+
+ fprintf(file,"(set-original-resources! %s)\n\n",
+ TheUI.OriginalResources ? "#t" : "#f");
+
+ // Save the UIs for all resolutions
+ for( i=0; UI_Table[i]; ++i ) {
+ SaveUi(file,UI_Table[i]);
+ }
SaveViewports(file,&TheUI);
}
Index: stratagus/src/unit/depend.c
diff -u stratagus/src/unit/depend.c:1.27 stratagus/src/unit/depend.c:1.28
--- stratagus/src/unit/depend.c:1.27 Fri Aug 8 06:16:44 2003
+++ stratagus/src/unit/depend.c Sat Aug 9 16:08:39 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: depend.c,v 1.27 2003/08/08 10:16:44 martinxyz Exp $
+// $Id: depend.c,v 1.28 2003/08/09 20:08:39 martinxyz Exp $
//@{
@@ -270,6 +270,69 @@
** Initialize unit and upgrade dependencies.
*/
global void InitDependencies(void){}
+
+/**
+** Save state of the dependencies to file.
+**
+** @param file Output file.
+*/
+global void SaveDependencies(FILE* file)
+{
+ unsigned u;
+ const DependRule* node;
+ const DependRule* rule;
+ const DependRule* temp;
+
+ fprintf(file,"\n;;; -----------------------------------------\n");
+ fprintf(file,";;; MODULE: dependencies $Id: depend.c,v 1.28 2003/08/09
20:08:39 martinxyz Exp $\n\n");
+
+ // Save all dependencies
+
+ for( u=0; u<sizeof(DependHash)/sizeof(*DependHash); ++u ) {
+ node=DependHash[u];
+ while( node ) { // all hash links
+ fprintf(file,"(define-dependency '");
+ switch( node->Type ) {
+ case DependRuleUnitType:
+ fprintf(file,"%s",node->Kind.UnitType->Ident);
+ break;
+ case DependRuleUpgrade:
+ fprintf(file,"%s",node->Kind.Upgrade->Ident);
+ break;
+ }
+ // All or cases
+
+ fprintf(file,"\n '(");
+ rule=node->Rule;
+ for( ;; ) {
+ temp=rule;
+ while( temp ) {
+ switch( temp->Type ) {
+ case DependRuleUnitType:
+ fprintf(file,"%s",temp->Kind.UnitType->Ident);
+ break;
+ case DependRuleUpgrade:
+ fprintf(file,"%s",temp->Kind.Upgrade->Ident);
+ break;
+ }
+ temp=temp->Rule;
+ if( temp ) {
+ fprintf(file," ");
+ }
+ }
+ fprintf(file,")");
+ if( !(rule=rule->Next) ) {
+ break;
+ }
+ fprintf(file,"\n 'or '( ");
+ }
+
+ fprintf(file,")\n");
+
+ node=node->Next;
+ }
+ }
+}
/**
** Clean up unit and upgrade dependencies.
Index: stratagus/src/unit/unittype.c
diff -u stratagus/src/unit/unittype.c:1.81 stratagus/src/unit/unittype.c:1.82
--- stratagus/src/unit/unittype.c:1.81 Fri Aug 8 15:31:37 2003
+++ stratagus/src/unit/unittype.c Sat Aug 9 16:08:39 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: unittype.c,v 1.81 2003/08/08 19:31:37 n0body Exp $
+// $Id: unittype.c,v 1.82 2003/08/09 20:08:39 martinxyz Exp $
//@{
@@ -588,7 +588,6 @@
}
/**
-<<<<<<< unittype.c
** Save state of the animitions set to file.
**
** We save only the first occurance of an animation.
@@ -980,8 +979,6 @@
}
/**
-=======
->>>>>>> 1.80
** Save state of an unit-stats to file.
**
** @param stats Unit-stats to save.
@@ -1031,7 +1028,7 @@
char **sp;
fprintf(file,"\n;;; -----------------------------------------\n");
- fprintf(file,";;; MODULE: unittypes $Id: unittype.c,v 1.81 2003/08/08
19:31:37 n0body Exp $\n\n");
+ fprintf(file,";;; MODULE: unittypes $Id: unittype.c,v 1.82 2003/08/09
20:08:39 martinxyz Exp $\n\n");
// Original number to internal unit-type name.
Index: stratagus/src/unit/upgrade.c
diff -u stratagus/src/unit/upgrade.c:1.56 stratagus/src/unit/upgrade.c:1.57
--- stratagus/src/unit/upgrade.c:1.56 Fri Aug 8 06:16:44 2003
+++ stratagus/src/unit/upgrade.c Sat Aug 9 16:08:39 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: upgrade.c,v 1.56 2003/08/08 10:16:44 martinxyz Exp $
+// $Id: upgrade.c,v 1.57 2003/08/09 20:08:39 martinxyz Exp $
//@{
@@ -550,7 +550,7 @@
int p;
fprintf(file,"\n;;; -----------------------------------------\n");
- fprintf(file,";;; MODULE: upgrades $Id: upgrade.c,v 1.56 2003/08/08
10:16:44 martinxyz Exp $\n\n");
+ fprintf(file,";;; MODULE: upgrades $Id: upgrade.c,v 1.57 2003/08/09
20:08:39 martinxyz Exp $\n\n");
/* remove?
//
@@ -568,7 +568,20 @@
fprintf(file,"\n");
*/
- // FIXME: can at least partially be removed
+ //
+ // Save all upgrades
+ //
+ for( i=0; i<NumUpgrades; ++i ) {
+ fprintf(file,"(define-upgrade '%s 'icon '%s\n"
+ ,Upgrades[i].Ident,Upgrades[i].Icon.Name);
+ fprintf(file," 'costs #(");
+ for( j=0; j<MaxCosts; ++j ) {
+ fprintf(file," %5d",Upgrades[i].Costs[j]);
+ }
+
+ fprintf(file,"))\n");
+ }
+ fprintf(file,"\n");
//
// Save all upgrade modifiers.
Index: stratagus/src/video/cursor.c
diff -u stratagus/src/video/cursor.c:1.60 stratagus/src/video/cursor.c:1.61
--- stratagus/src/video/cursor.c:1.60 Fri Aug 8 06:16:44 2003
+++ stratagus/src/video/cursor.c Sat Aug 9 16:08:39 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: cursor.c,v 1.60 2003/08/08 10:16:44 martinxyz Exp $
+// $Id: cursor.c,v 1.61 2003/08/09 20:08:39 martinxyz Exp $
//@{
@@ -74,11 +74,7 @@
global CursorStates CursorState;/// current cursor state (point,...)
global int CursorAction; /// action for selection
-#ifndef NEW_UI
global int CursorValue; /// value for CursorAction (spell type
f.e.)
-#else
-global int CursorSpell; /// spell type while selecting target
-#endif
//Event changed mouse position, can alter at any moment
global int CursorX; /// cursor position on screen X
@@ -1107,13 +1103,12 @@
/**
** Save cursor state.
*/
-/* should not be necessary
global void SaveCursors(FILE* file)
{
int i;
fprintf(file,"\n;;; -----------------------------------------\n");
- fprintf(file,";;; MODULE: cursors $Id: cursor.c,v 1.60 2003/08/08 10:16:44
martinxyz Exp $\n\n");
+ fprintf(file,";;; MODULE: cursors $Id: cursor.c,v 1.61 2003/08/09 20:08:39
martinxyz Exp $\n\n");
for( i=0; Cursors[i].OType; ++i ) {
fprintf(file,"(define-cursor '%s '%s\n",
@@ -1147,7 +1142,6 @@
fprintf(file,";;(unit-under-cursor %s\n",
UnitUnderCursor ? UnitReference(UnitUnderCursor) : "()");
}
-*/
/**
** Cleanup cursor module
Index: stratagus/src/video/graphic.c
diff -u stratagus/src/video/graphic.c:1.43 stratagus/src/video/graphic.c:1.44
--- stratagus/src/video/graphic.c:1.43 Fri Jul 11 10:35:34 2003
+++ stratagus/src/video/graphic.c Sat Aug 9 16:08:39 2003
@@ -26,7 +26,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: graphic.c,v 1.43 2003/07/11 14:35:34 n0body Exp $
+// $Id: graphic.c,v 1.44 2003/08/09 20:08:39 martinxyz Exp $
//@{
@@ -717,8 +717,12 @@
char buf[1024];
if (!(graphic = LoadGraphicPNG(LibraryFileName(name, buf)))) {
+ /*
fprintf(stderr, "Can't load the graphic `%s'\n", name);
ExitFatal(-1);
+ */
+ name = NULL; // force crash
+ fprintf(stderr, "Can't load the graphic `%s'\n", name);
}
graphic->Pixels = VideoCreateSharedPalette(graphic->Palette);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Stratagus-CVS] stratagus doc/ChangeLog.html src/clone/construc...,
Martin Renold <=