stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src/game campaign.c game.c intro.c lo...


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src/game campaign.c game.c intro.c lo...
Date: 21 Dec 2003 21:51:32 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       03/12/21 21:51:31

Modified files:
        src/game       : campaign.c game.c intro.c loadgame.c savegame.c 
                         trigger.c 

Log message:
        Tabs Cleanup

Patches:
Index: stratagus/src/game/campaign.c
diff -u stratagus/src/game/campaign.c:1.39 stratagus/src/game/campaign.c:1.40
--- stratagus/src/game/campaign.c:1.39  Sat Dec 20 16:33:24 2003
+++ stratagus/src/game/campaign.c       Sun Dec 21 21:51:30 2003
@@ -5,12 +5,12 @@
 //     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
 //             \/                  \/          \//_____/            \/
 //  ______________________                           ______________________
-//                       T H E   W A R   B E G I N S
-//        Stratagus - A free fantasy real time strategy game engine
+//                        T H E   W A R   B E G I N S
+//         Stratagus - A free fantasy real time strategy game engine
 //
-/address@hidden campaign.c     -       The campaign control. */
+/address@hidden campaign.c - The campaign control. */
 //
-//     (c) Copyright 2002-2003 by Lutz Sammer and Jimmy Salmon
+//      (c) Copyright 2002-2004 by Lutz Sammer and Jimmy Salmon
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU General Public License as published by
@@ -26,17 +26,18 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: campaign.c,v 1.39 2003/12/20 05:33:24 jsalmon3 Exp $
+//      $Id: campaign.c,v 1.40 2003/12/21 10:51:30 wizzard Exp $
 
 //@{
 
 /*----------------------------------------------------------------------------
---             Includes
+--  Includes
 ----------------------------------------------------------------------------*/
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+
 #include "stratagus.h"
 #include "ccl.h"
 #include "unittype.h"
@@ -47,36 +48,36 @@
 #include "font.h"
 
 /*----------------------------------------------------------------------------
---             Declarations
+--  Declarations
 ----------------------------------------------------------------------------*/
 
 /*----------------------------------------------------------------------------
---             Variables
+--  Variables
 ----------------------------------------------------------------------------*/
 
 global char DefaultObjective[] = "-Destroy your enemies";
 
-global int GameResult;                                         /// Outcome of 
the game
-global char CurrentMapPath[1024];              /// Path of the current map
+global int GameResult;  /// Outcome of the game
+global char CurrentMapPath[1024];  /// Path of the current map
 global char DefaultMap[1024] = "puds/default.pud";  /// Default map path
