(svn r4944) Codechange: make _patches_newgame available via settings.h and remove instances of extern Patches _patches_newgame in .c files
authorrubidium
Mon, 22 May 2006 09:59:09 +0000
changeset 3888 7a781a439c30
parent 3887 3e44ae3b1e7c
child 3889 cc4a8556c19d
(svn r4944) Codechange: make _patches_newgame available via settings.h and remove instances of extern Patches _patches_newgame in .c files
intro_gui.c
settings.h
settings_gui.c
--- a/intro_gui.c	Sun May 21 16:18:58 2006 +0000
+++ b/intro_gui.c	Mon May 22 09:59:09 2006 +0000
@@ -10,6 +10,7 @@
 #include "player.h"
 #include "network.h"
 #include "variables.h"
+#include "settings.h"
 
 extern void SwitchMode(int new_mode);
 
@@ -54,7 +55,6 @@
 {
 	/* We do +/- 6 for the map_xy because 64 is 2^6, but it is the lowest available element */
 	static const StringID mapsizes[] = {STR_64, STR_128, STR_256, STR_512, STR_1024, STR_2048, INVALID_STRING_ID};
-	extern Patches _patches_newgame;
 
 	switch (e->event) {
 	case WE_PAINT:
--- a/settings.h	Sun May 21 16:18:58 2006 +0000
+++ b/settings.h	Mon May 22 09:59:09 2006 +0000
@@ -74,6 +74,9 @@
 	return (object == NULL) ? sld->address : (byte*)object + (ptrdiff_t)sld->address;
 }
 
+/** The patch values that are used for new games and/or modified in config file */
+extern Patches _patches_newgame;
+
 void IConsoleSetPatchSetting(const char *name, const char *value);
 void IConsoleGetPatchSetting(const char *name);
 const SettingDesc *GetPatchFromName(const char *name, uint *i);
--- a/settings_gui.c	Sun May 21 16:18:58 2006 +0000
+++ b/settings_gui.c	Mon May 22 09:59:09 2006 +0000
@@ -675,7 +675,6 @@
 
 	switch (e->event) {
 	case WE_CREATE: {
-		extern Patches _patches_newgame;
 		static bool first_time = true;
 
 		patches_ptr = (_game_mode == GM_MENU) ? &_patches_newgame : &_patches;