Enable debug console prints in non-debug builds

This commit is contained in:
Clownacy 2020-02-03 16:44:52 +00:00
parent 53c0e8470f
commit 2e5e1994c2
5 changed files with 0 additions and 18 deletions

View file

@ -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 @@ BOOL AudioBackend_Init(void)
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 @@ BOOL AudioBackend_Init(void)
SDL_PauseAudioDevice(device_id, 0);
#ifndef NDEBUG
printf("Selected SDL2 audio driver: %s\n", SDL_GetCurrentAudioDriver());
#endif
return TRUE;
}

View file

@ -565,11 +565,9 @@ Backend_Surface* Backend_Init(const char *title, int width, int height, BOOL ful
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);

View file

@ -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 @@ static void GlyphBatch_DestroyTexture(SPRITEBATCH_U64 texture_id, void *udata)
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 @@ Backend_Surface* Backend_Init(const char *title, int width, int height, BOOL ful
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 @@ Backend_Surface* Backend_Init(const char *title, int width, int height, BOOL ful
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);

View file

@ -87,14 +87,12 @@ BOOL Flip_SystemTask(void)
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)
puts(SDL_GetVideoDriver(i));
printf("Selected SDL2 video driver: %s\n", SDL_GetCurrentVideoDriver());
#endif
memset(surface_metadata, 0, sizeof(surface_metadata));

View file

@ -44,10 +44,8 @@ BOOL FindAndOpenDirectInputDevice(void)
{
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)