Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 105780 | Differences between
and this patch

Collapse All | Expand All

(-)uhexen2-20070523/launcher/config_file.c (-3 / +69 lines)
Lines 29-34 Link Here
29
#include "config_file.h"
29
#include "config_file.h"
30
30
31
// Default values for the options
31
// Default values for the options
32
char game_basedir[MAX_OSPATH];
33
int basedir_nonstd	= 0;
32
int destiny		= DEST_H2;
34
int destiny		= DEST_H2;
33
int opengl_support	= 1;
35
int opengl_support	= 1;
34
int fullscreen		= 1;
36
int fullscreen		= 1;
Lines 87-99 int write_config_file (void) Link Here
87
	{
89
	{
88
		fprintf(stderr, " Error: couldn't open config file for writing\n");
90
		fprintf(stderr, " Error: couldn't open config file for writing\n");
89
		return 1;
91
		return 1;
90
91
	}
92
	}
92
	else
93
	else
93
	{
94
	{
94
		fprintf(cfg_file, "# Hexen II Launcher Options file\n\n");
95
		fprintf(cfg_file, "# Hexen II Launcher Options file\n\n");
95
		fprintf(cfg_file, "# This file has been automatically generated\n\n");
96
		fprintf(cfg_file, "# This file has been automatically generated\n\n");
96
97
98
		fprintf(cfg_file, "game_basedir=\"%s\"\n",game_basedir);
99
		fprintf(cfg_file, "basedir_nonstd=%d\n",basedir_nonstd);
97
		fprintf(cfg_file, "destiny=%d\n",destiny);
100
		fprintf(cfg_file, "destiny=%d\n",destiny);
98
#ifndef DEMOBUILD
101
#ifndef DEMOBUILD
99
		fprintf(cfg_file, "h2game=%d\n",h2game);
102
		fprintf(cfg_file, "h2game=%d\n",h2game);
Lines 132-137 int write_config_file (void) Link Here
132
	return 0;
135
	return 0;
133
}
136
}
134
137
138
int cfg_read_basedir (void)
139
{
140
	FILE	*cfg_file;
141
	char	buff[1024], *tmp;
142
143
	game_basedir[0] = '\0';
144
	cfg_file = open_config_file("r");
145
	if (cfg_file == NULL)
146
	{
147
		printf("Creating default configuration file...\n");
148
		return write_config_file();
149
	}
150
	else
151
	{
152
		int	cnt = 0;
153
154
		do {
155
			memset(buff, 0, sizeof(buff));
156
			fgets(buff, sizeof(buff), cfg_file);
157
			if (!feof(cfg_file))
158
			{
159
				if (buff[0] == '#')
160
					continue;
161
				// remove end-of-line characters
162
				tmp = buff;
163
				while (*tmp)
164
				{
165
					if (*tmp == '\r' || *tmp == '\n')
166
						*tmp = '\0';
167
					tmp++;
168
				}
169
				// parse: whitespace isn't tolerated.
170
				if (strstr(buff, "game_basedir=") == buff)
171
				{
172
					size_t		len;
173
					tmp = buff+13;
174
					len = strlen(tmp);
175
					// first and last chars must be quotes
176
					if (tmp[0] != '\"' || tmp[len-1] != '\"' || len-2 >= sizeof(game_basedir))
177
						continue;
178
					memset (game_basedir, 0, sizeof(game_basedir));
179
					memcpy (game_basedir, tmp+1, len-2);
180
					++cnt;
181
				}
182
				else if (strstr(buff, "basedir_nonstd=") == buff)
183
				{
184
					basedir_nonstd = atoi(buff + 15);
185
					if (basedir_nonstd != 0 && basedir_nonstd != 1)
186
						basedir_nonstd = 0;
187
					++cnt;
188
				}
189
190
				if (cnt >= 2)
191
					break;
192
			}
193
194
		} while (!feof(cfg_file));
195
196
		fclose (cfg_file);
197
	}
198
199
	return 0;
200
}
201
135
int read_config_file (void)
202
int read_config_file (void)
136
{
203
{
137
	FILE	*cfg_file;
204
	FILE	*cfg_file;
Lines 141-148 int read_config_file (void) Link Here
141
	if (cfg_file == NULL)
208
	if (cfg_file == NULL)
142
	{
209
	{
143
		printf("Creating default configuration file...\n");
210
		printf("Creating default configuration file...\n");
144
		write_config_file();
211
		return write_config_file();
145
		return 0;
146
	}
212
	}
147
	else
213
	else
148
	{
214
	{
(-)uhexen2-20070523/launcher/config_file.h (+3 lines)
Lines 28-33 Link Here
28
28
29
#define LAUNCHER_CONFIG_FILE "launcher_options"
29
#define LAUNCHER_CONFIG_FILE "launcher_options"
30
30
31
extern char game_basedir[MAX_OSPATH];
32
extern int basedir_nonstd;
31
extern int destiny;
33
extern int destiny;
32
extern int opengl_support;
34
extern int opengl_support;
33
extern int fullscreen;
35
extern int fullscreen;
Lines 63-68 extern int hwgame; Link Here
63
65
64
int write_config_file (void);
66
int write_config_file (void);
65
int read_config_file (void);
67
int read_config_file (void);
68
int cfg_read_basedir (void);
66
69
67
#endif	// CONFIG_FILE_H
70
#endif	// CONFIG_FILE_H
68
71
(-)uhexen2-20070523/launcher/games.c (-14 / +18 lines)
Lines 27-32 Link Here
27
#include "games.h"
27
#include "games.h"
28
#include "crc.h"
28
#include "crc.h"
29
#include "pakfile.h"
29
#include "pakfile.h"
30
#include "config_file.h"
30
31
31
#if !defined(LITTLE_ENDIAN) || !defined(BIG_ENDIAN)
32
#if !defined(LITTLE_ENDIAN) || !defined(BIG_ENDIAN)
32
#undef	LITTLE_ENDIAN
33
#undef	LITTLE_ENDIAN
Lines 65-70 static int LongSwap (int l) Link Here
65
}
66
}
66
67
67
unsigned int	gameflags;
68
unsigned int	gameflags;
69
static char	*scan_dir;
68
70
69
typedef struct
71
typedef struct
70
{
72
{
Lines 189-195 finish: Link Here
189
}
191
}
190
192
191
#if !defined(DEMOBUILD)
193
#if !defined(DEMOBUILD)
192
h2game_t h2game_names[] =
194
h2game_t h2game_names[] =	/* first entry is always available */
193
{
195
{
194
	{  NULL    , "(  None  )"	,   NULL,		0, 1 },
196
	{  NULL    , "(  None  )"	,   NULL,		0, 1 },
195
	{ "hcbots" , "BotMatch: HC bots",   "progs.dat",	1, 0 },
197
	{ "hcbots" , "BotMatch: HC bots",   "progs.dat",	1, 0 },
Lines 200-206 h2game_t h2game_names[] = Link Here
200
202
201
const int MAX_H2GAMES = sizeof(h2game_names) / sizeof(h2game_names[0]);
203
const int MAX_H2GAMES = sizeof(h2game_names) / sizeof(h2game_names[0]);
202
204
203
hwgame_t hwgame_names[] =
205
hwgame_t hwgame_names[] =	/* first entry is always available */
204
{
206
{
205
	{  NULL     , "Plain DeathMatch", NULL,			 1  },
207
	{  NULL     , "Plain DeathMatch", NULL,			 1  },
206
	{ "hexarena", "HexArena"	, "sound/ha/fight.wav",  0  },
208
	{ "hexarena", "HexArena"	, "sound/ha/fight.wav",  0  },
Lines 212-223 hwgame_t hwgame_names[] = Link Here
212
214
213
const int	MAX_HWGAMES = sizeof(hwgame_names) / sizeof(hwgame_names[0]);
215
const int	MAX_HWGAMES = sizeof(hwgame_names) / sizeof(hwgame_names[0]);
214
216
215
static size_t	string_size = 0;
217
static size_t	string_size;
216
218
217
static void FindMaxStringSize (void)
219
static void FindMaxStringSize (void)
218
{
220
{
219
	size_t	i, len;
221
	size_t	i, len;
220
222
223
	string_size = 0;
224
221
	for (i = 1; i < MAX_H2GAMES; i++)
225
	for (i = 1; i < MAX_H2GAMES; i++)
222
	{
226
	{
223
		len = strlen(h2game_names[i].dirname) + strlen(hwgame_names[i].checkfile);
227
		len = strlen(h2game_names[i].dirname) + strlen(hwgame_names[i].checkfile);
Lines 235-241 static void FindMaxStringSize (void) Link Here
235
			string_size = len;
239
			string_size = len;
236
	}
240
	}
237
241
238
	string_size += 2;			// 1 for "/" + 1 for null termination
242
	string_size = string_size + strlen(scan_dir) + 3;	// 2 for two "/" + 1 for null termination
239
}
243
}
240
244
241
static void scan_h2_mods (void)
245
static void scan_h2_mods (void)
Lines 243-256 static void scan_h2_mods (void) Link Here
243
	int	i;
247
	int	i;
244
	char	*path;
248
	char	*path;
245
249
246
	if (!string_size)
247
		FindMaxStringSize ();
248
249
	printf ("Scanning for known hexen2 mods\n");
250
	printf ("Scanning for known hexen2 mods\n");
250
	path = (char *)malloc(string_size);
251
	path = (char *)malloc(string_size);
251
	for (i = 1; i < MAX_H2GAMES; i++)
252
	for (i = 1; i < MAX_H2GAMES; i++)
252
	{
253
	{
253
		sprintf (path, "%s/%s", h2game_names[i].dirname, h2game_names[i].checkfile);
254
		sprintf (path, "%s/%s/%s", scan_dir, h2game_names[i].dirname, h2game_names[i].checkfile);
254
		if (access(path, R_OK) == 0)
255
		if (access(path, R_OK) == 0)
255
			h2game_names[i].available = 1;
256
			h2game_names[i].available = 1;
256
	}
257
	}
Lines 262-279 static void scan_hw_mods (void) Link Here
262
	int	i, j;
263
	int	i, j;
263
	char	*path;
264
	char	*path;
264
265
265
	if (!string_size)
266
		FindMaxStringSize ();
267
268
	printf ("Scanning for known hexenworld mods\n");
266
	printf ("Scanning for known hexenworld mods\n");
269
	path = (char *)malloc(string_size);
267
	path = (char *)malloc(string_size);
270
	for (i = 1; i < MAX_HWGAMES; i++)
268
	for (i = 1; i < MAX_HWGAMES; i++)
271
	{
269
	{
272
		sprintf (path, "%s/hwprogs.dat", hwgame_names[i].dirname);
270
		sprintf (path, "%s/%s/hwprogs.dat", scan_dir, hwgame_names[i].dirname);
273
		j = access(path, R_OK);
271
		j = access(path, R_OK);
274
		if (j == 0)
272
		if (j == 0)
275
		{
273
		{
276
			sprintf (path, "%s/%s", hwgame_names[i].dirname, hwgame_names[i].checkfile);
274
			sprintf (path, "%s/%s/%s", scan_dir, hwgame_names[i].dirname, hwgame_names[i].checkfile);
277
			j = access(path, R_OK);
275
			j = access(path, R_OK);
278
		}
276
		}
279
		if (j == 0)
277
		if (j == 0)
Lines 315-324 void scan_game_installation (void) Link Here
315
	if (endien == 0)
313
	if (endien == 0)
316
		printf ("Warning: Unknown byte order!\n");
314
		printf ("Warning: Unknown byte order!\n");
317
315
316
	if (basedir_nonstd && game_basedir[0])
317
		scan_dir = game_basedir;
318
	else
319
		scan_dir = basedir;
320
318
	printf ("Scanning base hexen2 installation\n");
321
	printf ("Scanning base hexen2 installation\n");
319
	for (i = 0; i < MAX_PAKDATA-1; i++)
322
	for (i = 0; i < MAX_PAKDATA-1; i++)
320
	{
323
	{
321
		snprintf (pakfile, sizeof(pakfile), "%s/pak%d.pak", pakdata[i].dirname, i);
324
		snprintf (pakfile, sizeof(pakfile), "%s/%s/pak%d.pak", scan_dir, pakdata[i].dirname, i);
322
		scan_pak_files (pakfile, i);
325
		scan_pak_files (pakfile, i);
323
	}
326
	}
324
327
Lines 357-362 void scan_game_installation (void) Link Here
357
	}
360
	}
358
361
359
#if !defined(DEMOBUILD)
362
#if !defined(DEMOBUILD)
363
	FindMaxStringSize ();
360
	scan_h2_mods ();
364
	scan_h2_mods ();
361
	scan_hw_mods ();
365
	scan_hw_mods ();
362
#endif	/* DEMOBUILD */
366
#endif	/* DEMOBUILD */
(-)uhexen2-20070523/launcher/interface.c (-13 / +110 lines)
Lines 58-63 int thread_alive; Link Here
58
// Private data:
58
// Private data:
59
59
60
static GtkTooltips	*tooltips;
60
static GtkTooltips	*tooltips;
61
static GtkWidget	*H2G_Entry;	// Hexen2 games listing
62
#ifndef DEMOBUILD
63
static GtkWidget	*HWG_Entry;	// Hexenworld games listing
64
#endif	/* DEMOBUILD */
61
65
62
static options_widget_t	Options;
66
static options_widget_t	Options;
63
static MainWindow_t	main_win;
67
static MainWindow_t	main_win;
Lines 218-223 static void report_status (GtkObject *Un Link Here
218
222
219
	Log_printf ("Installation Summary:\n\n");
223
	Log_printf ("Installation Summary:\n\n");
220
	Log_printf ("Base directory: %s\n", basedir);
224
	Log_printf ("Base directory: %s\n", basedir);
225
	Log_printf ("Data directory: %s\n", (basedir_nonstd && game_basedir[0]) ? game_basedir : basedir);
221
	Log_printf ("PAK file health: %s", (gameflags & GAME_INSTBAD) ? "BAD. Reason(s):\n" : "OK ");
226
	Log_printf ("PAK file health: %s", (gameflags & GAME_INSTBAD) ? "BAD. Reason(s):\n" : "OK ");
222
	if (gameflags & GAME_INSTBAD)
227
	if (gameflags & GAME_INSTBAD)
223
	{
228
	{
Lines 575-580 static void on_MORE (GtkButton *button, Link Here
575
		gtk_widget_hide (BOOK1);
580
		gtk_widget_hide (BOOK1);
576
}
581
}
577
582
583
static void basedir_Change (GtkButton *unused, gpointer user_data)
584
{
585
#if !defined(DEMOBUILD)
586
	int		i;
587
	GList *TmpList = NULL;
588
#endif	/* ! DEMOBUILD */
589
590
	if (lock)
591
		return;
592
593
	lock = 1;
594
	basedir_nonstd ^= 1;
595
	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(patch_win.bBASEDIR), basedir_nonstd);
596
	scan_game_installation();
597
	UpdateStats ();
598
	report_status (NULL, &patch_win);
599
600
// activate the extra game options, if necessary
601
	gtk_widget_set_sensitive (WGT_H2WORLD, (gameflags & GAME_HEXENWORLD) ? TRUE : FALSE);
602
// rebuild the game mod lists
603
#if !defined(DEMOBUILD)
604
	if (mp_support)
605
		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(WGT_PORTALS), FALSE);
606
	h2game = hwgame = mp_support = 0;
607
	for (i = 0; i < MAX_H2GAMES; i++)
608
	{
609
		if (h2game_names[i].available)
610
			TmpList = g_list_append (TmpList, h2game_names[i].name);
611
	}
612
	gtk_combo_set_popdown_strings (GTK_COMBO(WGT_H2GAME), TmpList);
613
	g_list_free (TmpList);
614
	TmpList = NULL;
615
	for (i = 0; i < MAX_HWGAMES; i++)
616
	{
617
		if (hwgame_names[i].available)
618
			TmpList = g_list_append (TmpList, hwgame_names[i].name);
619
	}
620
	gtk_combo_set_popdown_strings (GTK_COMBO(WGT_HWGAME), TmpList);
621
	g_list_free (TmpList);
622
	gtk_entry_set_text (GTK_ENTRY(H2G_Entry), h2game_names[0].name);
623
	gtk_entry_set_text (GTK_ENTRY(HWG_Entry), hwgame_names[0].name);
624
	if (gameflags & (GAME_REGISTERED|GAME_REGISTERED_OLD))
625
	{
626
		gtk_widget_set_sensitive (WGT_H2GAME, TRUE);
627
		gtk_widget_set_sensitive (WGT_HWGAME, TRUE);
628
		if (gameflags & GAME_PORTALS && destiny == DEST_H2)
629
			gtk_widget_set_sensitive (WGT_PORTALS, TRUE);
630
	}
631
	else
632
	{
633
		gtk_widget_set_sensitive (WGT_H2GAME, FALSE);
634
		gtk_widget_set_sensitive (WGT_HWGAME, FALSE);
635
		gtk_widget_set_sensitive (WGT_PORTALS, FALSE);
636
	}
637
#endif	/* ! DEMOBUILD */
638
639
	lock = 0;
640
}
641
642
static void basedir_ChangePath (GtkEditable *editable, gpointer user_data)
643
{
644
	size_t len;
645
	gchar *tmp = gtk_editable_get_chars (editable, 0, -1);
646
	len = strlen(tmp);
647
	if (len > sizeof(game_basedir)-1)
648
		len = sizeof(game_basedir)-1;
649
	if (len)
650
		memcpy (game_basedir, tmp, len);
651
	game_basedir[len] = 0;
652
	g_free (tmp);
653
654
	if (basedir_nonstd)	/* FIXME: any better way? */
655
		basedir_Change (NULL, NULL);
656
}
657
578
/*********************************************************************
658
/*********************************************************************
579
 WINDOW CREATING
659
 WINDOW CREATING
580
 *********************************************************************/
660
 *********************************************************************/
Lines 599-605 static void create_window2 (GtkWidget *u Link Here
599
	gtk_window_set_title (GTK_WINDOW(PATCH_WINDOW), "Hexen II PAK patch");
679
	gtk_window_set_title (GTK_WINDOW(PATCH_WINDOW), "Hexen II PAK patch");
600
	gtk_window_set_resizable (GTK_WINDOW(PATCH_WINDOW), FALSE);
680
	gtk_window_set_resizable (GTK_WINDOW(PATCH_WINDOW), FALSE);
601
	gtk_window_set_modal (GTK_WINDOW(PATCH_WINDOW), TRUE);
681
	gtk_window_set_modal (GTK_WINDOW(PATCH_WINDOW), TRUE);
602
	gtk_widget_set_size_request(PATCH_WINDOW, 360, 240);
682
	gtk_widget_set_size_request(PATCH_WINDOW, 360, 272);
603
683
604
	PATCH_TAB = gtk_fixed_new ();
684
	PATCH_TAB = gtk_fixed_new ();
605
	gtk_widget_ref (PATCH_TAB);
685
	gtk_widget_ref (PATCH_TAB);
Lines 613-623 static void create_window2 (GtkWidget *u Link Here
613
	gtk_fixed_put (GTK_FIXED(PATCH_TAB), Txt1, 14, 12);
693
	gtk_fixed_put (GTK_FIXED(PATCH_TAB), Txt1, 14, 12);
614
	gtk_label_set_justify (GTK_LABEL(Txt1), GTK_JUSTIFY_LEFT);
694
	gtk_label_set_justify (GTK_LABEL(Txt1), GTK_JUSTIFY_LEFT);
615
695
696
// custom basedir entry:
697
	patch_win.bBASEDIR = gtk_check_button_new_with_label (_("Data install path:"));
698
	gtk_widget_ref (patch_win.bBASEDIR);
699
	gtk_widget_show (patch_win.bBASEDIR);
700
	gtk_fixed_put (GTK_FIXED(PATCH_TAB), patch_win.bBASEDIR, 14, 186);
701
	gtk_widget_set_size_request (patch_win.bBASEDIR, 128, 24);
702
	gtk_widget_set_sensitive (patch_win.bBASEDIR, TRUE);
703
	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(patch_win.bBASEDIR), basedir_nonstd);
704
	GTK_WIDGET_UNSET_FLAGS (patch_win.bBASEDIR, GTK_CAN_FOCUS);
705
	gtk_tooltips_set_tip (tooltips, patch_win.bBASEDIR, _("Mark this in order to use a different game installation directory"), NULL);
706
707
	patch_win.dir_Entry = gtk_entry_new();
708
	gtk_widget_show (patch_win.dir_Entry);
709
	gtk_fixed_put (GTK_FIXED(PATCH_TAB), patch_win.dir_Entry, 148, 186);
710
	gtk_widget_set_size_request (patch_win.dir_Entry, 190, 24);
711
	gtk_entry_set_max_length (GTK_ENTRY(patch_win.dir_Entry), sizeof(game_basedir)-1);
712
	gtk_entry_set_text (GTK_ENTRY(patch_win.dir_Entry), game_basedir);
713
	gtk_widget_ref (patch_win.dir_Entry);
714
616
// Apply Patch button
715
// Apply Patch button
617
	patch_win.bAPPLY = gtk_button_new_with_label (_("Apply Pak Patch"));
716
	patch_win.bAPPLY = gtk_button_new_with_label (_("Apply Pak Patch"));
618
	gtk_widget_ref (patch_win.bAPPLY);
717
	gtk_widget_ref (patch_win.bAPPLY);
619
	gtk_widget_show (patch_win.bAPPLY);
718
	gtk_widget_show (patch_win.bAPPLY);
620
	gtk_fixed_put (GTK_FIXED(PATCH_TAB), patch_win.bAPPLY, 14, 186);
719
	gtk_fixed_put (GTK_FIXED(PATCH_TAB), patch_win.bAPPLY, 14, 218);
621
	gtk_widget_set_size_request (patch_win.bAPPLY, 112, 24);
720
	gtk_widget_set_size_request (patch_win.bAPPLY, 112, 24);
622
#if !defined(DEMOBUILD)
721
#if !defined(DEMOBUILD)
623
	gtk_tooltips_set_tip (tooltips, patch_win.bAPPLY, _("Apply the v1.11 pakfiles patch by Raven Software."), NULL);
722
	gtk_tooltips_set_tip (tooltips, patch_win.bAPPLY, _("Apply the v1.11 pakfiles patch by Raven Software."), NULL);
Lines 627-633 static void create_window2 (GtkWidget *u Link Here
627
	patch_win.bREPORT = gtk_button_new_with_label (_("Make Report"));
726
	patch_win.bREPORT = gtk_button_new_with_label (_("Make Report"));
628
	gtk_widget_ref (patch_win.bREPORT);
727
	gtk_widget_ref (patch_win.bREPORT);
629
	gtk_widget_show (patch_win.bREPORT);
728
	gtk_widget_show (patch_win.bREPORT);
630
	gtk_fixed_put (GTK_FIXED(PATCH_TAB), patch_win.bREPORT, 132, 186);
729
	gtk_fixed_put (GTK_FIXED(PATCH_TAB), patch_win.bREPORT, 132, 218);
631
	gtk_widget_set_size_request (patch_win.bREPORT, 112, 24);
730
	gtk_widget_set_size_request (patch_win.bREPORT, 112, 24);
632
731
633
// Holder window for the textview
732
// Holder window for the textview
Lines 669-682 static void create_window2 (GtkWidget *u Link Here
669
	patch_win.bCLOSE = gtk_button_new_with_label (_("Close"));
768
	patch_win.bCLOSE = gtk_button_new_with_label (_("Close"));
670
	gtk_widget_ref (patch_win.bCLOSE);
769
	gtk_widget_ref (patch_win.bCLOSE);
671
	gtk_widget_show (patch_win.bCLOSE);
770
	gtk_widget_show (patch_win.bCLOSE);
672
	gtk_fixed_put (GTK_FIXED(PATCH_TAB), patch_win.bCLOSE, 250, 186);
771
	gtk_fixed_put (GTK_FIXED(PATCH_TAB), patch_win.bCLOSE, 250, 218);
673
	gtk_widget_set_size_request (patch_win.bCLOSE, 88, 24);
772
	gtk_widget_set_size_request (patch_win.bCLOSE, 88, 24);
674
773
675
// Statusbar
774
// Statusbar
676
	PATCH_STATBAR = gtk_statusbar_new ();
775
	PATCH_STATBAR = gtk_statusbar_new ();
677
	gtk_widget_ref (PATCH_STATBAR);
776
	gtk_widget_ref (PATCH_STATBAR);
678
	gtk_widget_show (PATCH_STATBAR);
777
	gtk_widget_show (PATCH_STATBAR);
679
	gtk_fixed_put (GTK_FIXED(PATCH_TAB), PATCH_STATBAR, 0, 214);
778
	gtk_fixed_put (GTK_FIXED(PATCH_TAB), PATCH_STATBAR, 0, 246);
680
	gtk_widget_set_size_request (PATCH_STATBAR, 354, 24);
779
	gtk_widget_set_size_request (PATCH_STATBAR, 354, 24);
681
	gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR(PATCH_STATBAR), FALSE);
780
	gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR(PATCH_STATBAR), FALSE);
682
	gtk_container_set_border_width (GTK_CONTAINER(PATCH_STATBAR), 2);
781
	gtk_container_set_border_width (GTK_CONTAINER(PATCH_STATBAR), 2);
Lines 687-692 static void create_window2 (GtkWidget *u Link Here
687
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "Txt1", Txt1, GTK_DESTROYNOTIFY(gtk_widget_unref));
786
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "Txt1", Txt1, GTK_DESTROYNOTIFY(gtk_widget_unref));
688
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "bAPPLY", patch_win.bAPPLY, GTK_DESTROYNOTIFY(gtk_widget_unref));
787
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "bAPPLY", patch_win.bAPPLY, GTK_DESTROYNOTIFY(gtk_widget_unref));
689
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "bREPORT", patch_win.bREPORT, GTK_DESTROYNOTIFY(gtk_widget_unref));
788
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "bREPORT", patch_win.bREPORT, GTK_DESTROYNOTIFY(gtk_widget_unref));
789
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "bBASEDIR", patch_win.bBASEDIR, GTK_DESTROYNOTIFY(gtk_widget_unref));
790
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "dir_Entry", patch_win.dir_Entry, GTK_DESTROYNOTIFY(gtk_widget_unref));
690
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "TxtWindow", TxtWindow, GTK_DESTROYNOTIFY(gtk_widget_unref));
791
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "TxtWindow", TxtWindow, GTK_DESTROYNOTIFY(gtk_widget_unref));
691
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "LOGVIEW", patch_win.LOGVIEW, GTK_DESTROYNOTIFY(gtk_widget_unref));
792
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "LOGVIEW", patch_win.LOGVIEW, GTK_DESTROYNOTIFY(gtk_widget_unref));
692
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "bCLOSE", patch_win.bCLOSE, GTK_DESTROYNOTIFY(gtk_widget_unref));
793
	gtk_object_set_data_full (GTK_OBJECT(PATCH_WINDOW), "bCLOSE", patch_win.bCLOSE, GTK_DESTROYNOTIFY(gtk_widget_unref));
