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: Jimmy Salmon
Subject: [Stratagus-CVS] stratagus/src/game campaign.c game.c intro.c lo...
Date: Thu, 02 Oct 2003 11:39:32 -0400

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Jimmy Salmon <address@hidden>   03/10/02 11:39:32

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

Log message:
        Cleanup

Patches:
Index: stratagus/src/game/campaign.c
diff -u stratagus/src/game/campaign.c:1.34 stratagus/src/game/campaign.c:1.35
--- stratagus/src/game/campaign.c:1.34  Fri Sep 26 19:57:10 2003
+++ stratagus/src/game/campaign.c       Thu Oct  2 11:39:32 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: campaign.c,v 1.34 2003/09/26 23:57:10 jsalmon3 Exp $
+//     $Id: campaign.c,v 1.35 2003/10/02 15:39:32 jsalmon3 Exp $
 
 //@{
 
@@ -68,7 +68,7 @@
 local CampaignChapter* CurrentChapter; /// Playing this chapter of campaign
 local int SkipCurrentChapter = 1;      /// Skip the current chapter when
                                         /// looking for the next one
-

+
 /*----------------------------------------------------------------------------
 --     Functions
 ----------------------------------------------------------------------------*/
@@ -237,7 +237,7 @@
                    } else if (!strcmp(str, "center")) {
                        (*text)->Align = PictureTextAlignCenter;
                    } else {
-                       errl("Invalid chapter picture text align value",

+                       errl("Invalid chapter picture text align value",
                            gh_car(sublist));
                    }
                    free(str);
@@ -523,7 +523,7 @@
     int i;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: campaign $Id: campaign.c,v 1.34 2003/09/26 
23:57:10 jsalmon3 Exp $\n\n");
+    CLprintf(file, ";;; MODULE: campaign $Id: campaign.c,v 1.35 2003/10/02 
15:39:32 jsalmon3 Exp $\n\n");
     if (!CurrentCampaign) {
        return;
     }
Index: stratagus/src/game/game.c
diff -u stratagus/src/game/game.c:1.105 stratagus/src/game/game.c:1.106
--- stratagus/src/game/game.c:1.105     Mon Sep 29 22:53:01 2003
+++ stratagus/src/game/game.c   Thu Oct  2 11:39:32 2003
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: game.c,v 1.105 2003/09/30 02:53:01 jsalmon3 Exp $
+//     $Id: game.c,v 1.106 2003/10/02 15:39:32 jsalmon3 Exp $
 
 //@{
 
@@ -88,7 +88,7 @@
 **     @param map      map loaded
 */
 local void LoadStratagusMap(const char* filename,
-       WorldMap* map __attribute__((unused)))
+    WorldMap* map __attribute__((unused)))
 {
     DebugLevel3Fn("%p \n" _C_ map);
 
@@ -104,7 +104,7 @@
 #if 0
     // Not true if multiplayer levels!
     if (!ThisPlayer) {         /// ARI: bomb if nothing was loaded!
-       fprintf(stderr,"%s: invalid Stratagus map\n", filename);
+       fprintf(stderr, "%s: invalid Stratagus map\n", filename);
        ExitFatal(-1);
     }
     // FIXME: Retrieve map->Info from somewhere... If LoadPud is used in CCL 
it magically is set there :)
@@ -507,7 +507,7 @@
     }
 #endif
     ViewportCenterViewpoint(TheUI.SelectedViewport,
-           ThisPlayer->StartX, ThisPlayer->StartY);
+       ThisPlayer->StartX, ThisPlayer->StartY);
 
     //
     // Various hacks wich must be done after the map is loaded.
Index: stratagus/src/game/intro.c
diff -u stratagus/src/game/intro.c:1.100 stratagus/src/game/intro.c:1.101
--- stratagus/src/game/intro.c:1.100    Fri Sep 26 21:26:00 2003
+++ stratagus/src/game/intro.c  Thu Oct  2 11:39:32 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: intro.c,v 1.100 2003/09/27 01:26:00 jsalmon3 Exp $
+//     $Id: intro.c,v 1.101 2003/10/02 15:39:32 jsalmon3 Exp $
 
 //@{
 
