stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src include/unit.h ui/mainscr.c unit/...


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src include/unit.h ui/mainscr.c unit/...
Date: 2 Jan 2004 11:36:35 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/02 11:36:35

Modified files:
        src/include    : unit.h 
        src/ui         : mainscr.c 
        src/unit       : ccl_unit.c unit.c 

Log message:
        Removed unit name

Patches:
Index: stratagus/src/include/unit.h
diff -u stratagus/src/include/unit.h:1.241 stratagus/src/include/unit.h:1.242
--- stratagus/src/include/unit.h:1.241  Sat Dec 20 16:33:28 2003
+++ stratagus/src/include/unit.h        Fri Jan  2 11:36:31 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unit.h,v 1.241 2003/12/20 05:33:28 jsalmon3 Exp $
+//     $Id: unit.h,v 1.242 2004/01/02 00:36:31 jsalmon3 Exp $
 
 #ifndef __UNIT_H__
 #define __UNIT_H__
@@ -500,8 +500,6 @@
        Unit*           Container;                              /// Pointer to 
the unit containing it (or 0)
        Unit*           NextContained;                          /// Next unit 
in the container.
        Unit*           PrevContained;                          /// Previous 
unit in the container.
-
-       char*           Name;                                           /// 
Unit own name
 
        int                             X;                                      
        /// Map position X
        int                             Y;                                      
        /// Map position Y
Index: stratagus/src/ui/mainscr.c
diff -u stratagus/src/ui/mainscr.c:1.146 stratagus/src/ui/mainscr.c:1.147
--- stratagus/src/ui/mainscr.c:1.146    Sat Dec 20 16:33:41 2003
+++ stratagus/src/ui/mainscr.c  Fri Jan  2 11:36:32 2004
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: mainscr.c,v 1.146 2003/12/20 05:33:41 jsalmon3 Exp $
+//     $Id: mainscr.c,v 1.147 2004/01/02 00:36:32 jsalmon3 Exp $
 
 //@{
 
@@ -437,13 +437,7 @@
                                UiDrawManaBar(uins, 
TheUI.TransportingButtons[i].X, TheUI.TransportingButtons[i].Y);
                        }
                        if (ButtonAreaUnderCursor == ButtonAreaTransporting && 
ButtonUnderCursor == i) {
-                               if (uins->Name) {
-                                       char buf[128];
-                                       sprintf(buf, "%s %s", uins->Type->Name, 
uins->Name);
-                                       SetStatusLine(buf);
-                               } else {
-                                       SetStatusLine(uins->Type->Name);
-                               }
+                               SetStatusLine(uins->Type->Name);
                        }
                }
                return;
@@ -1132,15 +1126,7 @@
 
                                if (ButtonAreaUnderCursor == ButtonAreaSelected 
&&
                                                ButtonUnderCursor == i) {
-                                       if (Selected[i]->Name) {
-                                               char buf[128];
-
-                                               sprintf(buf, "%s %s", 
Selected[i]->Type->Name,
-                                                       Selected[i]->Name);
-                                               SetStatusLine(buf);
-                                       } else {
-                                               
SetStatusLine(Selected[i]->Type->Name);
-                                       }
+                                       SetStatusLine(Selected[i]->Type->Name);
                                }
                        }
                        if (NumSelected > TheUI.NumSelectedButtons) {
@@ -1170,15 +1156,7 @@
                        DrawInfoPanelBackground(i);
                        DrawUnitInfo(Selected[0]);
                        if (ButtonAreaUnderCursor == ButtonAreaSelected && 
ButtonUnderCursor == 0) {
-                               if (Selected[0]->Name) {
-                                       char buf[128];
-
-                                       sprintf(buf, "%s %s", 
Selected[0]->Type->Name,
-                                               Selected[0]->Name);
-                                       SetStatusLine(buf);
-                               } else {
-                                       SetStatusLine(Selected[0]->Type->Name);
-                               }
+                               SetStatusLine(Selected[0]->Type->Name);
                        }
                        return;
                }