Lines 694-699 static void create_window2 (GtkWidget *u Link Here
694
795
695
	gtk_signal_connect (GTK_OBJECT(PATCH_WINDOW), "destroy", GTK_SIGNAL_FUNC(destroy_window2), NULL);
796
	gtk_signal_connect (GTK_OBJECT(PATCH_WINDOW), "destroy", GTK_SIGNAL_FUNC(destroy_window2), NULL);
696
	gtk_signal_connect (GTK_OBJECT(patch_win.bCLOSE), "clicked", GTK_SIGNAL_FUNC(destroy_window2), NULL);
797
	gtk_signal_connect (GTK_OBJECT(patch_win.bCLOSE), "clicked", GTK_SIGNAL_FUNC(destroy_window2), NULL);
798
	gtk_signal_connect (GTK_OBJECT(patch_win.bBASEDIR), "toggled", GTK_SIGNAL_FUNC(basedir_Change), NULL);
799
	gtk_signal_connect (GTK_OBJECT(patch_win.dir_Entry), "changed", GTK_SIGNAL_FUNC(basedir_ChangePath), NULL);
697
#if !defined(DEMOBUILD)
800
#if !defined(DEMOBUILD)
698
	gtk_signal_connect (GTK_OBJECT(patch_win.bAPPLY), "clicked", GTK_SIGNAL_FUNC(start_xpatch), &patch_win);
801
	gtk_signal_connect (GTK_OBJECT(patch_win.bAPPLY), "clicked", GTK_SIGNAL_FUNC(start_xpatch), &patch_win);
699
	gtk_signal_connect (GTK_OBJECT(patch_win.bREPORT), "clicked", GTK_SIGNAL_FUNC(report_status), &patch_win);
802
	gtk_signal_connect (GTK_OBJECT(patch_win.bREPORT), "clicked", GTK_SIGNAL_FUNC(report_status), &patch_win);
Lines 741-750 static void create_window1 (void) Link Here
741
	GtkWidget *TxtPatch;	// Data patch label
844
	GtkWidget *TxtPatch;	// Data patch label
742
	GtkWidget *bPATCH;	// PATCH button
845
	GtkWidget *bPATCH;	// PATCH button
743
	GtkWidget *SRATE_Entry;	// Sampling rate listing
846
	GtkWidget *SRATE_Entry;	// Sampling rate listing
744
	GtkWidget *H2G_Entry;	// Hexen2 games listing
745
#ifndef DEMOBUILD
746
	GtkWidget *HWG_Entry;	// Hexenworld games listing
747
#endif	/* DEMOBUILD */
748
847
749
// Separators
848
// Separators
750
	GtkWidget *hseparator0;
849
	GtkWidget *hseparator0;
Lines 1039-1047 static void create_window1 (void) Link Here
1039
	gtk_widget_set_size_request (WGT_H2GAME, 172, 32);
1138
	gtk_widget_set_size_request (WGT_H2GAME, 172, 32);
1040
#ifndef DEMOBUILD
1139
#ifndef DEMOBUILD
1041
	TmpList = NULL;
1140
	TmpList = NULL;
1042
	TmpList = g_list_append (TmpList, (gpointer) "(  None  )");
1043
	gtk_combo_set_use_arrows (GTK_COMBO(WGT_H2GAME), FALSE);
1141
	gtk_combo_set_use_arrows (GTK_COMBO(WGT_H2GAME), FALSE);
1044
	for (i = 1; i < MAX_H2GAMES; i++)
1142
	for (i = 0; i < MAX_H2GAMES; i++)
1045
	{
1143
	{
1046
		if (h2game_names[i].available)
1144
		if (h2game_names[i].available)
1047
			TmpList = g_list_append (TmpList, h2game_names[i].name);
1145
			TmpList = g_list_append (TmpList, h2game_names[i].name);
Lines 1075-1083 static void create_window1 (void) Link Here
1075
	gtk_widget_ref (WGT_HWGAME);
1173
	gtk_widget_ref (WGT_HWGAME);
1076
	gtk_widget_set_size_request (WGT_HWGAME, 172, 32);
1174
	gtk_widget_set_size_request (WGT_HWGAME, 172, 32);
1077
	TmpList = NULL;
1175
	TmpList = NULL;
1078
	TmpList = g_list_append (TmpList, (gpointer) "Plain DeathMatch");
1079
	gtk_combo_set_use_arrows (GTK_COMBO(WGT_HWGAME), FALSE);
1176
	gtk_combo_set_use_arrows (GTK_COMBO(WGT_HWGAME), FALSE);
1080
	for (i = 1; i < MAX_HWGAMES; i++)
1177
	for (i = 0; i < MAX_HWGAMES; i++)
1081
	{
1178
	{
1082
		if (hwgame_names[i].available)
1179
		if (hwgame_names[i].available)
1083
			TmpList = g_list_append (TmpList, hwgame_names[i].name);
1180
			TmpList = g_list_append (TmpList, hwgame_names[i].name);
(-)uhexen2-20070523/launcher/launch_bin.c (+6 lines)
Lines 86-91 void launch_hexen2_bin (void) Link Here
86
	i = 0;
86
	i = 0;
87
	args[i] = binary_name;
87
	args[i] = binary_name;
88
88
89
	if (basedir_nonstd && game_basedir[0])
90
	{
91
		args[++i] = "-basedir";
92
		args[++i] = game_basedir;
93
	}
94
89
#if !defined(DEMOBUILD)
95
#if !defined(DEMOBUILD)
90
	if (destiny == DEST_H2 && mp_support)
96
	if (destiny == DEST_H2 && mp_support)
91
		args[++i] = "-portals";
97
		args[++i] = "-portals";
(-)uhexen2-20070523/launcher/launcher_defs.h (-1 / +1 lines)
Lines 40-46 Link Here
40
// Launcher version num.
40
// Launcher version num.
41
#define LAUNCHER_VERSION_MAJ	1
41
#define LAUNCHER_VERSION_MAJ	1
42
#define LAUNCHER_VERSION_MID	0
42
#define LAUNCHER_VERSION_MID	0
43
#define LAUNCHER_VERSION_MIN	0
43
#define LAUNCHER_VERSION_MIN	1
44
#define LAUNCHER_VERSION_STR	STRINGIFY(LAUNCHER_VERSION_MAJ) "." STRINGIFY(LAUNCHER_VERSION_MID) "." STRINGIFY(LAUNCHER_VERSION_MIN)
44
#define LAUNCHER_VERSION_STR	STRINGIFY(LAUNCHER_VERSION_MAJ) "." STRINGIFY(LAUNCHER_VERSION_MID) "." STRINGIFY(LAUNCHER_VERSION_MIN)
45
45
46
#ifndef DEMOBUILD
46
#ifndef DEMOBUILD
(-)uhexen2-20070523/launcher/main.c (+1 lines)
Lines 206-211 int main (int argc, char *argv[]) Link Here
206
//	go into the binary's directory
206
//	go into the binary's directory
207
	chdir (basedir);
207
	chdir (basedir);
208
208
209
	cfg_read_basedir();
209
	scan_game_installation();
210
	scan_game_installation();
210
	read_config_file();
211
	read_config_file();
211
212
(-)uhexen2-20070523/launcher/widget_defs.h (+2 lines)
Lines 49-58 typedef struct Link Here
49
{
49
{
50
	GtkWidget *mywindow;	// Main window
50
	GtkWidget *mywindow;	// Main window
51
	GtkWidget *fixed1;	// Widgets container
51
	GtkWidget *fixed1;	// Widgets container
52
	GtkWidget *bBASEDIR;	// Use a different game basedir
52
	GtkWidget *bCLOSE;	// Close button
53
	GtkWidget *bCLOSE;	// Close button
53
	GtkWidget *bAPPLY;	// Apply patch button
54
	GtkWidget *bAPPLY;	// Apply patch button
54
	GtkWidget *bREPORT;	// Report installation status
55
	GtkWidget *bREPORT;	// Report installation status
55
	GtkWidget *LOGVIEW;	// LogEntry line for patch process
56
	GtkWidget *LOGVIEW;	// LogEntry line for patch process
57
	GtkWidget *dir_Entry;	// path for game basedir
56
	GtkWidget *StatusBar;	// Status bar, (patch status)
58
	GtkWidget *StatusBar;	// Status bar, (patch status)
57
	gint	statbar_id;	// statbar context id
59
	gint	statbar_id;	// statbar context id
58
	guint	delete_handler;
60
	guint	delete_handler;

Return to bug 105780