stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src include/video.h map/minimap.c map...


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src include/video.h map/minimap.c map...
Date: 15 Jan 2004 04:50:11 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/15 04:50:09

Modified files:
        src/include    : video.h 
        src/map        : minimap.c tileset.c 
        src/missile    : missile.c 
        src/stratagus  : construct.c 
        src/ui         : icons.c ui.c 
        src/unit       : unit_draw.c unittype.c 
        src/video      : cursor.c font.c 

Log message:
        s/VideoSaveFree/VideoSafeFree/g

Patches:
Index: stratagus/src/include/video.h
diff -u stratagus/src/include/video.h:1.110 stratagus/src/include/video.h:1.111
--- stratagus/src/include/video.h:1.110 Wed Jan 14 16:42:10 2004
+++ stratagus/src/include/video.h       Thu Jan 15 04:49:57 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: video.h,v 1.110 2004/01/14 05:42:10 jsalmon3 Exp $
+//     $Id: video.h,v 1.111 2004/01/14 17:49:57 jsalmon3 Exp $
 
 #ifndef __VIDEO_H__
 #define __VIDEO_H__
@@ -482,8 +482,8 @@
 
        ///             Free a graphic object.
 extern void VideoFree(Graphic* o);
-       ///             Save (NULL) free a graphic object.
-#define VideoSaveFree(o) do { if ((o)) VideoFree((o)); } while(0)
+       ///             Safely (NULL) frees a graphic object.
+#define VideoSafeFree(o) do { if ((o)) { VideoFree((o)); } } while (0)
 
        /// Get the width of a single frame of a graphic object
 #define VideoGraphicWidth(o)           ((o)->Width)
Index: stratagus/src/map/minimap.c
diff -u stratagus/src/map/minimap.c:1.88 stratagus/src/map/minimap.c:1.89
--- stratagus/src/map/minimap.c:1.88    Fri Jan  9 16:44:38 2004
+++ stratagus/src/map/minimap.c Thu Jan 15 04:49:58 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: minimap.c,v 1.88 2004/01/09 05:44:38 jsalmon3 Exp $
+//     $Id: minimap.c,v 1.89 2004/01/14 17:49:58 jsalmon3 Exp $
 
 //@{
 
