shithub: cstory

Download patch

ref: 2e5e1994c25a66c5c840c99656190bbd8f8c1f42
parent: 53c0e8470fa7cb0893d30bc1f19640e34ca7d0c2
author: Clownacy <[email protected]>
date: Mon Feb 3 11:44:52 EST 2020

Enable debug console prints in non-debug builds

--- a/src/Backends/Audio/SDL2.cpp
+++ b/src/Backends/Audio/SDL2.cpp
@@ -2,9 +2,7 @@
 
 #include <math.h>
 #include <stddef.h>
-#ifndef NDEBUG
 #include <stdio.h>
-#endif
 #include <stdlib.h>
 #include <string.h>
 
@@ -168,12 +166,10 @@
 		return FALSE;
 	}
 
-#ifndef NDEBUG
 	puts("Available SDL2 audio drivers:");
 
 	for (int i = 0; i < SDL_GetNumAudioDrivers(); ++i)
 		puts(SDL_GetAudioDriver(i));
-#endif
 
 	SDL_AudioSpec specification;
 	specification.freq = 44100;
@@ -195,9 +191,7 @@
 
 	SDL_PauseAudioDevice(device_id, 0);
 
-#ifndef NDEBUG
 	printf("Selected SDL2 audio driver: %s\n", SDL_GetCurrentAudioDriver());
-#endif
 
 	return TRUE;
 }
--- a/src/Backends/Rendering/OpenGL3.cpp
+++ b/src/Backends/Rendering/OpenGL3.cpp
@@ -565,11 +565,9 @@
 					if (GLAD_GL_VERSION_3_2)
 					{
 			#endif
-					#ifndef NDEBUG
 						printf("GL_VENDOR = %s\n", glGetString(GL_VENDOR));
 						printf("GL_RENDERER = %s\n", glGetString(GL_RENDERER));
 						printf("GL_VERSION = %s\n", glGetString(GL_VERSION));
-					#endif
 
 						// Set up blending (only used for font-rendering)
 						glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
--- a/src/Backends/Rendering/SDLTexture.cpp
+++ b/src/Backends/Rendering/SDLTexture.cpp
@@ -1,9 +1,7 @@
 #include "../Rendering.h"
 
 #include <stddef.h>
-#ifndef NDEBUG
 #include <stdio.h>
-#endif
 #include <stdlib.h>
 
 #include "SDL.h"
@@ -119,7 +117,6 @@
 
 Backend_Surface* Backend_Init(const char *title, int width, int height, BOOL fullscreen)
 {
-#ifndef NDEBUG
 	puts("Available SDL2 render drivers:");
 
 	for (int i = 0; i < SDL_GetNumRenderDrivers(); ++i)
@@ -128,7 +125,6 @@
 		SDL_GetRenderDriverInfo(i, &info);
 		puts(info.name);
 	}
-#endif
 
 	window = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, 0);
 
@@ -154,11 +150,9 @@
 
 		if (renderer != NULL)
 		{
-		#ifndef NDEBUG
 			SDL_RendererInfo info;
 			SDL_GetRendererInfo(renderer, &info);
 			printf("Selected SDL2 render driver: %s\n", info.name);
-		#endif
 
 			int width, height;
 			SDL_GetRendererOutputSize(renderer, &width, &height);
--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -87,7 +87,6 @@
 
 BOOL StartDirectDraw(const char *title, int width, int height, int lMagnification)
 {
-#ifndef NDEBUG
 	puts("Available SDL2 video drivers:");
 
 	for (int i = 0; i < SDL_GetNumVideoDrivers(); ++i)
@@ -94,7 +93,6 @@
 		puts(SDL_GetVideoDriver(i));
 
 	printf("Selected SDL2 video driver: %s\n", SDL_GetCurrentVideoDriver());
-#endif
 
 	memset(surface_metadata, 0, sizeof(surface_metadata));
 
--- a/src/Input.cpp
+++ b/src/Input.cpp
@@ -44,10 +44,8 @@
 {
 	int i;
 
-#ifndef NDEBUG
 	for (i = 0; i < SDL_NumJoysticks(); ++i)
 		printf("Joystick #%d name: %s\n", i, SDL_JoystickNameForIndex(i));
-#endif
 
 	// Open first available joystick
 	for (i = 0; i < SDL_NumJoysticks(); ++i)