Index: stratagus/src/unit/ccl_unit.c
diff -u stratagus/src/unit/ccl_unit.c:1.87 stratagus/src/unit/ccl_unit.c:1.88
--- stratagus/src/unit/ccl_unit.c:1.87  Fri Jan  2 08:24:19 2004
+++ stratagus/src/unit/ccl_unit.c       Fri Jan  2 11:36:33 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl_unit.c,v 1.87 2004/01/01 21:24:19 jsalmon3 Exp $
+//     $Id: ccl_unit.c,v 1.88 2004/01/02 00:36:33 jsalmon3 Exp $
 
 //@{
 
@@ -661,8 +661,6 @@
                        type = UnitTypeByIdent(LuaToString(l, j + 1));
                } else if (!strcmp(value, "seen-type")) {
                        seentype = UnitTypeByIdent(LuaToString(l, j + 1));
-               } else if (!strcmp(value, "name")) {
-                       unit->Name = strdup(LuaToString(l, j + 1));
                } else if (!strcmp(value, "player")) {
                        player = &Players[(int)LuaToNumber(l, j + 1)];
 
Index: stratagus/src/unit/unit.c
diff -u stratagus/src/unit/unit.c:1.351 stratagus/src/unit/unit.c:1.352
--- stratagus/src/unit/unit.c:1.351     Thu Jan  1 10:28:26 2004
+++ stratagus/src/unit/unit.c   Fri Jan  2 11:36:33 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: unit.c,v 1.351 2003/12/31 23:28:26 jsalmon3 Exp $
+//      $Id: unit.c,v 1.352 2004/01/02 00:36:33 jsalmon3 Exp $
 
 //@{
 
@@ -255,13 +255,6 @@
        RefsDebugCheck(unit->Refs);
 
        //
-       //              Free used memory
-       //
-       if (unit->Name) {
-               free(unit->Name);
-       }
-
-       //
        //              No more references remaining, but the network could 
have an order
        //              on the way. We must wait a little time before we could 
free the
        //              memory.
@@ -352,25 +345,6 @@
        unit->Type = type;
        unit->SeenFrame = UnitNotSeen;                          // Unit isn't 
yet seen
 
-       // FIXME: this is not needed for load+save, must move to other place
-       if (1) {                                                                
// Call CCL for name generation
-#if defined(USE_GUILE) || defined(USE_SIOD)
-               SCM fun;
-
-               fun = gh_symbol2scm("gen-unit-name");
-               if (symbol_boundp(fun, NIL)) {
-                       SCM value;
-
-                       value = symbol_value(fun, NIL);
-                       if (!gh_null_p(value)) {
-                               value = gh_apply(value, 
cons(gh_symbol2scm(type->Ident), NIL));
-                               unit->Name = gh_scm2newstr(value, NULL);
-                       }
-               }
-#elif defined(USE_LUA)
-#endif
-       }
-
        unit->Frame = unit->Type->Animations->Still[0].Frame +
                (type->Building ? 0 : type->NumDirections / 2 + 1 - 1);
        if (!type->Building && type->Sprite &&
@@ -3483,10 +3457,6 @@
 
        CLprintf(file, "'player %d\n  ", unit->Player->Player);
 
-       if (unit->Name) {
-               CLprintf(file, "'name \"%s\" ", unit->Name);
-       }
-
        if (unit->Next) {
                CLprintf(file, "'next '%d ", UnitNumber(unit->Next));
        }
@@ -3729,7 +3699,7 @@
        int RunStart;
 
        CLprintf(file, "\n;;; -----------------------------------------\n");
-       CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.351 2003/12/31 
23:28:26 jsalmon3 Exp $\n\n");
+       CLprintf(file, ";;; MODULE: units $Id: unit.c,v 1.352 2004/01/02 
00:36:33 jsalmon3 Exp $\n\n");
 
        //
        //              Local variables
@@ -3807,9 +3777,6 @@
        //              Free memory for all units in unit table.
        //
        for (table = Units; table < &Units[NumUnits]; ++table) {
-               if ((*table)->Name) {
-                       free((*table)->Name);
-               }
                free(*table);
                *table = NULL;
        }




reply via email to

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