@@ -105,10 +105,10 @@
 local void IntroCallbackButton1(unsigned button)
 {
     if (UseContinueButton) {
-       if ((1 << button) == LeftButton && ContinueButtonX <= CursorX
-               && CursorX <= ContinueButtonX + 106
-               && ContinueButtonY <= CursorY
-               && CursorY <= ContinueButtonY + 27) {
+       if ((1 << button) == LeftButton && ContinueButtonX <= CursorX &&
+               CursorX <= ContinueButtonX + 106 &&
+               ContinueButtonY <= CursorY &&
+               CursorY <= ContinueButtonY + 27) {
            ContinueButtonFlags |= MenuButtonClicked;
        }
     } else {
@@ -123,11 +123,11 @@
 local void IntroCallbackButton2(unsigned button)
 {
     if (UseContinueButton) {
-       if ((1 << button) == LeftButton && ContinueButtonX <= CursorX
-               && CursorX <= ContinueButtonX + 106
-               && ContinueButtonY <= CursorY
-               && CursorY <= ContinueButtonY + 27
-               && (ContinueButtonFlags & MenuButtonClicked)) {
+       if ((1 << button) == LeftButton && ContinueButtonX <= CursorX &&
+               CursorX <= ContinueButtonX + 106 &&
+               ContinueButtonY <= CursorY &&
+               CursorY <= ContinueButtonY + 27 &&
+               (ContinueButtonFlags & MenuButtonClicked)) {
            IntroNoEvent = 0;
        }
        ContinueButtonFlags &= ~MenuButtonClicked;
@@ -171,7 +171,7 @@
 **     Callback for input.
 */
 local void IntroCallbackKey3(unsigned key __attribute__((unused)),
-                            unsigned keychar __attribute__((unused)))
+    unsigned keychar __attribute__((unused)))
 {
 }
 
@@ -184,8 +184,8 @@
     CursorY = y;
 
     if (UseContinueButton) {
-       if( ContinueButtonX <= CursorX && CursorX <= ContinueButtonX + 106 &&
-           ContinueButtonY <= CursorY && CursorY <= ContinueButtonY + 27 ) {
+       if (ContinueButtonX <= CursorX && CursorX <= ContinueButtonX + 106 &&
+               ContinueButtonY <= CursorY && CursorY <= ContinueButtonY + 27) {
            ContinueButtonFlags |= MenuButtonActive;
        }
        else {
@@ -493,20 +493,20 @@
        //      Draw background
        //
        VideoDrawSubClip(background, 0, 0,
-               background->Width, background->Height,
-               (VideoWidth - background->Width) / 2,
-               (VideoHeight - background->Height) / 2);
+           background->Width, background->Height,
+           (VideoWidth - background->Width) / 2,
+           (VideoHeight - background->Height) / 2);
        //
        //      Draw title
        //
        SetDefaultTextColors(FontWhite, FontYellow);
-       VideoDrawTextCentered((70 + 340) / 2 * VideoWidth / 640, 28 * 
VideoHeight / 480,
-           LargeFont,intro->Title);
+       VideoDrawTextCentered((70 + 340) / 2 * VideoWidth / 640,
+           28 * VideoHeight / 480, LargeFont, intro->Title);
        //
        //      Draw scrolling text
        //
-       ScrollText(70 * VideoWidth / 640, 80 * VideoHeight / 480, 70 * 
VideoWidth / 640 + 320,
-           170 * VideoHeight / 480, line, scrolling_text);
+       ScrollText(70 * VideoWidth / 640, 80 * VideoHeight / 480,
+           70 * VideoWidth / 640 + 320, 170 * VideoHeight / 480, line, 
scrolling_text);
 
        //
        //      Draw objectives
@@ -966,7 +966,7 @@
        } else {
            outcome = "Defeat!";
        }
-       VideoDrawTextCentered(x + 106, y + top_offset + 21, LargeTitleFont,

+       VideoDrawTextCentered(x + 106, y + top_offset + 21, LargeTitleFont,
            outcome);
     }
 
@@ -1022,7 +1022,7 @@
        }
 
        sprintf(buf, "%s - You", ThisPlayer->Name);
-       VideoDrawTextCentered(x + 320, y + bottom_offset + description_offset + 
26,

+       VideoDrawTextCentered(x + 320, y + bottom_offset + description_offset + 
26,
            names_font, buf);
        VideoDrawTextCentered(x + 50, y + bottom_offset, LargeFont, "Units");
        sprintf(buf, "%u", ThisPlayer->TotalUnits);
@@ -1041,11 +1041,11 @@
            } else {
                sprintf(buf, "%s - Neutral", p->Name);
            }
-           VideoDrawTextCentered(x + 320, y + bottom_offset + 
description_offset + 26 + line_spacing * c,

+           VideoDrawTextCentered(x + 320, y + bottom_offset + 
description_offset + 26 + line_spacing * c,
                names_font, buf);
            sprintf(buf, "%u", p->TotalUnits);
            percent = p->TotalUnits * 100 / max;
-           DrawStatBox(x + 10, y + bottom_offset + description_offset + 
line_spacing * c,

+           DrawStatBox(x + 10, y + bottom_offset + description_offset + 
line_spacing * c,
                buf, p->Color, percent);
            ++c;
        }
@@ -1069,7 +1069,7 @@
        VideoDrawTextCentered(x + 140, y + bottom_offset, LargeFont, 
"Buildings");
        sprintf(buf, "%u", ThisPlayer->TotalBuildings);
        percent = ThisPlayer->TotalBuildings * 100 / max;
-       DrawStatBox(x + 100, y + bottom_offset + description_offset, buf,

+       DrawStatBox(x + 100, y + bottom_offset + description_offset, buf,
            ThisPlayer->Color, percent);
        for (i = 0, c = 1; i < PlayerMax - 1; ++i) {
            p = &Players[i];
@@ -1078,7 +1078,7 @@
            }
            sprintf(buf, "%u", p->TotalBuildings);
            percent = p->TotalBuildings * 100 / max;
-           DrawStatBox(x + 100, y + bottom_offset + description_offset + 
line_spacing * c,

+           DrawStatBox(x + 100, y + bottom_offset + description_offset + 
line_spacing * c,
                buf, p->Color, percent);
            ++c;
        }
@@ -1102,7 +1102,7 @@
        VideoDrawTextCentered(x + 230, y + bottom_offset, LargeFont, "Gold");
        sprintf(buf, "%u", ThisPlayer->TotalResources[GoldCost]);
        percent = ThisPlayer->TotalResources[GoldCost] * 100 / max;
-       DrawStatBox(x + 190, y + bottom_offset + description_offset, buf,

+       DrawStatBox(x + 190, y + bottom_offset + description_offset, buf,
            ThisPlayer->Color, percent);
        for (i = 0, c = 1; i < PlayerMax - 1; ++i) {
            p = &Players[i];
@@ -1111,7 +1111,7 @@
            }
             sprintf(buf, "%u", p->TotalResources[GoldCost]);
            percent = p->TotalResources[GoldCost] * 100 / max;
-           DrawStatBox(x + 190, y + bottom_offset + description_offset + 
line_spacing * c,

+           DrawStatBox(x + 190, y + bottom_offset + description_offset + 
line_spacing * c,
                buf, p->Color, percent);
            ++c;
        }
@@ -1135,7 +1135,7 @@
        VideoDrawTextCentered(x + 320, y + bottom_offset, LargeFont, "Lumber");
        sprintf(buf, "%u", ThisPlayer->TotalResources[WoodCost]);
        percent = ThisPlayer->TotalResources[WoodCost] * 100 / max;
-       DrawStatBox(x + 280, y + bottom_offset + description_offset, buf,

+       DrawStatBox(x + 280, y + bottom_offset + description_offset, buf,
            ThisPlayer->Color, percent);
        for (i = 0, c = 1; i < PlayerMax - 1; ++i) {
            p = &Players[i];
@@ -1144,7 +1144,7 @@
            }
             sprintf(buf, "%u", p->TotalResources[WoodCost]);
            percent = p->TotalResources[WoodCost] * 100 / max;
-           DrawStatBox(x + 280, y + bottom_offset + description_offset + 
line_spacing * c,

+           DrawStatBox(x + 280, y + bottom_offset + description_offset + 
line_spacing * c,
                buf, p->Color,percent);
            ++c;
        }
@@ -1168,7 +1168,7 @@
        VideoDrawTextCentered(x + 410, y + bottom_offset, LargeFont, "Oil");
        sprintf(buf, "%u", ThisPlayer->TotalResources[OilCost]);
        percent = ThisPlayer->TotalResources[OilCost] * 100 / max;
-       DrawStatBox(x + 370, y + bottom_offset + description_offset, buf,

+       DrawStatBox(x + 370, y + bottom_offset + description_offset, buf,
            ThisPlayer->Color, percent);
        for (i = 0, c = 1; i < PlayerMax - 1; ++i) {
            p = &Players[i];
@@ -1177,7 +1177,7 @@
            }
            sprintf(buf, "%u", p->TotalResources[OilCost]);
            percent = p->TotalResources[OilCost] * 100 / max;
-           DrawStatBox(x + 370, y + bottom_offset + description_offset + 
line_spacing * c,

+           DrawStatBox(x + 370, y + bottom_offset + description_offset + 
line_spacing * c,
                buf, p->Color,percent);
            ++c;
        }
@@ -1201,7 +1201,7 @@
        VideoDrawTextCentered(x + 500, y + bottom_offset, LargeFont, "Kills");
        percent = ThisPlayer->TotalKills * 100 / max;
        sprintf(buf, "%u", ThisPlayer->TotalKills);
-       DrawStatBox(x + 460, y + bottom_offset + description_offset, buf,

+       DrawStatBox(x + 460, y + bottom_offset + description_offset, buf,
            ThisPlayer->Color, percent);
        for (i = 0, c = 1; i < PlayerMax - 1; ++i) {
            p = &Players[i];
@@ -1210,7 +1210,7 @@
            }
            sprintf(buf, "%u", p->TotalKills);
            percent = p->TotalKills * 100 / max;
-           DrawStatBox(x + 460, y + bottom_offset + description_offset + 
line_spacing * c,

+           DrawStatBox(x + 460, y + bottom_offset + description_offset + 
line_spacing * c,
                buf, p->Color,percent);
            ++c;
        }
@@ -1234,7 +1234,7 @@
        VideoDrawTextCentered(x + 590, y + bottom_offset, LargeFont, "Razings");
        sprintf(buf, "%u", ThisPlayer->TotalRazings);
        percent = ThisPlayer->TotalRazings * 100 / max;
-       DrawStatBox(x + 550, y + bottom_offset + description_offset, buf,

+       DrawStatBox(x + 550, y + bottom_offset + description_offset, buf,
            ThisPlayer->Color, percent);
        for (i = 0, c = 1; i < PlayerMax - 1; ++i) {
            p = &Players[i];
@@ -1243,7 +1243,7 @@
            }
            sprintf(buf, "%u", p->TotalRazings);
            percent = p->TotalRazings * 100 / max;
-           DrawStatBox(x + 550, y + bottom_offset + description_offset + 
line_spacing * c,

+           DrawStatBox(x + 550, y + bottom_offset + description_offset + 
line_spacing * c,
                buf, p->Color, percent);
            ++c;
        }
@@ -1389,7 +1389,7 @@
        GameCredits.Names = (char*)malloc(1);
        GameCredits.Names[0] = '\0';
     }
-    len=0;
+    len = 0;
 
     while (!gh_null_p(list)) {
        value = gh_car(list);
@@ -1399,9 +1399,9 @@
            GameCredits.Background = gh_scm2newstr(gh_car(list), NULL);
            list = gh_cdr(list);
        }
-       if (gh_eq_p(value, gh_symbol2scm("name")) ||

-               gh_eq_p(value, gh_symbol2scm("title")) ||

-               gh_eq_p(value, gh_symbol2scm("comment")) ) {
+       if (gh_eq_p(value, gh_symbol2scm("name")) ||
+               gh_eq_p(value, gh_symbol2scm("title")) ||
+               gh_eq_p(value, gh_symbol2scm("comment"))) {
            n = get_c_string(gh_car(list));
            nlen = strlen(n);
            GameCredits.Names = (char*)realloc(GameCredits.Names, len + nlen + 
2);
Index: stratagus/src/game/loadgame.c
diff -u stratagus/src/game/loadgame.c:1.63 stratagus/src/game/loadgame.c:1.64
--- stratagus/src/game/loadgame.c:1.63  Fri Sep 26 22:05:35 2003
+++ stratagus/src/game/loadgame.c       Thu Oct  2 11:39:32 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: loadgame.c,v 1.63 2003/09/27 02:05:35 jsalmon3 Exp $
+//     $Id: loadgame.c,v 1.64 2003/10/02 15:39:32 jsalmon3 Exp $
 
 //@{
 
@@ -180,11 +180,11 @@
     MapUnitSounds();
     InitAStar();
 #ifdef WITH_SOUND
-    if (SoundFildes!=-1) {
+    if (SoundFildes != -1) {
        //FIXME: must be done after map is loaded
-       if ( InitSoundServer() ) {
-           SoundOff=1;
-           SoundFildes=-1;
+       if (InitSoundServer()) {
+           SoundOff = 1;
+           SoundFildes = -1;
        } else {
            // must be done after sounds are loaded
            InitSoundClient();
Index: stratagus/src/game/trigger.c
diff -u stratagus/src/game/trigger.c:1.43 stratagus/src/game/trigger.c:1.44
--- stratagus/src/game/trigger.c:1.43   Fri Sep 26 22:52:18 2003
+++ stratagus/src/game/trigger.c        Thu Oct  2 11:39:32 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: trigger.c,v 1.43 2003/09/27 02:52:18 jsalmon3 Exp $
+//     $Id: trigger.c,v 1.44 2003/10/02 15:39:32 jsalmon3 Exp $
 
 //@{
 
@@ -165,7 +165,7 @@
            return &CompareEq;
        }
     } else if (op[0] == '>') {
-       if (op[1] == '=' && op[2] == '\0' ) {
+       if (op[1] == '=' && op[2] == '\0') {
            return &CompareGrEq;
        } else if (op[1] == '\0') {
            return &CompareGr;
@@ -176,7 +176,7 @@
        } else if (op[1] == '\0') {
            return &CompareLe;
        }
-    } else if (op[0] == '!' && op[1] == '=' && op[2] == '\0' ) {
+    } else if (op[0] == '!' && op[1] == '=' && op[2] == '\0') {
        return &CompareNEq;
     }
     return NULL;
@@ -376,13 +376,11 @@
        // FIXME: Yes, but caller should check.
        // NOTE: +1 right,bottom isn't inclusive :(
        if (unit->Type->UnitType == UnitTypeLand) {
-           an = SelectUnits(
-               unit->X - 1, unit->Y - 1,
+           an = SelectUnits(unit->X - 1, unit->Y - 1,
                unit->X + unit->Type->TileWidth + 1,
                unit->Y + unit->Type->TileHeight + 1, around);
        } else {
-           an = SelectUnits(
-               unit->X - 2, unit->Y - 2,
+           an = SelectUnits(unit->X - 2, unit->Y - 2,
                unit->X + unit->Type->TileWidth + 2,
                unit->Y + unit->Type->TileHeight + 2, around);
        }
@@ -470,13 +468,11 @@
        // FIXME: Yes, but caller should check.
        // NOTE: +1 right,bottom isn't inclusive :(
        if (unit->Type->UnitType == UnitTypeLand) {
-           an=SelectUnits(
-               unit->X - 1, unit->Y - 1,
+           an = SelectUnits(unit->X - 1, unit->Y - 1,
                unit->X + unit->Type->TileWidth + 1,
                unit->Y + unit->Type->TileHeight + 1, around);
        } else {
-           an=SelectUnits(
-               unit->X - 2, unit->Y - 2,
+           an = SelectUnits(unit->X - 2, unit->Y - 2,
                unit->X + unit->Type->TileWidth + 2,
                unit->Y + unit->Type->TileHeight + 2, around);
        }
@@ -596,7 +592,7 @@
        plynr = 0;
        pn = PlayerMax;
     } else {
-       pn = plynr+1;
+       pn = plynr + 1;
     }
 
     for (i = 0; i < MaxCosts; ++i) {
@@ -1190,7 +1186,7 @@
     int trigger;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: trigger $Id: trigger.c,v 1.43 2003/09/27 
02:52:18 jsalmon3 Exp $\n\n");
+    CLprintf(file, ";;; MODULE: trigger $Id: trigger.c,v 1.44 2003/10/02 
15:39:32 jsalmon3 Exp $\n\n");
 
     i = 0;
     trigger = -1;




reply via email to

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