[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stratagus-CVS] stratagus/src/stratagus iolib.c
From: |
address@hidden |
Subject: |
[Stratagus-CVS] stratagus/src/stratagus iolib.c |
Date: |
22 Jan 2004 08:00:00 +1100 |
CVSROOT: /home/strat
Module name: stratagus
Changes by: <address@hidden> 04/01/22 07:59:59
Modified files:
src/stratagus : iolib.c
Log message:
Check the game dir on windows
Patches:
Index: stratagus/src/stratagus/iolib.c
diff -u stratagus/src/stratagus/iolib.c:1.56
stratagus/src/stratagus/iolib.c:1.57
--- stratagus/src/stratagus/iolib.c:1.56 Sat Jan 10 17:13:00 2004
+++ stratagus/src/stratagus/iolib.c Thu Jan 22 07:59:59 2004
@@ -5,12 +5,12 @@
// /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
// \/ \/ \//_____/ \/
// ______________________ ______________________
-// T H E W A R B E G I N S
-// Stratagus - A free fantasy real time strategy game engine
+// T H E W A R B E G I N S
+// Stratagus - A free fantasy real time strategy game engine
//
-/address@hidden iolib.c - Compression-IO helper functions. */
+/address@hidden iolib.c - Compression-IO helper functions. */
//
-// (c) Copyright 2000-2003 by Andreas Arens, Lutz Sammer, and Jimmy Salmon
+// (c) Copyright 2000-2004 by Andreas Arens, Lutz Sammer, and Jimmy Salmon
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -26,12 +26,12 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
-// $Id: iolib.c,v 1.56 2004/01/10 06:13:00 jsalmon3 Exp $
+// $Id: iolib.c,v 1.57 2004/01/21 20:59:59 jsalmon3 Exp $
//@{
/*----------------------------------------------------------------------------
--- Includes
+-- Includes
----------------------------------------------------------------------------*/
#include <stdio.h>
@@ -50,17 +50,17 @@
#include "iolib.h"
/*----------------------------------------------------------------------------
--- Defines
+-- Defines
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
--- Variables
+-- Variables
----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
--- Functions
+-- Functions
----------------------------------------------------------------------------*/
#ifdef USE_ZLIB
@@ -484,9 +484,30 @@
#endif
}
+#ifdef USE_WIN32
+ //
+ // In user home directory
+ //
+ sprintf(buffer, "%s/%s", GameName, file);
+ if (!access(buffer,R_OK)) {
+ return buffer;
+ }
+#ifdef USE_ZLIB // gzip or bzip2 in user home directory
+ sprintf(buffer, "%s/%s.gz", GameName, file);
+ if (!access(buffer, R_OK)) {
+ return buffer;
+ }
+#endif
+#ifdef USE_BZ2LIB
+ sprintf(buffer, "%s/%s.bz2", GameName, file);
+ if (!access(buffer, R_OK)) {
+ return buffer;
+ }
+#endif
+#else
if ((s = getenv("HOME"))) {
//
- // In user home directory
+ // In user home directory
//
sprintf(buffer, "%s/%s/%s/%s", s, STRATAGUS_HOME_PATH,
GameName, file);
if (!access(buffer,R_OK)) {
@@ -505,6 +526,7 @@
}
#endif
}
+#endif
//
// In global shared directory
- [Stratagus-CVS] stratagus/src/stratagus iolib.c,
address@hidden <=