stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src/stratagus script.c


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src/stratagus script.c
Date: 22 Jan 2004 08:03:19 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/22 08:03:19

Modified files:
        src/stratagus  : script.c 

Log message:
        Moved LoadPreferences to lua

Patches:
Index: stratagus/src/stratagus/script.c
diff -u stratagus/src/stratagus/script.c:1.164 
stratagus/src/stratagus/script.c:1.165
--- stratagus/src/stratagus/script.c:1.164      Thu Jan 22 07:37:10 2004
+++ stratagus/src/stratagus/script.c    Thu Jan 22 08:03:18 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: script.c,v 1.164 2004/01/21 20:37:10 jsalmon3 Exp $
+//      $Id: script.c,v 1.165 2004/01/21 21:03:18 jsalmon3 Exp $
 
 //@{
 
@@ -229,8 +229,7 @@
        }
        LibraryFileName(LuaToString(l, 1), buf);
        if (LuaLoadFile(buf) == -1) {
-               lua_pushfstring(l, "Load failed: %s", LuaToString(l, 1));
-               lua_error(l);
+               printf("Load failed: %s", LuaToString(l, 1));
        }
        return 0;
 }
@@ -1297,50 +1296,6 @@
 }
 
 /**
-**  Load user preferences
-*/
-local void LoadPreferences1(void)
-{
-       FILE* fd;
-       char buf[PATH_MAX];
-
-#ifdef USE_WIN32
-       sprintf(buf, "%s/preferences1.lua", GameName);
-#else
-       sprintf(buf, "%s/%s/%s/preferences1.lua", getenv("HOME"),
-               STRATAGUS_HOME_PATH, GameName);
-#endif
-
-       fd = fopen(buf, "r");
-       if (fd) {
-               fclose(fd);
-               LuaLoadFile(buf);
-       }
-}
-
-/**
-**  Load user preferences
-*/
-local void LoadPreferences2(void)
-{
-       FILE* fd;
-       char buf[PATH_MAX];
-
-#ifdef USE_WIN32
-       sprintf(buf, "%s/preferences2.lua", GameName);
-#else
-       sprintf(buf, "%s/%s/%s/preferences2.lua", getenv("HOME"),
-               STRATAGUS_HOME_PATH, GameName);
-#endif
-
-       fd = fopen(buf, "r");
-       if (fd) {
-               fclose(fd);
-               LuaLoadFile(buf);
-       }
-}
-
-/**
 **  Save user preferences
 */
 global void SavePreferences(void)
@@ -1373,7 +1328,7 @@
        }
 
        fprintf(fd, "--- -----------------------------------------\n");
-       fprintf(fd, "--- $Id: script.c,v 1.164 2004/01/21 20:37:10 jsalmon3 Exp 
$\n");
+       fprintf(fd, "--- $Id: script.c,v 1.165 2004/01/21 21:03:18 jsalmon3 Exp 
$\n");
 
        fprintf(fd, "SetVideoResolution(%d, %d)\n", VideoWidth, VideoHeight);
 
@@ -1397,7 +1352,7 @@
        }
 
        fprintf(fd, "--- -----------------------------------------\n");
-       fprintf(fd, "--- $Id: script.c,v 1.164 2004/01/21 20:37:10 jsalmon3 Exp 
$\n");
+       fprintf(fd, "--- $Id: script.c,v 1.165 2004/01/21 21:03:18 jsalmon3 Exp 
$\n");
 
        // Global options
        if (OriginalFogOfWar) {
@@ -1491,9 +1446,7 @@
        }
 
        ShowLoadProgress("Script %s\n", file);
-       LoadPreferences1();
        LuaLoadFile(file);
-       LoadPreferences2();
        CclInConfigFile = 0;
        CclGarbageCollect(0);  // Cleanup memory after load
 }




reply via email to

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