r503 - in packages/cube/trunk/debian: . patches
Gonéri Le Bouder
goneri-guest at costa.debian.org
Sat Apr 15 01:48:01 UTC 2006
Author: goneri-guest
Date: 2006-04-15 01:48:00 +0000 (Sat, 15 Apr 2006)
New Revision: 503
Added:
packages/cube/trunk/debian/README.Debian
packages/cube/trunk/debian/patches/04_load_personal_setting.patch
Modified:
packages/cube/trunk/debian/patches/00list
Log:
personal setting can be write in HOME/.cube/config.cfg
Added: packages/cube/trunk/debian/README.Debian
===================================================================
--- packages/cube/trunk/debian/README.Debian 2006-04-15 01:34:17 UTC (rev 502)
+++ packages/cube/trunk/debian/README.Debian 2006-04-15 01:48:00 UTC (rev 503)
@@ -0,0 +1,2 @@
+Personal setting:
+If you want to create your own setting file, you can store it in $HOME/.cube/config.cfg
Modified: packages/cube/trunk/debian/patches/00list
===================================================================
--- packages/cube/trunk/debian/patches/00list 2006-04-15 01:34:17 UTC (rev 502)
+++ packages/cube/trunk/debian/patches/00list 2006-04-15 01:48:00 UTC (rev 503)
@@ -1,2 +1,3 @@
01_permissive_gcc.patch
02_data_in_usr_share.patch
+04_load_personal_setting.patch
Added: packages/cube/trunk/debian/patches/04_load_personal_setting.patch
===================================================================
--- packages/cube/trunk/debian/patches/04_load_personal_setting.patch 2006-04-15 01:34:17 UTC (rev 502)
+++ packages/cube/trunk/debian/patches/04_load_personal_setting.patch 2006-04-15 01:48:00 UTC (rev 503)
@@ -0,0 +1,37 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Gonéri Le Bouder <goneri at rulezlan.org>
+## DP: cube try to load $HOME/.cube/config.cfg
+
+diff -ru cube-2005.08.29.orig/src/main.cpp cube-2005.08.29/src/main.cpp
+--- cube-2005.08.29.orig/src/main.cpp 2006-04-15 03:31:35.000000000 +0200
++++ cube-2005.08.29/src/main.cpp 2006-04-15 03:40:44.000000000 +0200
+@@ -161,6 +161,14 @@
+ log("sound");
+ initsound();
+
++
++// i try to load cfg from user home directory
++ char *homedir = getenv("HOME");
++ char *personnalcfgpath;
++ personnalcfgpath = (char*)malloc(sizeof(char)*strlen(homedir)+30);
++ strcpy(personnalcfgpath,homedir);
++ strcat(personnalcfgpath,"/.cube/config.cfg");
++
+ log("cfg");
+ newmenu("frags\tpj\tping\tteam\tname");
+ newmenu("ping\tplr\tserver");
+@@ -169,9 +177,12 @@
+ exec("data/prefabs.cfg");
+ exec("data/sounds.cfg");
+ exec("servers.cfg");
+- if(!execfile("config.cfg")) execfile("data/defaults.cfg");
++ if(!execfile(personnalcfgpath))
++ if(!execfile("config.cfg")) execfile("data/defaults.cfg");
+ exec("autoexec.cfg");
+
++
++
+ log("localconnect");
+ localconnect();
+ changemap("metl3"); // if this map is changed, also change depthcorrect()
More information about the Pkg-games-devel
mailing list