Package: freedroidrpg / 0.16.1-4

27_debug.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
Author: Bart Mertens
Description: Reduces output on stdout/stderr
Forwarded: no

--- a/src/graphics.c
+++ b/src/graphics.c
@@ -602,16 +602,16 @@
 	// Since we want to use openGl, it might be good to check the OpenGL vendor string
 	// provided by the graphics driver.  Let's see...
 	//
-	fprintf(stderr, "\n-OpenGL--------------------------------------------------------------------------");
-	fprintf(stderr, "\nVendor     : %s", glGetString(GL_VENDOR));
+        DebugPrintf(1, stderr, "\n-OpenGL--------------------------------------------------------------------------");
+	DebugPrintf(1, stderr, "\nVendor     : %s", glGetString(GL_VENDOR));
 	open_gl_check_error_status(__FUNCTION__);
-	fprintf(stderr, "\nRenderer   : %s", glGetString(GL_RENDERER));
+	DebugPrintf(1, stderr, "\nRenderer   : %s", glGetString(GL_RENDERER));
 	open_gl_check_error_status(__FUNCTION__);
-	fprintf(stderr, "\nVersion    : %s", glGetString(GL_VERSION));
+	DebugPrintf(1, stderr, "\nVersion    : %s", glGetString(GL_VERSION));
 	open_gl_check_error_status(__FUNCTION__);
-	fprintf(stderr, "\nExtensions : %s", glGetString(GL_EXTENSIONS));
+	DebugPrintf(1, stderr, "\nExtensions : %s", glGetString(GL_EXTENSIONS));
 	open_gl_check_error_status(__FUNCTION__);
-	fprintf(stderr, "\n\n");
+	DebugPrintf(1, stderr, "\n\n");
 }
 #endif
 
@@ -703,11 +703,11 @@
 		GameConfig.next_time_height_of_screen = GameConfig.screen_height;
 		break;
 	default:
-		DebugPrintf(-4, "\nTesting if color depth %d bits is available... ", vid_bpp);
+		DebugPrintf(1, "\nTesting if color depth %d bits is available... ", vid_bpp);
 		if (video_mode_ok_check_result == vid_bpp) {
-			DebugPrintf(-4, "YES.");
+			DebugPrintf(1, "YES.");
 		} else {
-			DebugPrintf(-4, "NO! \nThe closest we will get is %d bits per pixel.", video_mode_ok_check_result);
+			DebugPrintf(1, "NO! \nThe closest we will get is %d bits per pixel.", video_mode_ok_check_result);
 			/*
 			   ErrorMessage ( __FUNCTION__  , "\
 			   SDL reported, that the video mode mentioned \nabove is not supported UNDER THE COLOR DEPTH MENTIONED ABOVE!\n\
@@ -734,8 +734,8 @@
 		SDL_GL_GetAttribute(SDL_GL_BLUE_SIZE, &blue_size);
 		SDL_GL_GetAttribute(SDL_GL_ALPHA_SIZE, &alpha_size);
 		SDL_GL_GetAttribute(SDL_GL_DEPTH_SIZE, &depth_size);
-		fprintf(stderr, "\n\nvideo mode set (bpp=%d RGBA=%d%d%d%d depth=%d)",
-			buffer_size, red_size, green_size, blue_size, alpha_size, depth_size);
+		DebugPrintf(1, stderr, "\n\nvideo mode set (bpp=%d RGBA=%d%d%d%d depth=%d)",
+			    buffer_size, red_size, green_size, blue_size, alpha_size, depth_size);
 	}
 
 	show_open_gl_driver_info();
@@ -779,7 +779,7 @@
 	// NOTE:  This has got NOTHING to do with OpenGL and OpenGL venour or the like yet...
 	//
 	if (SDL_VideoDriverName(vid_driver, 80)) {
-		DebugPrintf(-4, "\nVideo system type: %s.", vid_driver);
+		DebugPrintf(1, "\nVideo system type: %s.", vid_driver);
 	} else {
 		fprintf(stderr, "Video driver seems not to exist or initialization failure!\nError code: %s\n", SDL_GetError());
 		Terminate(EXIT_FAILURE);
@@ -793,7 +793,7 @@
 
 	// We note the screen resolution used.
 	//
-	DebugPrintf(-4, "\nUsing screen resolution %d x %d.\n", GameConfig.screen_width, GameConfig.screen_height);
+	DebugPrintf(1, "\nUsing screen resolution %d x %d.\n", GameConfig.screen_width, GameConfig.screen_height);
 
 	// We query the available video configuration on this system.
 	//
--- a/src/init.c
+++ b/src/init.c
@@ -544,8 +544,8 @@
 "                    [-l character-name | --load=character-name]\n"
 "                    [-r Y | --resolution=Y]  Y = 99 lists hardcoded resolutions.\n"
 "                                             Y may also be of the form 'WxH' e.g. '800x600'\n"
-"                    [-d X | --debug=X]       X = 0-5; default 1\n"
-"\n"
+  "                    [-d X | --debug=X]       X = 0-5; default 1\n";
+const char report_bugs_string[] = "\n"
 "Please report bugs either by entering them into the bug tracker on our website at:\n\n"
 "http://bugs.freedroid.org\n\n"
 "or by sending an e-mail to:\n\n"
@@ -610,6 +610,7 @@
 		case 'h':
 		case '?':
 			printf("%s",usage_string);
+			DebugPrintf(1, report_bugs_string);
 			exit(0);
 			break;
 
@@ -1024,7 +1025,7 @@
 	// We mention the version of FreedroidRPG, so that debug reports
 	// are easier to assign to the different versions of the game.
 
-	DebugPrintf(-4, "\nHello, this is FreedroidRPG, version %s.\n", freedroid_version);
+	DebugPrintf(1, "\nHello, this is FreedroidRPG, version %s.\n", freedroid_version);
 }
 
 /* -----------------------------------------------------------------
--- a/src/main.c
+++ b/src/main.c
@@ -418,7 +418,7 @@
 			//
 			if (Me.time_since_last_visit_or_respawn[i] > 600 && !(curShip.AllLevels[i]->flags & NO_RESPAWN)) {
 
-				DebugPrintf(-10, "\nNow respawning all bots on level : %d. ", i);
+				DebugPrintf(1, "\nNow respawning all bots on level : %d. ", i);
 				Me.time_since_last_visit_or_respawn[i] = 0;
 
 				respawn_level(i);
--- a/src/misc.c
+++ b/src/misc.c
@@ -1402,8 +1402,8 @@
 void Terminate(int exit_code)
 {
 	if (!do_benchmark) {
-		printf("\n---------------------------------------------------------------------------------");
-		printf("\nTermination of freedroidRPG initiated... ");
+	        DebugPrintf(1, "\n---------------------------------------------------------------------------------");
+	        DebugPrintf(1, "\nTermination of freedroidRPG initiated... ");
 	}
 
 	// Save the config file only in case of success.
@@ -1423,7 +1423,7 @@
 	free_memory_before_exit();
 
 	if (!do_benchmark) {
-		printf("Thank you for playing freedroidRPG.\n\n");
+	        DebugPrintf(1, "Thank you for playing freedroidRPG.\n\n");
 	}
 
 IMMEDIATE_EXIT: