stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus data/ccl/stratagus.ccl src/clone/ccl.c


From: Martin Renold
Subject: [Stratagus-CVS] stratagus data/ccl/stratagus.ccl src/clone/ccl.c
Date: Sun, 16 Nov 2003 13:41:38 -0500

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Martin Renold <address@hidden>  03/11/16 13:41:38

Modified files:
        data/ccl       : stratagus.ccl 
        src/clone      : ccl.c 

Log message:
        better error messages on wrong datapath

Patches:
Index: stratagus/data/ccl/stratagus.ccl
diff -u stratagus/data/ccl/stratagus.ccl:1.28 
stratagus/data/ccl/stratagus.ccl:1.29
--- stratagus/data/ccl/stratagus.ccl:1.28       Sun Nov 16 03:58:54 2003
+++ stratagus/data/ccl/stratagus.ccl    Sun Nov 16 13:41:38 2003
@@ -26,7 +26,7 @@
 ;;      along with this program; if not, write to the Free Software
 ;;      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  
USA
 ;;
-;;     $Id: stratagus.ccl,v 1.28 2003/11/16 08:58:54 martinxyz Exp $
+;;     $Id: stratagus.ccl,v 1.29 2003/11/16 18:41:38 martinxyz Exp $
 
 ;; For documentation see stratagus/doc/ccl/ccl.html
 
@@ -102,6 +102,12 @@
   (aux (opendir s) '() (if (string? (car prepend))
                            (car prepend) 
                            "")))
+
+;; hack to detect WC2 directory without data extracted
+(if (< (length (dir->list (library-path) nil)) 6)
+  (begin
+    (writes nil "You are trying to run the WC2 but your data seems 
incomplete.\n")
+    (writes nil "Use tools/wartool or specify another game with '-d 
/path/to/gamedir'!\n")))
 
 ;; Uncomment to play automatic all music
 ;; FIXME: Comments are wrong, system dependend stuff didn't belong into the
Index: stratagus/src/clone/ccl.c
diff -u stratagus/src/clone/ccl.c:1.132 stratagus/src/clone/ccl.c:1.133
--- stratagus/src/clone/ccl.c:1.132     Fri Nov 14 23:38:51 2003
+++ stratagus/src/clone/ccl.c   Sun Nov 16 13:41:38 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl.c,v 1.132 2003/11/15 04:38:51 mr-russ Exp $
+//     $Id: ccl.c,v 1.133 2003/11/16 18:41:38 martinxyz Exp $
 
 //@{
 
@@ -1986,7 +1986,7 @@
     }
 
     fprintf(fd, ";;; -----------------------------------------\n");
-    fprintf(fd, ";;; $Id: ccl.c,v 1.132 2003/11/15 04:38:51 mr-russ Exp $\n");
+    fprintf(fd, ";;; $Id: ccl.c,v 1.133 2003/11/16 18:41:38 martinxyz Exp 
$\n");
 
     fprintf(fd, "(set-video-resolution! %d %d)\n", VideoWidth, VideoHeight);
     
@@ -2006,7 +2006,7 @@
     }
 
     fprintf(fd, "--[[\n");
-    fprintf(fd, "      $Id: ccl.c,v 1.132 2003/11/15 04:38:51 mr-russ Exp 
$\n");
+    fprintf(fd, "      $Id: ccl.c,v 1.133 2003/11/16 18:41:38 martinxyz Exp 
$\n");
     fprintf(fd, "]]\n");
 
     fprintf(fd, "SetVideoResolution(%d, %d)\n", VideoWidth, VideoHeight);
@@ -2033,7 +2033,7 @@
     }
 
     fprintf(fd, ";;; -----------------------------------------\n");
-    fprintf(fd, ";;; $Id: ccl.c,v 1.132 2003/11/15 04:38:51 mr-russ Exp $\n");
+    fprintf(fd, ";;; $Id: ccl.c,v 1.133 2003/11/16 18:41:38 martinxyz Exp 
$\n");
 
     // Global options
     if (OriginalFogOfWar) {
@@ -2114,7 +2114,7 @@
     }
 
     fprintf(fd, "--[[\n");
-    fprintf(fd, "      $Id: ccl.c,v 1.132 2003/11/15 04:38:51 mr-russ Exp 
$\n");
+    fprintf(fd, "      $Id: ccl.c,v 1.133 2003/11/16 18:41:38 martinxyz Exp 
$\n");
     fprintf(fd, "]]\n");
 
     fprintf(fd, "SetVideoFullscreen(%s)\n", VideoFullScreen ? "true" : 
"false");
@@ -2139,6 +2139,11 @@
     //
     CclInConfigFile = 1;
     file = LibraryFileName(CclStartFile, buf);
+    if (access(buf, R_OK)) {
+       printf("Maybe you need to specify another gamepath with '-d 
/path/to/datadir'?\n");
+       ExitFatal(-1);
+    }
+
     ShowLoadProgress("Script %s\n", file);
     LoadPreferences1();
 #if defined(USE_GUILE) || defined(USE_SIOD)
@@ -2169,7 +2174,7 @@
     extern SCM oblistvar;
 
     CLprintf(file, "\n;;; -----------------------------------------\n");
-    CLprintf(file, ";;; MODULE: CCL $Id: ccl.c,v 1.132 2003/11/15 04:38:51 
mr-russ Exp $\n\n");
+    CLprintf(file, ";;; MODULE: CCL $Id: ccl.c,v 1.133 2003/11/16 18:41:38 
martinxyz Exp $\n\n");
 
     for (list = oblistvar; gh_list_p(list); list = gh_cdr(list)) {
        SCM sym;




reply via email to

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