-global int RestartScenario;                            /// Restart the scenario
-global int QuitToMenu;                                         /// Quit to menu
-global Campaign* Campaigns;                            /// Campaigns
-global int NumCampaigns;                               /// Number of campaigns
-
-local Campaign* CurrentCampaign;               /// Playing this campaign
-local CampaignChapter* CurrentChapter;         /// Playing this chapter of 
campaign
-local int SkipCurrentChapter = 1;              /// Skip the current chapter 
when
-                                                                               
/// looking for the next one
+global int RestartScenario;  /// Restart the scenario
+global int QuitToMenu;  /// Quit to menu
+global Campaign* Campaigns;  /// Campaigns
+global int NumCampaigns;  /// Number of campaigns
+
+local Campaign* CurrentCampaign;        /// Playing this campaign
+local CampaignChapter* CurrentChapter;  /// Playing this chapter of campaign
+local int SkipCurrentChapter = 1;       /// Skip the current chapter when
+                                        /// looking for the next one
 
 /*----------------------------------------------------------------------------
---             Functions
+--  Functions
 ----------------------------------------------------------------------------*/
 
 /**
-**             Return filename of next chapter.
+**  Return filename of next chapter.
 **
-**             @return                         The filename of the next level
+**  @return  The filename of the next level
 */
 global char* NextChapter(void)
 {
@@ -100,7 +101,7 @@
 
        if (GameResult == GameVictory) {
                //
-               //  FIXME: do other chapter types.
+               // FIXME: do other chapter types.
                //
                if (SkipCurrentChapter) {
                        CurrentChapter = CurrentChapter->Next;
@@ -126,10 +127,11 @@
 }
 
 /**
-**             Play the campaign.
+**  Play the campaign.
+**
+**  @param name  Name of the campaign.
 **
-**             @param name             Name of the campaign.
-**             @note                           ::CurrentMapPath contains the 
filename of first level.
+**  @note  ::CurrentMapPath contains the filename of first level.
 */
 global void PlayCampaign(const char* name)
 {
@@ -137,7 +139,7 @@
        int i;
 
        //
-       //  Find the campaign.
+       // Find the campaign.
        //
        for (i = 0; i < NumCampaigns; ++i) {
                if (!strcmp(Campaigns[i].Ident, name)) {
@@ -174,10 +176,10 @@
 }
 
 /**
-**             Parse campaign show-picture.
+**  Parse campaign show-picture.
 **
-**             @param chapter                  Chapter.
-**             @param list                     List describing show-picture.
+**  @param chapter  Chapter.
+**  @param list     List describing show-picture.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local void ParseShowPicture(CampaignChapter* chapter, SCM list)
@@ -361,9 +363,9 @@
 #endif
 
 /**
-**             Free campaign chapters.
+**  Free campaign chapters.
 **
-**             @param chapters                 Chapters to be freed.
+**  @param chapters  Chapters to be freed.
 */
 local void FreeChapters(CampaignChapter** chapters)
 {
@@ -396,11 +398,11 @@
 }
 
 /**
-**             Define a campaign.
+**  Define a campaign.
 **
-**             @param list             List describing the campaign.
+**  @param list  List describing the campaign.
 **
-**             @note FIXME: play-video, defeat, draw are missing.
+**  @note FIXME: play-video, defeat, draw are missing.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclDefineCampaign(SCM list)
@@ -453,7 +455,7 @@
        tail = &campaign->Chapters;
 
        //
-       //              Parse the list:         (still everything could be 
changed!)
+       //  Parse the list: (still everything could be changed!)
        //
        while (!gh_null_p(list)) {
 
@@ -473,7 +475,7 @@
                        sublist = gh_car(list);
                        list = gh_cdr(list);
                        //
-                       //              Parse the list
+                       // Parse the list
                        //
                        while (!gh_null_p(sublist)) {
 
@@ -497,13 +499,13 @@
                                        chapter->Type = ChapterPlayLevel;
                                        chapter->Data.Level.Name = 
gh_scm2newstr(value, NULL);
                                } else {
-                                  // FIXME: this leaves a half initialized 
campaign
-                                  errl("Unsupported tag", value);
+                                       // FIXME: this leaves a half 
initialized campaign
+                                       errl("Unsupported tag", value);
                                }
                        }
                } else {
-                  // FIXME: this leaves a half initialized campaign
-                  errl("Unsupported tag", value);
+                       // FIXME: this leaves a half initialized campaign
+                       errl("Unsupported tag", value);
                }
        }
 
@@ -527,7 +529,7 @@
        j = 0;
 
        //
-       //              Campaign name
+       // Campaign name
        //
        ident = strdup(LuaToString(l, j + 1));
        ++j;
@@ -566,7 +568,7 @@
        tail = &campaign->Chapters;
 
        //
-       //              Parse the list:         (still everything could be 
changed!)
+       // Parse the list: (still everything could be changed!)
        //
        for (; j < args; ++j) {
                value = LuaToString(l, j + 1);
@@ -584,7 +586,7 @@
                                lua_error(l);
                        }
                        //
-                       //              Parse the list
+                       // Parse the list
                        //
                        subargs = luaL_getn(l, j + 1);
                        for (k = 0; k < subargs; ++k) {
@@ -610,13 +612,13 @@
                                        chapter->Data.Level.Name = 
strdup(LuaToString(l, -1));
                                        lua_pop(l, 1);
                                } else {
-                                  lua_pushfstring(l, "Unsupported tag: %s", 
value);
-                                  lua_error(l);
+                                       lua_pushfstring(l, "Unsupported tag: 
%s", value);
+                                       lua_error(l);
                                }
                        }
                } else {
-                  lua_pushfstring(l, "Unsupported tag: %s", value);
-                  lua_error(l);
+                       lua_pushfstring(l, "Unsupported tag: %s", value);
+                       lua_error(l);
                }
        }
 
@@ -625,9 +627,9 @@
 #endif
 
 /**
-**             Set the current campaign chapter
+**  Set the current campaign chapter
 **
-**             @param num              Number of current chapter in current 
campaign.
+**  @param num  Number of current chapter in current campaign.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclSetCurrentChapter(SCM num)
@@ -685,9 +687,9 @@
 #endif
 
 /**
-**             Set the briefing.
+**  Set the briefing.
 **
-**             @param list             List describing the briefing.
+**  @param list  List describing the briefing.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclBriefing(SCM list)
@@ -698,7 +700,7 @@
 
        voice = objective = 0;
        //
-       //              Parse the list:         (still everything could be 
changed!)
+       // Parse the list: (still everything could be changed!)
        //
        while (!gh_null_p(list)) {
 
@@ -708,8 +710,8 @@
                if (gh_eq_p(value, gh_symbol2scm("type"))) {
                        if (!gh_eq_p(gh_car(list), gh_symbol2scm("wc2")) &&
                                        !gh_eq_p(gh_car(list), 
gh_symbol2scm("sc")) ) {
-                          // FIXME: this leaves a half initialized briefing
-                          errl("Unsupported briefing type", value);
+                               // FIXME: this leaves a half initialized 
briefing
+                               errl("Unsupported briefing type", value);
                        }
                        list = gh_cdr(list);
                } else if (gh_eq_p(value, gh_symbol2scm("title"))) {
@@ -732,7 +734,7 @@
                        list = gh_cdr(list);
                } else if (gh_eq_p(value, gh_symbol2scm("voice"))) {
                        if (voice == MAX_BRIEFING_VOICES) {
-                          errl("too many voices", value);
+                               errl("too many voices", value);
                        }
                        if (GameIntro.VoiceFile[voice]) {
                                free(GameIntro.VoiceFile[voice]);
@@ -751,8 +753,8 @@
                        list = gh_cdr(list);
                        ++objective;
                } else {
-                  // FIXME: this leaves a half initialized briefing
-                  errl("Unsupported tag", value);
+                       // FIXME: this leaves a half initialized briefing
+                       errl("Unsupported tag", value);
                }
        }
 
@@ -769,7 +771,7 @@
 
        voice = objective = 0;
        //
-       //              Parse the list:         (still everything could be 
changed!)
+       // Parse the list: (still everything could be changed!)
        //
        args = lua_gettop(l);
        for (j = 0; j < args; ++j) {
@@ -779,8 +781,8 @@
                if (!strcmp(value, "type")) {
                        value = LuaToString(l, j + 1);
                        if (strcmp(value, "wc2") && strcmp(value, "sc")) {
-                          lua_pushfstring(l, "Unsupported briefing type: %s", 
value);
-                          lua_error(l);
+                               lua_pushfstring(l, "Unsupported briefing type: 
%s", value);
+                               lua_error(l);
                        }
                } else if (!strcmp(value, "title")) {
                        if (GameIntro.Title) {
@@ -799,8 +801,8 @@
                        GameIntro.TextFile = strdup(LuaToString(l, j + 1));
                } else if (!strcmp(value, "voice")) {
                        if (voice == MAX_BRIEFING_VOICES) {
-                          lua_pushfstring(l, "too many voices");
-                          lua_error(l);
+                               lua_pushfstring(l, "too many voices");
+                               lua_error(l);
                        }
                        if (GameIntro.VoiceFile[voice]) {
                                free(GameIntro.VoiceFile[voice]);
@@ -809,8 +811,8 @@
                        ++voice;
                } else if (!strcmp(value, "objective")) {
                        if (objective == MAX_OBJECTIVES) {
-                          lua_pushfstring(l, "too many objectives");
-                          lua_error(l);
+                               lua_pushfstring(l, "too many objectives");
+                               lua_error(l);
                        }
                        if (GameIntro.Objectives[objective]) {
                                free(GameIntro.Objectives[objective]);
@@ -818,8 +820,8 @@
                        GameIntro.Objectives[objective] = strdup(LuaToString(l, 
j + 1));
                        ++objective;
                } else {
-                  lua_pushfstring(l, "Unsupported tag: %s", value);
-                  lua_error(l);
+                       lua_pushfstring(l, "Unsupported tag: %s", value);
+                       lua_error(l);
                }
        }
 
@@ -828,7 +830,7 @@
 #endif
 
 /**
-**             Register CCL features for campaigns.
+** Register CCL features for campaigns.
 */
 global void CampaignCclRegister(void)
 {
@@ -844,7 +846,7 @@
 }
 
 /**
-**             Save the campaign module.
+**  Save the campaign module.
 */
 global void SaveCampaign(CLFile* file)
 {
@@ -853,7 +855,7 @@
        int i;
 
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: campaign $Id: campaign.c,v 1.39 2003/12/20 
05:33:24 jsalmon3 Exp $\n\n");
+       CLprintf(file, ";;; MODULE: campaign $Id: campaign.c,v 1.40 2003/12/21 
10:51:30 wizzard Exp $\n\n");
        if (!CurrentCampaign) {
                return;
        }
@@ -868,32 +870,32 @@
        CLprintf(file, "  'campaign (list\n");
        for (ch = CurrentCampaign->Chapters; ch; ch = ch->Next) {
                if (ch->Type == ChapterShowPicture) {
-                       CLprintf(file, "        'show-picture (list\n");
-                       CLprintf(file, "          'image \"%s\"\n", 
ch->Data.Picture.Image);
-                       CLprintf(file, "          'fade-in %d\n", 
ch->Data.Picture.FadeIn);
-                       CLprintf(file, "          'fade-out %d\n", 
ch->Data.Picture.FadeOut);
-                       CLprintf(file, "          'display-time %d\n",
+                       CLprintf(file, "    'show-picture (list\n");
+                       CLprintf(file, "      'image \"%s\"\n", 
ch->Data.Picture.Image);
+                       CLprintf(file, "      'fade-in %d\n", 
ch->Data.Picture.FadeIn);
+                       CLprintf(file, "      'fade-out %d\n", 
ch->Data.Picture.FadeOut);
+                       CLprintf(file, "      'display-time %d\n",
                                ch->Data.Picture.DisplayTime);
                        for (text = ch->Data.Picture.Text; text; text = 
text->Next) {
-                               CLprintf(file, "          'text (list\n");
-                               CLprintf(file, "                'font '%s\n", 
FontNames[text->Font]);
-                               CLprintf(file, "                'x %d\n", 
text->X);
-                               CLprintf(file, "                'y %d\n", 
text->Y);
-                               CLprintf(file, "                'width %d\n", 
text->Width);
-                               CLprintf(file, "                'height %d\n", 
text->Height);
+                               CLprintf(file, "      'text (list\n");
+                               CLprintf(file, "        'font '%s\n", 
FontNames[text->Font]);
+                               CLprintf(file, "        'x %d\n", text->X);
+                               CLprintf(file, "        'y %d\n", text->Y);
+                               CLprintf(file, "        'width %d\n", 
text->Width);
+                               CLprintf(file, "        'height %d\n", 
text->Height);
                                if (text->Align == PictureTextAlignLeft) {
-                                       CLprintf(file,"         'align 
'left\n");
+                                       CLprintf(file,"     'align 'left\n");
                                } else {
-                                       CLprintf(file,"         'align 
'center\n");
+                                       CLprintf(file,"     'align 'center\n");
                                }
-                               CLprintf(file, "                'text 
\"%s\"\n", text->Text);
-                               CLprintf(file, "          )\n");
+                               CLprintf(file, "        'text \"%s\"\n", 
text->Text);
+                               CLprintf(file, ")\n");
                        }
-                       CLprintf(file," )\n");
+                       CLprintf(file," )\n");
                } else if (ch->Type == ChapterPlayLevel) {
-                       CLprintf(file, "        'play-level \"%s\"\n", 
ch->Data.Level.Name);
+                       CLprintf(file, "    'play-level \"%s\"\n", 
ch->Data.Level.Name);
                } else if (ch->Type == ChapterPlayVideo) {
-                       CLprintf(file, "        'play-movie \"%s\" %d\n",
+                       CLprintf(file, "    'play-movie \"%s\" %d\n",
                                ch->Data.Movie.PathName, ch->Data.Movie.Flags);
                }
        }
@@ -916,7 +918,7 @@
 }
 
 /**
-**             Clean up the campaign module.
+**  Clean up the campaign module.
 */
 global void CleanCampaign(void)
 {
Index: stratagus/src/game/game.c
diff -u stratagus/src/game/game.c:1.118 stratagus/src/game/game.c:1.119
--- stratagus/src/game/game.c:1.118     Sat Dec 20 16:33:24 2003
+++ stratagus/src/game/game.c   Sun Dec 21 21:51:30 2003
@@ -5,13 +5,13 @@
 //     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
 //             \/                  \/          \//_____/            \/
 //  ______________________                           ______________________
-//                       T H E   W A R   B E G I N S
-//        Stratagus - A free fantasy real time strategy game engine
+//                        T H E   W A R   B E G I N S
+//         Stratagus - A free fantasy real time strategy game engine
 //
-/address@hidden game.c         -       The game set-up and creation. */
+/address@hidden game.c - The game set-up and creation. */
 //
-//     (c) Copyright 1998-2003 by Lutz Sammer, Andreas Arens, and
-//                                Jimmy Salmon
+//      (c) Copyright 1998-2004 by Lutz Sammer, Andreas Arens and
+//                                 Jimmy Salmon
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU General Public License as published by
@@ -27,12 +27,12 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: game.c,v 1.118 2003/12/20 05:33:24 jsalmon3 Exp $
+//      $Id: game.c,v 1.119 2003/12/21 10:51:30 wizzard Exp $
 
 //@{
 
 /*----------------------------------------------------------------------------
---             Includes
+--  Includes
 ----------------------------------------------------------------------------*/
 
 #include <stdio.h>
@@ -67,25 +67,25 @@
 #include "ccl.h"
 
 /*----------------------------------------------------------------------------
---             Variables
+--  Variables
 ----------------------------------------------------------------------------*/
 
-global Settings GameSettings;                          /// Game Settings
-local int LcmPreventRecurse;                           /// prevent recursion 
through LoadGameMap
+global Settings GameSettings;  /// Game Settings
+local int LcmPreventRecurse;   /// prevent recursion through LoadGameMap
 
 /*----------------------------------------------------------------------------
---             Functions
+--  Functions
 ----------------------------------------------------------------------------*/
 
 /*----------------------------------------------------------------------------
---             Map loading/saving
+--  Map loading/saving
 ----------------------------------------------------------------------------*/
 
 /**
-**             Load a Stratagus map.
+**  Load a Stratagus map.
 **
-**             @param filename         map filename
-**             @param map              map loaded
+**  @param filename  map filename
+**  @param map       map loaded
 */
 local void LoadStratagusMap(const char* filename,
        WorldMap* map __attribute__((unused)))
@@ -107,7 +107,7 @@
 
 #if 0
        // Not true if multiplayer levels!
-       if (!ThisPlayer) {                              /// ARI: bomb if 
nothing was loaded!
+       if (!ThisPlayer) { /// ARI: bomb if nothing was loaded!
                fprintf(stderr, "%s: invalid Stratagus map\n", filename);
                ExitFatal(-1);
        }
@@ -120,10 +120,10 @@
 }
 
 /**
-**             Load any map.
+**  Load any map.
 **
-**             @param filename         map filename
-**             @param map              map loaded
+**  @param filename  map filename
+**  @param map       map loaded
 */
 local void LoadMap(const char* filename, WorldMap* map)
 {
@@ -162,11 +162,11 @@
 }
 
 /*----------------------------------------------------------------------------
---             Game creation
+--  Game creation
 ----------------------------------------------------------------------------*/
 
 /**
-**             Free for all
+**  Free for all
 */
 local void GameTypeFreeForAll(void)
 {
@@ -183,7 +183,7 @@
 }
 
 /**
-**             Top vs Bottom
+**  Top vs Bottom
 */
 local void GameTypeTopVsBottom(void)
 {
@@ -210,7 +210,7 @@
 }
 
 /**
-**             Left vs Right
+**  Left vs Right
 */
 local void GameTypeLeftVsRight(void)
 {
@@ -237,7 +237,7 @@
 }
 
 /**
-**             Man vs Machine
+**  Man vs Machine
 */
 local void GameTypeManVsMachine(void)
 {
@@ -262,14 +262,14 @@
 }
 
 /**
-**             CreateGame.
+**  CreateGame.
 **
-**             Load map, graphics, sounds, etc
+**  Load map, graphics, sounds, etc
 **
-**             @param filename         map filename
-**             @param map              map loaded
+**  @param filename  map filename
+**  @param map       map loaded
 **
-**             @todo           FIXME: use in this function InitModules / 
LoadModules!!!
+**  @todo FIXME: use in this function InitModules / LoadModules!!!
 */
 global void CreateGame(char* filename, WorldMap* map)
 {
@@ -282,7 +282,7 @@
                return;
        }
 
-       InitVisionTable();                                              // 
build vision table for fog of war
+       InitVisionTable(); // build vision table for fog of war
        InitPlayers();
 
        if (filename) {
@@ -294,7 +294,7 @@
                }
 
                //
-               //              Load the map.
+               // Load the map.
                //
                InitUnitTypes(1);
                LoadMap(filename, map);
@@ -309,7 +309,7 @@
        SyncHash = 0;
        InitSyncRand();
 
-       if (NetworkFildes != (Socket)-1) {                              // 
Prepare network play
+       if (NetworkFildes != (Socket)-1) { // Prepare network play
                DebugLevel0Fn("Client setup: Calling InitNetwork2\n");
                InitNetwork2();
        } else {
@@ -323,7 +323,9 @@
        } else {
                CallbackMusicOn();
        }
-       //GamePaused = 1;
+#if 0
+       GamePaused = 1;
+#endif
 
        if (FlagRevealMap) {
                RevealMap();
@@ -353,7 +355,7 @@
        }
 
        //
-       //              Setup game types
+       // Setup game types
        //
        // FIXME: implement more game types
        if (GameSettings.GameType != SettingsGameTypeMapDefault) {
@@ -394,7 +396,7 @@
        }
 
        //
-       //              Graphic part
+       // Graphic part
        //
 #ifdef USE_SDL_SURFACE
        GlobalPalette = LoadRGB(s = strdcat3(StratagusLibPath, "/graphics/",
@@ -433,19 +435,19 @@
                CompressedGraphicMemory / 1024 _C_
                CompressedGraphicMemory / 1024 / 1024);
 
-       CreateMinimap();                                                // 
create minimap for pud
-       InitMap();                                                              
// setup draw functions
-       InitMapFogOfWar();                                              // 
build tables for fog of war
-       PreprocessMap();                                                // 
Adjust map for use
-       MapColorCycle();                                                // 
Setup color cycle
+       CreateMinimap();   // create minimap for pud
+       InitMap();         // setup draw functions
+       InitMapFogOfWar(); // build tables for fog of war
+       PreprocessMap();   // Adjust map for use
+       MapColorCycle();   // Setup color cycle
 
-       InitUserInterface(ThisPlayer->RaceName);                // Setup the 
user interface
-       LoadUserInterface();                            // Load the user 
interface grafics
+       InitUserInterface(ThisPlayer->RaceName); // Setup the user interface
+       LoadUserInterface(); // Load the user interface grafics
 
        //
-       //              Sound part
+       // Sound part
        //
-       //FIXME: check if everything is really loaded
+       // FIXME: check if everything is really loaded
        LoadUnitSounds();
        MapUnitSounds();
 
@@ -457,44 +459,44 @@
 #endif
 
        //
-       //              Spells
+       // Spells
        //
        InitSpells();
 
        //
-       //  Init units' groups
+       // Init units' groups
        //
        InitGroups();
 
        //
-       //              Init players?
+       // Init players?
        //
        DebugPlayers();
        PlayersInitAi();
 
        //
-       //  Upgrades
+       // Upgrades
        //
        InitUpgrades();
 
        //
-       //  Dependencies
+       // Dependencies
        //
        InitDependencies();
 
        //
-       //  Buttons (botpanel)
+       // Buttons (botpanel)
        //
        InitButtons();
 
        //
-       //              Triggers
+       // Triggers
        //
        InitTriggers();
 
 #ifdef WITH_SOUND
        if (SoundFildes != -1) {
-               //FIXME: must be done after map is loaded
+               // FIXME: must be done after map is loaded
                if (InitSoundServer()) {
                        SoundOff = 1;
                        SoundFildes = -1;
@@ -516,9 +518,9 @@
                ThisPlayer->StartX, ThisPlayer->StartY);
 
        //
-       //              Various hacks wich must be done after the map is loaded.
+       // Various hacks wich must be done after the map is loaded.
        //
-       //FIXME: must be done after map is loaded
+       // FIXME: must be done after map is loaded
        InitAStar();
 #ifdef HIERARCHIC_PATHFINDER
        PfHierInitialize();
@@ -527,12 +529,12 @@
        MapSplitterInit();
 #endif
        //
-       //              FIXME: The palette is loaded after the units are 
created.
-       //              FIXME: This loops fixes the colors of the units.
+       // FIXME: The palette is loaded after the units are created.
+       // FIXME: This loops fixes the colors of the units.
        //
        for (i = 0; i < NumUnits; ++i) {
-               //  I don't really think that there can be any rescued
-               //  units at this point.
+               // I don't really think that there can be any rescued
+               // units at this point.
                if (Units[i]->RescuedFrom) {
                        Units[i]->Colors = &Units[i]->RescuedFrom->UnitColors;
                } else {
@@ -554,9 +556,9 @@
 }
 
 /**
-**             Init Game Setting to default values
+**  Init Game Setting to default values
 **
-**             @todo FIXME: this should not be executed for restart levels!
+**  @todo  FIXME: this should not be executed for restart levels!
 */
 global void InitSettings(void)
 {
Index: stratagus/src/game/intro.c
diff -u stratagus/src/game/intro.c:1.116 stratagus/src/game/intro.c:1.117
--- stratagus/src/game/intro.c:1.116    Sat Dec 20 16:33:24 2003
+++ stratagus/src/game/intro.c  Sun Dec 21 21:51:30 2003
@@ -5,12 +5,12 @@
 //     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
 //             \/                  \/          \//_____/            \/
 //  ______________________                           ______________________
-//                       T H E   W A R   B E G I N S
-//        Stratagus - A free fantasy real time strategy game engine
+//                        T H E   W A R   B E G I N S
+//         Stratagus - A free fantasy real time strategy game engine
 //
-/address@hidden intro.c        -       The game intros. */
+/address@hidden intro.c - The game intros. */
 //
-//     (c) Copyright 2002-2003 by Lutz Sammer and Jimmy Salmon.
+//      (c) Copyright 2002-2004 by Lutz Sammer and Jimmy Salmon.
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU General Public License as published by
@@ -26,17 +26,18 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: intro.c,v 1.116 2003/12/20 05:33:24 jsalmon3 Exp $
+//      $Id: intro.c,v 1.117 2003/12/21 10:51:30 wizzard Exp $
 
 //@{
 
 /*----------------------------------------------------------------------------
---             Includes
+--  Includes
 ----------------------------------------------------------------------------*/
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+
 #include "stratagus.h"
 #include "iolib.h"
 #include "video.h"
@@ -53,54 +54,54 @@
 #include "ui.h"
 
 /*----------------------------------------------------------------------------
---             Declarations
+--  Declarations
 ----------------------------------------------------------------------------*/
 
 /**
-**             Linked list struct used to split text up into lines
+**  Linked list struct used to split text up into lines
 */
 typedef struct TextLines {
-       char* Text;                                                             
/// Line of text
-       struct TextLines* Next;                         /// Pointer to next line
+       char* Text;              /// Line of text
+       struct TextLines* Next;  /// Pointer to next line
 } TextLines;
 
 /**
-**             Player ranks
+**  Player ranks
 */
 typedef struct PlayerRanks {
-       char** Ranks;                                           /// Array of 
ranks
-       int* Scores;                                            /// Array of 
scores
+       char** Ranks;  /// Array of ranks
+       int* Scores;   /// Array of scores
 } PlayerRanks;
 
 /**
-**             Linked list of TextLines
+**  Linked list of TextLines
 */
 typedef struct ChapterTextLines {
-       struct TextLines* Text;                         /// TextLines struct
-       struct ChapterTextLines* Next;          /// Pointer to next TextLines
+       struct TextLines* Text;         /// TextLines struct
+       struct ChapterTextLines* Next;  /// Pointer to next TextLines
 } ChapterTextLines;
 
 /*----------------------------------------------------------------------------
---             Variables
+--  Variables
 ----------------------------------------------------------------------------*/
 
-global Intro GameIntro;                                                /// 
Game intro
-global Credits         GameCredits;                            /// Game credits
-local PlayerRanks Ranks[PlayerMax];            /// Ranks
+global Intro GameIntro;              /// Game intro
+global Credits GameCredits;          /// Game credits
+local PlayerRanks Ranks[PlayerMax];  /// Ranks
 
 /*----------------------------------------------------------------------------
---             Functions
+--  Functions
 ----------------------------------------------------------------------------*/
 
-local int IntroNoEvent;                                                /// 
Flag got an event
-local int IntroButtonPressed;                          /// Button pressed
-local int UseContinueButton;                           /// Handle continue 
button
-local int ContinueButtonX;                             /// Continue button 
position X
-local int ContinueButtonY;                             /// Continue button 
position Y
-local int ContinueButtonFlags;                         /// Flags for continue 
button
+local int IntroNoEvent;         /// Flag got an event
+local int IntroButtonPressed;   /// Button pressed
+local int UseContinueButton;    /// Handle continue button
+local int ContinueButtonX;      /// Continue button position X
+local int ContinueButtonY;      /// Continue button position Y
+local int ContinueButtonFlags;  /// Flags for continue button
 
 /**
-**             Callback for input.
+**  Callback for input.
 */
 local void IntroCallbackButton1(unsigned button)
 {
@@ -118,7 +119,7 @@
 }
 
 /**
-**             Callback for input.
+**  Callback for input.
 */
 local void IntroCallbackButton2(unsigned button)
 {
@@ -135,7 +136,7 @@
 }
 
 /**
-**             Callback for input.
+**  Callback for input.
 */
 local void IntroCallbackKey1(unsigned key, unsigned keychar)
 {
@@ -152,7 +153,7 @@
 }
 
 /**
-**             Callback for input.
+**  Callback for input.
 */
 local void IntroCallbackKey2(unsigned key, unsigned keychar)
 {
@@ -168,7 +169,7 @@
 }
 
 /**
-**             Callback for input.
+**  Callback for input.
 */
 local void IntroCallbackKey3(unsigned key __attribute__((unused)),
        unsigned keychar __attribute__((unused)))
@@ -176,7 +177,7 @@
 }
 
 /**
-**             Callback for input.
+**  Callback for input.
 */
 local void IntroCallbackMouse(int x, int y)
 {
@@ -195,7 +196,7 @@
 }
 
 /**
-**             Callback for exit.
+**  Callback for exit.
 */
 local void IntroCallbackExit(void)
 {
@@ -203,7 +204,7 @@
 }
 
 /**
-**             Draws a continue button at x,y
+**  Draws a continue button at x,y
 */
 local void DrawContinueButton(void)
 {
@@ -214,10 +215,10 @@
 }
 
 /**
-**             Init continue button.
+**  Init continue button.
 **
-**             @param x                X screen pixel position of continue 
button.
-**             @param y                Y screen pixel position of continue 
button.
+**  @param x  X screen pixel position of continue button.
+**  @param y  Y screen pixel position of continue button.
 */
 local void InitContinueButton(int x, int y)
 {
@@ -227,11 +228,11 @@
 }
 
 /**
-**             Splits text up into a linked list of lines less than a given 
width.
+**  Splits text up into a linked list of lines less than a given width.
 **
-**             @param text             The text to be split up.
-**             @param w                Maximum width of a line.
-**             @param lines            Pointer to linked list structure.
+**  @param text   The text to be split up.
+**  @param w      Maximum width of a line.
+**  @param lines  Pointer to linked list structure.
 */
 local void SplitTextIntoLines(const char* text, int w, TextLines** lines)
 {
@@ -302,9 +303,9 @@
 }
 
 /**
-**             Frees memory in a TextLines struct
+**  Frees memory in a TextLines struct
 **
-**             @param lines            Address of the pointer to free
+**  @param lines  Address of the pointer to free
 */
 local void FreeTextLines(TextLines** lines)
 {
@@ -319,16 +320,16 @@
 }
 
 /**
-**             Scroll text.
+**  Scroll text.
 **
-**             @param x                x start pixel screen position.
-**             @param y                y start pixel screen position.
-**             @param w                width of text area
-**             @param h                height of text area
-**             @param i                scroll index.
-**             @param lines            Lines of the text to display.
+**  @param x      x start pixel screen position.
+**  @param y      y start pixel screen position.
+**  @param w      width of text area
+**  @param h      height of text area
+**  @param i      scroll index.
+**  @param lines  Lines of the text to display.
 **
-**             @return                         1 if there is more to scroll, 0 
if it is done
+**  @return       1 if there is more to scroll, 0 if it is done
 */
 local int ScrollText(int x, int y, int w, int h, int i, TextLines* lines)
 {
@@ -370,9 +371,9 @@
 }
 
 /**
-**             Show level intro.
+**  Show level intro.
 **
-**             @param intro            Intro struct
+**  @param intro  Intro struct
 */
 global void ShowIntro(const Intro* intro)
 {
@@ -496,26 +497,26 @@
 #endif
                HideAnyCursor();
                //
-               //              Draw background
+               // Draw background
                //
                VideoDrawSubClip(background, 0, 0,
                        background->Width, background->Height,
                        (VideoWidth - background->Width) / 2,
                        (VideoHeight - background->Height) / 2);
                //
-               //              Draw title
+               // Draw title
                //
                SetDefaultTextColors(FontWhite, FontYellow);
                VideoDrawTextCentered((70 + 340) / 2 * VideoWidth / 640,
                        28 * VideoHeight / 480, LargeFont, intro->Title);
                //
-               //              Draw scrolling text
+               // Draw scrolling text
                //
                ScrollText(70 * VideoWidth / 640, 80 * VideoHeight / 480,
                        70 * VideoWidth / 640 + 320, 170 * VideoHeight / 480, 
line, scrolling_text);
 
                //
-               //              Draw objectives
+               // Draw objectives
                //
                y = 306 * VideoHeight / 480;
                VideoDrawText(372 * VideoWidth / 640, y, LargeFont, 
"Objectives:");
@@ -592,9 +593,9 @@
 }
 
 /**
-**             Show the credits
+**  Show the credits
 **
-**             @param credits          Credits structure
+**  @param credits  Credits structure
 */
 global void ShowCredits(Credits* credits)
 {
@@ -664,7 +665,7 @@
                HideAnyCursor();
 
                //
-               //              Draw background
+               // Draw background
                //
                if (background) {
                        VideoDrawSubClip(background, 0, 0,
@@ -674,7 +675,7 @@
                }
 
                //
-               //              Draw scrolling text
+               // Draw scrolling text
                //
                if (scrolling_credits) {
                        scrolling = ScrollText(x + 140, y + 80, 320, 275, line, 
scrolling_credits);
@@ -727,13 +728,15 @@
        VideoSyncSpeed = old_video_sync;
        SetVideoSync();
 
-       // CallbackMusicOn();
+#if 0
+       CallbackMusicOn();
        // FIXME: should this be GameMusic?
-       // PlayMusic(MenuMusic);
+       PlayMusic(MenuMusic);
+#endif
 }
 
 /**
-**             Draw text
+**  Draw text
 */
 local void PictureDrawText(CampaignChapter* chapter, ChapterTextLines* chlines)
 {
@@ -764,9 +767,9 @@
 }
 
 /**
-**             Show picture.
+**  Show picture.
 **
-**             @param chapter          Pointer to CampaignChapter to show
+**  @param chapter  Pointer to CampaignChapter to show
 */
 global void ShowPicture(CampaignChapter* chapter)
 {
@@ -814,7 +817,7 @@
        }
 
        //
-       //              Fade in background and title
+       // Fade in background and title
        //
        i = 0;
        max = chapter->Data.Picture.FadeIn;
@@ -847,7 +850,7 @@
        i = chapter->Data.Picture.FadeOut * i / max;
 
        //
-       //              Draw background and title
+       // Draw background and title
        //
        j = 0;
        max = chapter->Data.Picture.DisplayTime;
@@ -876,7 +879,7 @@
        }
 
        //
-       //              Fade out background and title
+       // Fade out background and title
        //
        max = chapter->Data.Picture.FadeOut;
        while (i >= 0) {
@@ -931,7 +934,7 @@
 
 
 /**
-**             Draw a box with the text inside
+**  Draw a box with the text inside
 */
 #ifdef USE_SDL_SURFACE
 local void DrawStatBox(int x, int y, char* text, Uint32 color, int percent)
@@ -946,7 +949,7 @@
 }
 
 /**
-**             Draw the game stats
+**  Draw the game stats
 */
 local int GameStatsDrawFunc(int frame)
 {
@@ -1315,7 +1318,7 @@
 }
 
 /**
-**             Show the game stats
+**  Show the game stats
 */
 global void ShowStats(void)
 {
@@ -1421,7 +1424,7 @@
 }
 
 /**
-**             Free Ccl Credits Memory
+**  Free Ccl Credits Memory
 */
 global void CleanCclCredits()
 {
@@ -1436,11 +1439,11 @@
 }
 
 /**
-**             Parse the credits configuration.
+**  Parse the credits configuration.
 **
-**             @param list             Scheme list containing the credits.
+**  @param list  Scheme list containing the credits.
 **
-**             @todo           'comment and 'title are only parsed, but not 
used.
+**  @todo  'comment and 'title are only parsed, but not used.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclCredits(SCM list)
@@ -1531,7 +1534,7 @@
 #endif
 
 /**
-**             Register CCL features for credits.
+**  Register CCL features for credits.
 */
 global void CreditsCclRegister(void)
 {
@@ -1545,11 +1548,11 @@
 }
 
 /**
-**             Parse the add objective ccl function
+**  Parse the add objective ccl function
 **
-**             The list contains the objective text followed by an optional 
number
-**             specifying where in the list it should be added.  If no number 
is
-**             given it is added at the end.
+**  The list contains the objective text followed by an optional number
+**  specifying where in the list it should be added.  If no number is
+**  given it is added at the end.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclAddObjective(SCM list)
@@ -1660,7 +1663,7 @@
 #endif
 
 /**
-**             Parse the remove objective ccl function
+**  Parse the remove objective ccl function
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclRemoveObjective(SCM objective)
@@ -1722,7 +1725,7 @@
 #endif
 
 /**
-**             Set the objectives
+**  Set the objectives
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclSetObjectives(SCM list)
@@ -1767,7 +1770,7 @@
 #endif
 
 /**
-**             Parse the define-ranks ccl function
+**  Parse the define-ranks ccl function
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclDefineRanks(SCM list)
@@ -1875,7 +1878,7 @@
 #endif
 
 /**
-**             Register CCL functions for objectives
+**  Register CCL functions for objectives
 */
 global void ObjectivesCclRegister(void)
 {
@@ -1893,7 +1896,7 @@
 }
 
 /**
-**             Save the objectives.
+**  Save the objectives.
 */
 global void SaveObjectives(CLFile* file)
 {
Index: stratagus/src/game/loadgame.c
diff -u stratagus/src/game/loadgame.c:1.74 stratagus/src/game/loadgame.c:1.75
--- stratagus/src/game/loadgame.c:1.74  Sat Dec 20 16:33:24 2003
+++ stratagus/src/game/loadgame.c       Sun Dec 21 21:51:31 2003
@@ -5,12 +5,12 @@
 //     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
 //             \/                  \/          \//_____/            \/
 //  ______________________                           ______________________
-//                       T H E   W A R   B E G I N S
-//        Stratagus - A free fantasy real time strategy game engine
+//                        T H E   W A R   B E G I N S
+//         Stratagus - A free fantasy real time strategy game engine
 //
-/address@hidden loadgame.c     -       Load game. */
+/address@hidden loadgame.c - Load game. */
 //
-//     (c) Copyright 2001-2003 by Lutz Sammer, Andreas Arens
+//      (c) Copyright 2001-2004 by Lutz Sammer, Andreas Arens
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU General Public License as published by
@@ -26,12 +26,12 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: loadgame.c,v 1.74 2003/12/20 05:33:24 jsalmon3 Exp $
+//      $Id: loadgame.c,v 1.75 2003/12/21 10:51:31 wizzard Exp $
 
 //@{
 
 /*----------------------------------------------------------------------------
---             Includes
+--  Includes
 ----------------------------------------------------------------------------*/
 
 #include <stdio.h>
@@ -62,17 +62,17 @@
 #include "pathfinder.h"
 
 /*----------------------------------------------------------------------------
---             Variables
+--  Variables
 ----------------------------------------------------------------------------*/
 
 /*----------------------------------------------------------------------------
---             Functions
+--  Functions
 ----------------------------------------------------------------------------*/
 
 /**
-**             Cleanup modules.
+**  Cleanup modules.
 **
-**             Call each module to clean up.
+**  Call each module to clean up.
 */
 global void CleanModules(void)
 {
@@ -85,7 +85,9 @@
 
        CleanIcons();
        CleanCursors();
-       // CleanMenus();
+#if 0
+       CleanMenus();
+#endif
        CleanUserInterface();
        CleanCampaign();
        CleanTriggers();
@@ -117,7 +119,7 @@
        FreeAStar();
 
        //
-       //              Free our protected objects, AI scripts, unit-type 
properties.
+       // Free our protected objects, AI scripts, unit-type properties.
        //
 #if defined(USE_GUILE) || defined(USE_SIOD)
        var = gh_symbol2scm("*ccl-protect*");
@@ -126,9 +128,9 @@
 }
 
 /**
-**             Initialize all modules.
+**  Initialize all modules.
 **
-**             Call each module to initialize.
+**  Call each module to initialize.
 */
 global void InitModules(void)
 {
@@ -146,7 +148,9 @@
        InitMissileTypes();
        InitMissiles();
        InitConstructions();
-       // InitDecorations();
+#if 0
+       InitDecorations();
+#endif
 
        // LUDO : 0 = don't reset player stats ( units level , upgrades, ... ) !
        InitUnitTypes(0);
@@ -166,13 +170,13 @@
        PfHierInitialize();
 #endif
        InitMap();
-       InitMapFogOfWar();                                              // 
build tables for fog of war
+       InitMapFogOfWar(); // build tables for fog of war
 }
 
 /**
-**             Load all.
+**  Load all.
 **
-**             Call each module to load additional files (graphics,sounds).
+**  Call each module to load additional files (graphics,sounds).
 */
 global void LoadModules(void)
 {
@@ -181,7 +185,9 @@
        LoadIcons();
        LoadCursors(ThisPlayer->RaceName);
        LoadUserInterface();
-       // LoadPlayers();
+#if 0
+       LoadPlayers();
+#endif
        LoadMissileSprites();
        LoadConstructions();
        LoadDecorations();
@@ -219,15 +225,17 @@
 
        SetDefaultTextColors(TheUI.NormalFontColor, TheUI.ReverseFontColor);
 
-       // LoadButtons();
+#if 0
+       LoadButtons();
+#endif
 }
 
 /**
-**             Load a game to file.
+**  Load a game to file.
 **
-**             @param filename         File name to be loaded.
+**  @param filename  File name to be loaded.
 **
-**             @note           Later we want to store in a more compact binary 
format.
+**  @note  Later we want to store in a more compact binary format.
 */
 global void LoadGame(char* filename)
 {
@@ -269,9 +277,9 @@
 }
 
 /**
-**             Load all game data.
+**  Load all game data.
 **
-**             Test function for the later load/save functions.
+**  Test function for the later load/save functions.
 */
 global void LoadAll(void)
 {
@@ -283,7 +291,9 @@
        SaveGame("save_file_of_stratagus2.ccl");
        LoadGame("save_file_of_stratagus2.ccl");
 #endif
-       //LoadGame ("save_file_of_stratagus.ccl");
+#if 0
+       LoadGame ("save_file_of_stratagus.ccl");
+#endif
 }
 
 //@}
Index: stratagus/src/game/savegame.c
diff -u stratagus/src/game/savegame.c:1.39 stratagus/src/game/savegame.c:1.40
--- stratagus/src/game/savegame.c:1.39  Sat Dec 20 16:33:24 2003
+++ stratagus/src/game/savegame.c       Sun Dec 21 21:51:31 2003
@@ -5,12 +5,12 @@
 //     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
 //             \/                  \/          \//_____/            \/
 //  ______________________                           ______________________
-//                       T H E   W A R   B E G I N S
-//        Stratagus - A free fantasy real time strategy game engine
+//                        T H E   W A R   B E G I N S
+//         Stratagus - A free fantasy real time strategy game engine
 //
-/address@hidden savegame.c     -       Save game. */
+/address@hidden savegame.c - Save game. */
 //
-//     (c) Copyright 2001,2002 by Lutz Sammer, Andreas Arens
+//      (c) Copyright 2001-2004 by Lutz Sammer, Andreas Arens
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU General Public License as published by
@@ -26,12 +26,12 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: savegame.c,v 1.39 2003/12/20 05:33:24 jsalmon3 Exp $
+//      $Id: savegame.c,v 1.40 2003/12/21 10:51:31 wizzard Exp $
 
 //@{
 
 /*----------------------------------------------------------------------------
---             Includes
+--  Includes
 ----------------------------------------------------------------------------*/
 
 #include <string.h>
@@ -39,7 +39,6 @@
 #include <time.h>
 
 #include "stratagus.h"
-
 #include "icons.h"
 #include "ui.h"
 #include "construct.h"
@@ -59,23 +58,22 @@
 #include "iolib.h"
 #include "spells.h"
 #include "commands.h"
-
 #include "ccl.h"
 
 /*----------------------------------------------------------------------------
---             Variables
+--  Variables
 ----------------------------------------------------------------------------*/
 
 /*----------------------------------------------------------------------------
---             Functions
+--  Functions
 ----------------------------------------------------------------------------*/
 
 /**
-**             Save a game to file.
+**  Save a game to file.
 **
-**             @param filename         File name to be stored.
+**  @param filename  File name to be stored.
 **
-**             @note           Later we want to store in a more compact binary 
format.
+**  @note  Later we want to store in a more compact binary format.
 */
 global void SaveGame(const char* filename)
 {
@@ -102,7 +100,7 @@
        CLprintf(file, ";;;(save-game\n");
        CLprintf(file, ";;;  'comment\t\"Generated by Stratagus Version " 
VERSION "\"\n");
        CLprintf(file, ";;;  'comment\t\"Visit http://Stratagus.Org for more 
informations\"\n");
-       CLprintf(file, ";;;  'comment\t\"$Id: savegame.c,v 1.39 2003/12/20 
05:33:24 jsalmon3 Exp $\"\n");
+       CLprintf(file, ";;;  'comment\t\"$Id: savegame.c,v 1.40 2003/12/21 
10:51:31 wizzard Exp $\"\n");
        CLprintf(file, ";;;  'type\t\"%s\"\n", "single-player");
        CLprintf(file, ";;;  'date\t\"%s\"\n", s);
        CLprintf(file, ";;;  'map\t\"%s\"\n", TheMap.Description);
@@ -118,12 +116,14 @@
                CLprintf(file, ";;;  'media\t'");
                var = gh_symbol2scm("media-version");
                // FIXME : guile todo
-               //if (symbol_boundp(var, NIL)) {
-               //      var = symbol_value(var, NIL);
-               //      lprin1CL(var, file);
-               //} else {
+#if 0
+               if (symbol_boundp(var, NIL)) {
+                       var = symbol_value(var, NIL);
+                       lprin1CL(var, file);
+               } else {
                        CLprintf(file, "nil");
-               //}
+               }
+#endif
 #elif defined(USE_LUA)
 #endif
        }
Index: stratagus/src/game/trigger.c
diff -u stratagus/src/game/trigger.c:1.51 stratagus/src/game/trigger.c:1.52
--- stratagus/src/game/trigger.c:1.51   Sat Dec 20 16:33:24 2003
+++ stratagus/src/game/trigger.c        Sun Dec 21 21:51:31 2003
@@ -5,12 +5,12 @@
 //     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
 //             \/                  \/          \//_____/            \/
 //  ______________________                           ______________________
-//                       T H E   W A R   B E G I N S
-//        Stratagus - A free fantasy real time strategy game engine
+//                        T H E   W A R   B E G I N S
+//         Stratagus - A free fantasy real time strategy game engine
 //
-/address@hidden trigger.c      -       The trigger handling. */
+/address@hidden trigger.c - The trigger handling. */
 //
-//     (c) Copyright 2002-2003 by Lutz Sammer and Jimmy Salmon
+//      (c) Copyright 2002-2004 by Lutz Sammer and Jimmy Salmon
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU General Public License as published by
@@ -26,20 +26,20 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: trigger.c,v 1.51 2003/12/20 05:33:24 jsalmon3 Exp $
+//      $Id: trigger.c,v 1.52 2003/12/21 10:51:31 wizzard Exp $
 
 //@{
 
 /*----------------------------------------------------------------------------
---             Includes
+--  Includes
 ----------------------------------------------------------------------------*/
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <setjmp.h>
-#include "stratagus.h"
 
+#include "stratagus.h"
 #include "ccl.h"
 #include "unittype.h"
 #include "player.h"
@@ -48,7 +48,7 @@
 #include "interface.h"
 
 /*----------------------------------------------------------------------------
---             Declarations
+--  Declarations
 ----------------------------------------------------------------------------*/
 
        /// Get unit-type.
@@ -58,35 +58,35 @@
 extern UnitType* CclGetUnitType(lua_State* l);
 #endif
 
-#define MAX_SWITCH             256                             /// Maximum 
number of switches
+#define MAX_SWITCH 256 /// Maximum number of switches
 
 /*----------------------------------------------------------------------------
---             Variables
+--  Variables
 ----------------------------------------------------------------------------*/
 
-global Timer GameTimer;                                                /// The 
game timer
-local unsigned long WaitFrame;                         /// Frame to wait for
+global Timer GameTimer; /// The game timer
+local unsigned long WaitFrame; /// Frame to wait for
 #if defined(USE_GUILE) || defined(USE_SIOD)
-local SCM Trigger;                                             /// Current 
trigger
-local SCM WaitScript;                                          /// Script to 
run after wait is over
-local SCM WaitTrigger;                                         /// Old Trigger 
value during wait
+local SCM Trigger;      /// Current trigger
+local SCM WaitScript;   /// Script to run after wait is over
+local SCM WaitTrigger;  /// Old Trigger value during wait
 #elif defined(USE_LUA)
 local int Trigger;
 local int WaitScript;
 local int WaitTrigger;
 #endif
-local unsigned char Switch[MAX_SWITCH];                /// Switches
+local unsigned char Switch[MAX_SWITCH]; /// Switches
 
 /*----------------------------------------------------------------------------
---             Functions
+--  Functions
 ----------------------------------------------------------------------------*/
 
 /**
-**             Get player number.
+**  Get player number.
 **
-**             @param player           The player
+**  @param player  The player
 **
-**             @return                         The player number, -1 matches 
any.
+**  @return  The player number, -1 matches any.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 global int TriggerGetPlayer(SCM player)
@@ -137,11 +137,11 @@
 #endif
 
 /**
-**             Get the unit-type.
+**  Get the unit-type.
 **
-**             @param unit             The unit type.
+**  @param unit  The unit type.
 **
-**             @return                         The unit-type pointer.
+**  @return      The unit-type pointer.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 global const UnitType* TriggerGetUnitType(SCM unit)
@@ -178,9 +178,9 @@
 }
 #endif
 
-// --------------------------------------------------------------------------
-//             Conditions
-
+/*--------------------------------------------------------------------------
+--  Conditions
+--------------------------------------------------------------------------*/
 local int CompareEq(int a, int b)
 {
        return a == b;
@@ -209,11 +209,11 @@
 typedef int (*CompareFunction)(int, int);
 
 /**
-**             Returns a function pointer to the comparison function
+**  Returns a function pointer to the comparison function
 **
-**             @param op               The operation
+**  @param op  The operation
 **
-**             @return                         Function pointer to the compare 
function
+**  @return    Function pointer to the compare function
 */
 local CompareFunction GetCompareFunction(const char* op)
 {
@@ -240,7 +240,7 @@
 }
 
 /**
-**             Player has the quantity of unit-type.
+**  Player has the quantity of unit-type.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclIfUnit(SCM player, SCM operation, SCM quantity, SCM unit)
@@ -391,9 +391,9 @@
 #endif
 
 /**
-**             Player has the quantity of unit-type at a location.
+**  Player has the quantity of unit-type at a location.
 **
-**             (if-unit-at {player} {op} {quantity} {unit} {location} 
{location})
+**  (if-unit-at {player} {op} {quantity} {unit} {location} {location})
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclIfUnitAt(SCM list)
@@ -431,7 +431,7 @@
        list = gh_cdr(list);
 
        //
-       //              Get all unit types in location.
+       // Get all unit types in location.
        //
 #ifdef UNIT_ON_MAP
        // FIXME: could be done faster?
@@ -441,12 +441,12 @@
        // NOTE: +1 right,bottom isn't inclusive :(
        an = SelectUnits(x1, y1, x2 + 1, y2 + 1, table);
        //
-       //              Count the requested units
+       // Count the requested units
        //
        for (j = s = 0; j < an; ++j) {
                unit = table[j];
                //
-               //              Check unit type
+               // Check unit type
                //
                // FIXME: ALL_UNITS
                if (unittype == ANY_UNIT ||
@@ -454,7 +454,7 @@
                                (unittype == ALL_BUILDINGS && 
unit->Type->Building) ||
                                (unittype == unit->Type)) {
                        //
-                       //              Check the player
+                       // Check the player
                        //
                        if (plynr == -1 || plynr == unit->Player->Player) {
                                ++s;
@@ -525,7 +525,7 @@
        lua_pop(l, 1);
 
        //
-       //              Get all unit types in location.
+       // Get all unit types in location.
        //
 #ifdef UNIT_ON_MAP
        // FIXME: could be done faster?
@@ -535,12 +535,12 @@
        // NOTE: +1 right,bottom isn't inclusive :(
        an = SelectUnits(x1, y1, x2 + 1, y2 + 1, table);
        //
-       //              Count the requested units
+       // Count the requested units
        //
        for (j = s = 0; j < an; ++j) {
                unit = table[j];
                //
-               //              Check unit type
+               // Check unit type
                //
                // FIXME: ALL_UNITS
                if (unittype == ANY_UNIT ||
@@ -548,7 +548,7 @@
                                (unittype == ALL_BUILDINGS && 
unit->Type->Building) ||
                                (unittype == unit->Type)) {
                        //
-                       //              Check the player
+                       // Check the player
                        //
                        if (plynr == -1 || plynr == unit->Player->Player) {
                                ++s;
@@ -566,7 +566,7 @@
 #endif
 
 /**
-**             Player has the quantity of unit-type near to unit-type.
+**  Player has the quantity of unit-type near to unit-type.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclIfNearUnit(SCM player, SCM operation, SCM quantity, SCM unit,
@@ -594,7 +594,7 @@
        }
 
        //
-       //              Get all unit types 'near'.
+       // Get all unit types 'near'.
        //
        n = FindUnitsByType(ut2, table);
        DebugLevel3Fn("%s: %d\n" _C_ ut2->Ident _C_ n);
@@ -624,12 +624,12 @@
                }
                DebugLevel3Fn("Units around %d: %d\n" _C_ UnitNumber(unit) _C_ 
an);
                //
-               //              Count the requested units
+               // Count the requested units
                //
                for (j = s = 0; j < an; ++j) {
                        unit = around[j];
                        //
-                       //              Check unit type
+                       // Check unit type
                        //
                        // FIXME: ALL_UNITS
                        if (unittype == ANY_UNIT ||
@@ -637,7 +637,7 @@
                                        (unittype == ALL_BUILDINGS && 
unit->Type->Building) ||
                                        (unittype == unit->Type)) {
                                //
-                               //              Check the player
+                               // Check the player
                                //
                                if (plynr == -1 || plynr == 
unit->Player->Player) {
                                        ++s;
@@ -692,7 +692,7 @@
        }
 
        //
-       //              Get all unit types 'near'.
+       // Get all unit types 'near'.
        //
        n = FindUnitsByType(ut2, table);
        DebugLevel3Fn("%s: %d\n" _C_ ut2->Ident _C_ n);
@@ -722,12 +722,12 @@
                }
                DebugLevel3Fn("Units around %d: %d\n" _C_ UnitNumber(unit) _C_ 
an);
                //
-               //              Count the requested units
+               // Count the requested units
                //
                for (j = s = 0; j < an; ++j) {
                        unit = around[j];
                        //
-                       //              Check unit type
+                       // Check unit type
                        //
                        // FIXME: ALL_UNITS
                        if (unittype == ANY_UNIT ||
@@ -735,7 +735,7 @@
                                        (unittype == ALL_BUILDINGS && 
unit->Type->Building) ||
                                        (unittype == unit->Type)) {
                                //
-                               //              Check the player
+                               // Check the player
                                //
                                if (plynr == -1 || plynr == 
unit->Player->Player) {
                                        ++s;
@@ -760,7 +760,7 @@
 #endif
 
 /**
-**             Player has the quantity of rescued unit-type near to unit-type.
+** Player has the quantity of rescued unit-type near to unit-type.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclIfRescuedNearUnit(SCM player, SCM operation, SCM quantity, SCM 
unit,
@@ -788,7 +788,7 @@
        }
 
        //
-       //              Get all unit types 'near'.
+       // Get all unit types 'near'.
        //
        n = FindUnitsByType(ut2, table);
        DebugLevel3Fn("%s: %d\n" _C_ ut2->Ident _C_ n);
@@ -818,13 +818,13 @@
                }
                DebugLevel3Fn("Units around %d: %d\n" _C_ UnitNumber(unit) _C_ 
an);
                //
-               //              Count the requested units
+               // Count the requested units
                //
                for (j = s = 0; j < an; ++j) {
                        unit = around[j];
-                       if (unit->RescuedFrom) {                // only rescued 
units
+                       if (unit->RescuedFrom) { // only rescued units
                                //
-                               //              Check unit type
+                               // Check unit type
                                //
                                // FIXME: ALL_UNITS
                                if (unittype == ANY_UNIT ||
@@ -832,7 +832,7 @@
                                                (unittype == ALL_BUILDINGS && 
unit->Type->Building) ||
                                                (unittype == unit->Type)) {
                                        //
-                                       //              Check the player
+                                       // Check the player
                                        //
                                        if (plynr == -1 || plynr == 
unit->Player->Player) {
                                                ++s;
@@ -888,7 +888,7 @@
        }
 
        //
-       //              Get all unit types 'near'.
+       // Get all unit types 'near'.
        //
        n = FindUnitsByType(ut2, table);
        DebugLevel3Fn("%s: %d\n" _C_ ut2->Ident _C_ n);
@@ -918,13 +918,13 @@
                }
                DebugLevel3Fn("Units around %d: %d\n" _C_ UnitNumber(unit) _C_ 
an);
                //
-               //              Count the requested units
+               // Count the requested units
                //
                for (j = s = 0; j < an; ++j) {
                        unit = around[j];
-                       if (unit->RescuedFrom) {                // only rescued 
units
+                       if (unit->RescuedFrom) { // only rescued units
                                //
-                               //              Check unit type
+                               // Check unit type
                                //
                                // FIXME: ALL_UNITS
                                if (unittype == ANY_UNIT ||
@@ -932,7 +932,7 @@
                                                (unittype == ALL_BUILDINGS && 
unit->Type->Building) ||
                                                (unittype == unit->Type)) {
                                        //
-                                       //              Check the player
+                                       // Check the player
                                        //
                                        if (plynr == -1 || plynr == 
unit->Player->Player) {
                                                ++s;
@@ -958,7 +958,7 @@
 #endif
 
 /**
-**             Player has n opponents left.
+**  Player has n opponents left.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclIfOpponents(SCM player, SCM operation, SCM quantity)
@@ -987,14 +987,14 @@
        }
 
        //
-       //              Check the player opponents
+       // Check the player opponents
        //
        for (n = 0; plynr < pn; ++plynr) {
                int i;
 
                for (i = 0; i < PlayerMax; ++i) {
                        //
-                       //              This player is our enemy and has units 
left.
+                       // This player is our enemy and has units left.
                        //
                        if ((Players[i].Enemy & (1 << plynr)) && 
Players[i].TotalNumUnits) {
                                ++n;
@@ -1043,14 +1043,14 @@
        }
 
        //
-       //              Check the player opponents
+       // Check the player opponents
        //
        for (n = 0; plynr < pn; ++plynr) {
                int i;
 
                for (i = 0; i < PlayerMax; ++i) {
                        //
-                       //              This player is our enemy and has units 
left.
+                       // This player is our enemy and has units left.
                        //
                        if ((Players[i].Enemy & (1 << plynr)) && 
Players[i].TotalNumUnits) {
                                ++n;
@@ -1069,7 +1069,7 @@
 #endif
 
 /**
-**             Player has the quantity of resource.
+**  Player has the quantity of resource.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclIfResource(SCM player, SCM operation, SCM quantity, SCM resource)
@@ -1217,7 +1217,7 @@
 #endif
 
 /**
-**             Player has quantity kills
+**  Player has quantity kills
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclIfKills(SCM player, SCM operation, SCM quantity)
@@ -1300,7 +1300,7 @@
 #endif
 
 /**
-**             Player has a certain score
+**  Player has a certain score
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclIfScore(SCM player, SCM operation, SCM quantity)
@@ -1383,7 +1383,7 @@
 #endif
 
 /**
-**             Number of game cycles elapsed
+**  Number of game cycles elapsed
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclIfElapsed(SCM operation, SCM quantity)
@@ -1438,7 +1438,7 @@
 #endif
 
 /**
-**             Check the timer value
+**  Check the timer value
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclIfTimer(SCM operation, SCM quantity)
@@ -1502,7 +1502,7 @@
 #endif
 
 /**
-**             Check the switch value
+**  Check the switch value
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclIfSwitch(SCM number, SCM set)
@@ -1564,11 +1564,11 @@
 }
 #endif
 
-// --------------------------------------------------------------------------
-//             Actions
-
+/*---------------------------------------------------------------------------
+--             Actions
+---------------------------------------------------------------------------*/
 /**
-**             Action condition player wins.
+**  Action condition player wins.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclActionVictory(void)
@@ -1594,7 +1594,7 @@
 #endif
 
 /**
-**             Action condition player lose.
+**  Action condition player lose.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclActionDefeat(void)
@@ -1620,7 +1620,7 @@
 #endif
 
 /**
-**             Action condition player draw.
+**  Action condition player draw.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclActionDraw(void)
@@ -1646,7 +1646,7 @@
 #endif
 
 /**
-**             Action set timer
+**  Action set timer
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclActionSetTimer(SCM cycles, SCM increasing)
@@ -1676,7 +1676,7 @@
 #endif
 
 /**
-**             Action start timer
+**  Action start timer
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclActionStartTimer(void)
@@ -1700,7 +1700,7 @@
 #endif
 
 /**
-**             Action stop timer
+**  Action stop timer
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclActionStopTimer(void)
@@ -1722,7 +1722,7 @@
 #endif
 
 /**
-**             Action wait
+**  Action wait
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclActionWait(SCM ms)
@@ -1746,7 +1746,7 @@
 #endif
 
 /**
-**             Action stop timer
+**  Action stop timer
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclActionSetSwitch(SCM number, SCM set)
@@ -1804,7 +1804,7 @@
 #endif
 
 /**
-**             Add a trigger.
+**  Add a trigger.
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclAddTrigger(SCM condition, SCM action)
@@ -1812,8 +1812,8 @@
        SCM var;
 
        //
-       //              Make a list of all triggers.
-       //                              A trigger is a pair of condition and 
action
+       // Make a list of all triggers.
+       // A trigger is a pair of condition and action
        //
        var = gh_symbol2scm("*triggers*");
 
@@ -1846,8 +1846,8 @@
        }
 
        //
-       //              Make a list of all triggers.
-       //                              A trigger is a pair of condition and 
action
+       // Make a list of all triggers.
+       // A trigger is a pair of condition and action
        //
        lua_pushstring(l, "_triggers_");
        lua_gettable(l, LUA_GLOBALSINDEX);
@@ -1887,9 +1887,9 @@
 #endif
 
 /**
-**             Set the current trigger number
+**  Set the current trigger number
 **
-**             @param number                   Trigger number
+**  @param number  Trigger number
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local SCM CclSetTriggerNumber(SCM number)
@@ -1922,11 +1922,11 @@
 #endif
 
 /**
-**             Execute a trigger action
+**  Execute a trigger action
 **
-**             @param script           Script to execute
+**  @param script  Script to execute
 **
-**             @return                         1 if the trigger should be 
removed
+**  @return        1 if the trigger should be removed
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local int TriggerExecuteAction(SCM script)
@@ -1984,9 +1984,9 @@
 #endif
 
 /**
-**             Remove a trigger
+**  Remove a trigger
 **
-**             @param trig             Current trigger
+**  @param trig  Current trigger
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local void TriggerRemoveTrigger(SCM trig)
@@ -2011,7 +2011,7 @@
 #endif
 
 /**
-**             Check trigger each game cycle.
+**  Check trigger each game cycle.
 */
 global void TriggersEachCycle(void)
 {
@@ -2041,7 +2041,7 @@
                return;
        }
 
-       if (!gh_null_p(trig)) {                         // Next trigger
+       if (!gh_null_p(trig)) { // Next trigger
                pair = gh_car(trig);
                CclGcProtectedAssign(&Trigger, gh_cdr(trig));
                CclGcProtectedAssign(&WaitTrigger, trig);
@@ -2122,7 +2122,7 @@
 }
 
 /**
-**             Register CCL features for triggers.
+**  Register CCL features for triggers.
 */
 global void TriggerCclRegister(void)
 {
@@ -2160,7 +2160,9 @@
        gh_define("*triggers*", NIL);
 #elif defined(USE_LUA)
        lua_register(Lua, "AddTrigger", CclAddTrigger);
-//     lua_register(Lua, "SetTriggerNumber!", CclSetTriggerNumber);
+#if 0
+       lua_register(Lua, "SetTriggerNumber!", CclSetTriggerNumber);
+#endif
        // Conditions
        lua_register(Lua, "IfUnit", CclIfUnit);
        lua_register(Lua, "IfUnitAt", CclIfUnitAt);
@@ -2186,12 +2188,12 @@
 }
 
 /**
-**             Print a trigger from a LISP object.
-**             This is a modified version of lprin1g that prints
-**             (lambda) instead of #&lt;CLOSURE&gt;
+**  Print a trigger from a LISP object.
+**  This is a modified version of lprin1g that prints
+**  (lambda) instead of #&lt;CLOSURE&gt;
 **
-**             @param exp              Expression
-**             @param f                File to print to
+**  @param exp  Expression
+**  @param f    File to print to
 */
 #if defined(USE_GUILE) || defined(USE_SIOD)
 local void PrintTrigger(SCM exp, CLFile* f)
@@ -2200,7 +2202,9 @@
 #else
        SCM tmp;
        long n;
-//     struct user_type_hooks *p;
+#if 0
+       struct user_type_hooks *p;
+#endif
        extern char* subr_kind_str(long);
 
        STACK_CHECK(&exp);
@@ -2280,9 +2284,9 @@
 #endif
 
 /**
-**             Save the trigger module.
+**  Save the trigger module.
 **
-**             @param file             Open file to print to
+**  @param file  Open file to print to
 */
 global void SaveTriggers(CLFile* file)
 {
@@ -2292,7 +2296,7 @@
        int trigger;
 
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: trigger $Id: trigger.c,v 1.51 2003/12/20 
05:33:24 jsalmon3 Exp $\n\n");
+       CLprintf(file, ";;; MODULE: trigger $Id: trigger.c,v 1.52 2003/12/21 
10:51:31 wizzard Exp $\n\n");
 
        i = 0;
        trigger = -1;
@@ -2323,12 +2327,12 @@
 }
 
 /**
-**             Initialize the trigger module.
+**  Initialize the trigger module.
 */
 global void InitTriggers(void)
 {
        //
-       //              Setup default triggers
+       // Setup default triggers
        //
        WaitFrame = 0;
 
@@ -2354,7 +2358,7 @@
 }
 
 /**
-**             Clean up the trigger module.
+**  Clean up the trigger module.
 */
 global void CleanTriggers(void)
 {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]