@@ -758,7 +758,7 @@
 */
 global void DestroyMinimap(void)
 {
-       VideoSaveFree(MinimapTerrainGraphic);
+       VideoSafeFree(MinimapTerrainGraphic);
        MinimapTerrainGraphic = NULL;
        if (MinimapGraphic) {
                free(MinimapGraphic);
Index: stratagus/src/map/tileset.c
diff -u stratagus/src/map/tileset.c:1.61 stratagus/src/map/tileset.c:1.62
--- stratagus/src/map/tileset.c:1.61    Fri Jan  9 16:44:39 2004
+++ stratagus/src/map/tileset.c Thu Jan 15 04:49:59 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: tileset.c,v 1.61 2004/01/09 05:44:39 jsalmon3 Exp $
+//     $Id: tileset.c,v 1.62 2004/01/14 17:49:59 jsalmon3 Exp $
 
 //@{
 
@@ -745,7 +745,7 @@
        char** sp;
 
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: tileset $Id: tileset.c,v 1.61 2004/01/09 
05:44:39 jsalmon3 Exp $\n\n");
+       CLprintf(file, ";;; MODULE: tileset $Id: tileset.c,v 1.62 2004/01/14 
17:49:59 jsalmon3 Exp $\n\n");
 
        //  Original number to internal tileset name
 
@@ -806,10 +806,10 @@
        //              Should this be done by the map?
        //
 #ifdef USE_SDL_SURFACE
-       VideoSaveFree(TheMap.TileGraphic);
+       VideoSafeFree(TheMap.TileGraphic);
        TheMap.TileGraphic = NULL;
 #else
-       VideoSaveFree(TheMap.TileData);
+       VideoSafeFree(TheMap.TileData);
        TheMap.TileData = NULL;
        free(TheMap.Tiles);
        TheMap.Tiles = NULL;
Index: stratagus/src/missile/missile.c
diff -u stratagus/src/missile/missile.c:1.123 
stratagus/src/missile/missile.c:1.124
--- stratagus/src/missile/missile.c:1.123       Sun Jan 11 07:54:00 2004
+++ stratagus/src/missile/missile.c     Thu Jan 15 04:50:00 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: missile.c,v 1.123 2004/01/10 20:54:00 jsalmon3 Exp $
+//      $Id: missile.c,v 1.124 2004/01/14 17:50:00 jsalmon3 Exp $
 
 //@{
 
@@ -1307,7 +1307,7 @@
 
        DebugCheck(file == NULL);
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: missile-types $Id: missile.c,v 1.123 
2004/01/10 20:54:00 jsalmon3 Exp $\n\n");
+       CLprintf(file, ";;; MODULE: missile-types $Id: missile.c,v 1.124 
2004/01/14 17:50:00 jsalmon3 Exp $\n\n");
 
        //
        // Original number to internal missile-type name.
@@ -1429,7 +1429,7 @@
        Missile* const* missiles;
 
        CLprintf(file,"\n--- -----------------------------------------\n");
-       CLprintf(file,"--- MODULE: missiles $Id: missile.c,v 1.123 2004/01/10 
20:54:00 jsalmon3 Exp $\n\n");
+       CLprintf(file,"--- MODULE: missiles $Id: missile.c,v 1.124 2004/01/14 
17:50:00 jsalmon3 Exp $\n\n");
 
        for (missiles = GlobalMissiles; *missiles; ++missiles) {
                SaveMissile(*missiles, file);
@@ -1492,7 +1492,7 @@
                free(mtype->ImpactSound.Name);
                free(mtype->ImpactName);
                free(mtype->SmokeName);
-               VideoSaveFree(mtype->Sprite);
+               VideoSafeFree(mtype->Sprite);
        }
        free(MissileTypes);
        MissileTypes = NULL;
Index: stratagus/src/stratagus/construct.c
diff -u stratagus/src/stratagus/construct.c:1.44 
stratagus/src/stratagus/construct.c:1.45
--- stratagus/src/stratagus/construct.c:1.44    Sat Jan  3 11:30:47 2004
+++ stratagus/src/stratagus/construct.c Thu Jan 15 04:50:02 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: construct.c,v 1.44 2004/01/03 00:30:47 jsalmon3 Exp $
+//     $Id: construct.c,v 1.45 2004/01/14 17:50:02 jsalmon3 Exp $
 
 //@{
 
@@ -148,7 +148,7 @@
        ConstructionFrame* cframe;
 
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: constructions $Id: construct.c,v 1.44 
2004/01/03 00:30:47 jsalmon3 Exp $\n\n");
+       CLprintf(file, ";;; MODULE: constructions $Id: construct.c,v 1.45 
2004/01/14 17:50:02 jsalmon3 Exp $\n\n");
 
        // FIXME: needed?
 
@@ -254,13 +254,13 @@
                                        free((*cop)->File[j].File);
                                }
                        }
-                       VideoSaveFree((*cop)->Sprite);
+                       VideoSafeFree((*cop)->Sprite);
                        for (j = 0; j < TilesetMax; ++j) {
                                if ((*cop)->ShadowFile[j].File) {
                                        free((*cop)->ShadowFile[j].File);
                                }
                        }
-                       VideoSaveFree((*cop)->ShadowSprite);
+                       VideoSafeFree((*cop)->ShadowSprite);
                        cframe = (*cop)->Frames;
                        while (cframe) {
                                tmp = cframe->Next;
Index: stratagus/src/ui/icons.c
diff -u stratagus/src/ui/icons.c:1.63 stratagus/src/ui/icons.c:1.64
--- stratagus/src/ui/icons.c:1.63       Sat Jan 10 17:13:01 2004
+++ stratagus/src/ui/icons.c    Thu Jan 15 04:50:04 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: icons.c,v 1.63 2004/01/10 06:13:01 jsalmon3 Exp $
+//      $Id: icons.c,v 1.64 2004/01/14 17:50:04 jsalmon3 Exp $
 
 //@{
 
@@ -288,7 +288,7 @@
                for (i = 0; i < n; ++i) {
                        hash_del(IconFileHash, table[i]->FileName);
                        free(table[i]->FileName);
-                       VideoSaveFree(table[i]->Sprite);
+                       VideoSafeFree(table[i]->Sprite);
                        free(table[i]);
                }
        }
@@ -433,7 +433,7 @@
        int i;
 
        CLprintf(file, "\n--- -----------------------------------------\n");
-       CLprintf(file, "--- MODULE: icons $Id: icons.c,v 1.63 2004/01/10 
06:13:01 jsalmon3 Exp $\n\n");
+       CLprintf(file, "--- MODULE: icons $Id: icons.c,v 1.64 2004/01/14 
17:50:04 jsalmon3 Exp $\n\n");
 
        //
        //  Mapping the original icon numbers in puds to our internal strings
Index: stratagus/src/ui/ui.c
diff -u stratagus/src/ui/ui.c:1.96 stratagus/src/ui/ui.c:1.97
--- stratagus/src/ui/ui.c:1.96  Thu Jan 15 01:06:42 2004
+++ stratagus/src/ui/ui.c       Thu Jan 15 04:50:04 2004
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: ui.c,v 1.96 2004/01/14 14:06:42 nobody_ Exp $
+//      $Id: ui.c,v 1.97 2004/01/14 17:50:04 jsalmon3 Exp $
 
 //@{
 
@@ -86,23 +86,23 @@
        int i;
 
        for (i = 0; i < ui->NumFillers; ++i) {
-               VideoSaveFree(ui->Filler[i].Graphic);
+               VideoSafeFree(ui->Filler[i].Graphic);
        }
-       VideoSaveFree(ui->Resource.Graphic);
+       VideoSafeFree(ui->Resource.Graphic);
 
        for (i = 0; i < MaxCosts + 2; ++i) {
-               VideoSaveFree(ui->Resources[i].Icon.Graphic);
+               VideoSafeFree(ui->Resources[i].Icon.Graphic);
        }
 
-       VideoSaveFree(ui->InfoPanel.Graphic);
-       VideoSaveFree(ui->ButtonPanel.Graphic);
-       VideoSaveFree(ui->MenuPanel.Graphic);
-       VideoSaveFree(ui->MinimapPanel.Graphic);
-       VideoSaveFree(ui->StatusLine.Graphic);
+       VideoSafeFree(ui->InfoPanel.Graphic);
+       VideoSafeFree(ui->ButtonPanel.Graphic);
+       VideoSafeFree(ui->MenuPanel.Graphic);
+       VideoSafeFree(ui->MinimapPanel.Graphic);
+       VideoSafeFree(ui->StatusLine.Graphic);
 
        menupanel = ui->MenuPanels;
        while (menupanel) {
-               VideoSaveFree(menupanel->Panel.Graphic);
+               VideoSafeFree(menupanel->Panel.Graphic);
                menupanel = menupanel->Next;
        }
 }
@@ -687,7 +687,7 @@
        int i;
 
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: ui $Id: ui.c,v 1.96 2004/01/14 14:06:42 
nobody_ Exp $\n\n");
+       CLprintf(file, ";;; MODULE: ui $Id: ui.c,v 1.97 2004/01/14 17:50:04 
jsalmon3 Exp $\n\n");
 
        // Scrolling
        CLprintf(file, "(set-mouse-scroll! %s)\n", TheUI.MouseScroll ? "#t" : 
"#f");
Index: stratagus/src/unit/unit_draw.c
diff -u stratagus/src/unit/unit_draw.c:1.202 
stratagus/src/unit/unit_draw.c:1.203
--- stratagus/src/unit/unit_draw.c:1.202        Sun Jan 11 07:54:42 2004
+++ stratagus/src/unit/unit_draw.c      Thu Jan 15 04:50:05 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: unit_draw.c,v 1.202 2004/01/10 20:54:42 jsalmon3 Exp $
+//      $Id: unit_draw.c,v 1.203 2004/01/14 17:50:05 jsalmon3 Exp $
 
 //@{
 
@@ -744,7 +744,7 @@
 {
 #if 0
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.202 
2004/01/10 20:54:42 jsalmon3 Exp $\n\n");
+       CLprintf(file, ";;; MODULE: decorations $Id: unit_draw.c,v 1.203 
2004/01/14 17:50:05 jsalmon3 Exp $\n\n");
 
        CLprintf(file, "(mana-sprite \"%s\"  %d %d  %d %d)\n",
                ManaSprite.File, ManaSprite.HotX, ManaSprite.HotY,
@@ -810,28 +810,28 @@
        if (HealthSprite.File) {
                free(HealthSprite.File);
        }
-       VideoSaveFree(HealthSprite.Sprite);
+       VideoSafeFree(HealthSprite.Sprite);
        HealthSprite.File = NULL;
        HealthSprite.Sprite = NULL;
 
        if (ManaSprite.File) {
                free(ManaSprite.File);
        }
-       VideoSaveFree(ManaSprite.Sprite);
+       VideoSafeFree(ManaSprite.Sprite);
        ManaSprite.File = NULL;
        ManaSprite.Sprite = NULL;
 
        if (ShadowSprite.File) {
                free(ShadowSprite.File);
        }
-       VideoSaveFree(ShadowSprite.Sprite);
+       VideoSafeFree(ShadowSprite.Sprite);
        ShadowSprite.File = NULL;
        ShadowSprite.Sprite = NULL;
 
        if (SpellSprite.File) {
                free(SpellSprite.File);
        }
-       VideoSaveFree(SpellSprite.Sprite);
+       VideoSafeFree(SpellSprite.Sprite);
        SpellSprite.File = NULL;
        SpellSprite.Sprite = NULL;
 }
Index: stratagus/src/unit/unittype.c
diff -u stratagus/src/unit/unittype.c:1.137 stratagus/src/unit/unittype.c:1.138
--- stratagus/src/unit/unittype.c:1.137 Wed Jan 14 16:38:27 2004
+++ stratagus/src/unit/unittype.c       Thu Jan 15 04:50:05 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unittype.c,v 1.137 2004/01/14 05:38:27 jsalmon3 Exp $
+//     $Id: unittype.c,v 1.138 2004/01/14 17:50:05 jsalmon3 Exp $
 
 //@{
 
@@ -1193,7 +1193,7 @@
 //     char** sp;
 
        CLprintf(file, "\n--- -----------------------------------------\n");
-       CLprintf(file, "--- MODULE: unittypes $Id: unittype.c,v 1.137 
2004/01/14 05:38:27 jsalmon3 Exp $\n\n");
+       CLprintf(file, "--- MODULE: unittypes $Id: unittype.c,v 1.138 
2004/01/14 17:50:05 jsalmon3 Exp $\n\n");
 #if 0
        // Original number to internal unit-type name.
 
@@ -1584,10 +1584,10 @@
                for (res = 0; res < MaxCosts; ++res) {
                        if (type->ResInfo[res]) {
                                if (type->ResInfo[res]->SpriteWhenLoaded) {
-                                       
VideoSaveFree(type->ResInfo[res]->SpriteWhenLoaded);
+                                       
VideoSafeFree(type->ResInfo[res]->SpriteWhenLoaded);
                                }
                                if (type->ResInfo[res]->SpriteWhenEmpty) {
-                                       
VideoSaveFree(type->ResInfo[res]->SpriteWhenEmpty);
+                                       
VideoSafeFree(type->ResInfo[res]->SpriteWhenEmpty);
                                }
                                if (type->ResInfo[res]->FileWhenEmpty) {
                                        free(type->ResInfo[res]->FileWhenEmpty);
@@ -1630,11 +1630,11 @@
                }
 
                if (!type->SameSprite) {                // our own graphics
-                       VideoSaveFree(type->Sprite);
+                       VideoSafeFree(type->Sprite);
                }
 #ifdef USE_OPENGL
                for (i = 0; i < PlayerMax; ++i) {
-                       VideoSaveFree(type->PlayerColorSprite[i]);
+                       VideoSafeFree(type->PlayerColorSprite[i]);
                }
 #endif
                free(UnitTypes[i]);
Index: stratagus/src/video/cursor.c
diff -u stratagus/src/video/cursor.c:1.90 stratagus/src/video/cursor.c:1.91
--- stratagus/src/video/cursor.c:1.90   Sat Jan 10 07:23:25 2004
+++ stratagus/src/video/cursor.c        Thu Jan 15 04:50:08 2004
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: cursor.c,v 1.90 2004/01/09 20:23:25 jsalmon3 Exp $
+//      $Id: cursor.c,v 1.91 2004/01/14 17:50:08 jsalmon3 Exp $
 
 //@{
 
@@ -226,7 +226,7 @@
        //              Free old cursor sprites.
        //
        for (i = 0; Cursors[i].OType; ++i) {
-               VideoSaveFree(Cursors[i].Sprite);
+               VideoSafeFree(Cursors[i].Sprite);
                Cursors[i].Sprite = NULL;
        }
 
@@ -1261,7 +1261,7 @@
        int i;
 
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.90 2004/01/09 
20:23:25 jsalmon3 Exp $\n\n");
+       CLprintf(file, ";;; MODULE: cursors $Id: cursor.c,v 1.91 2004/01/14 
17:50:08 jsalmon3 Exp $\n\n");
 
        for (i = 0; Cursors[i].OType; ++i) {
                CLprintf(file, "(define-cursor '%s '%s\n",
@@ -1308,7 +1308,7 @@
                free(Cursors[i].Ident);
                free(Cursors[i].Race);
                free(Cursors[i].File);
-               VideoSaveFree(Cursors[i].Sprite);
+               VideoSafeFree(Cursors[i].Sprite);
        }
        free(Cursors);
        Cursors = NULL;
Index: stratagus/src/video/font.c
diff -u stratagus/src/video/font.c:1.74 stratagus/src/video/font.c:1.75
--- stratagus/src/video/font.c:1.74     Wed Jan 14 16:33:27 2004
+++ stratagus/src/video/font.c  Thu Jan 15 04:50:08 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: font.c,v 1.74 2004/01/14 05:33:27 jsalmon3 Exp $
+//      $Id: font.c,v 1.75 2004/01/14 17:50:08 jsalmon3 Exp $
 
 //@{
 
@@ -1175,7 +1175,7 @@
                lua_error(l);
        }
        free(Fonts[i].File);
-       VideoSaveFree(Fonts[i].Graphic);
+       VideoSafeFree(Fonts[i].Graphic);
        Fonts[i].Graphic = NULL;
        Fonts[i].File = file;
        Fonts[i].Width = w;
@@ -1295,7 +1295,7 @@
 
        for (i = 0; i < sizeof(Fonts) / sizeof(*Fonts); ++i) {
                free(Fonts[i].File);
-               VideoSaveFree(Fonts[i].Graphic);
+               VideoSafeFree(Fonts[i].Graphic);
                Fonts[i].File = NULL;
                Fonts[i].Graphic = NULL;
        }




reply via email to

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