Replace all print calls with vlog calls

This is pretty straight-forward to do.
This commit is contained in:
Misa
2021-02-23 15:21:29 -08:00
committed by Misa Elizabeth Kai
parent d9737589de
commit 96539f891c
16 changed files with 213 additions and 203 deletions

View File

@@ -2,7 +2,6 @@
#include "Music.h"
#include <SDL.h>
#include <stdio.h>
#include <physfsrwops.h>
#include "BinaryBlob.h"
@@ -11,6 +10,7 @@
#include "Map.h"
#include "Script.h"
#include "UtilityClass.h"
#include "Vlogging.h"
musicclass::musicclass(void)
{
@@ -76,8 +76,9 @@ void musicclass::init(void)
if (!mmmmmm_blob.unPackBinary("mmmmmm.vvv"))
{
if (pppppp_blob.unPackBinary("vvvvvvmusic.vvv")) {
puts("Loading music from PPPPPP blob...");
if (pppppp_blob.unPackBinary("vvvvvvmusic.vvv"))
{
vlog_info("Loading music from PPPPPP blob...");
mmmmmm = false;
usingmmmmmm=false;
@@ -93,8 +94,10 @@ void musicclass::init(void)
TRACK_NAMES(pppppp_blob)
#undef FOREACH_TRACK
} else {
puts("Loading music from loose files...");
}
else
{
vlog_info("Loading music from loose files...");
SDL_RWops* rw;
#define FOREACH_TRACK(_, track_name) \
@@ -108,7 +111,7 @@ void musicclass::init(void)
}
else
{
puts("Loading PPPPPP and MMMMMM blobs...");
vlog_info("Loading PPPPPP and MMMMMM blobs...");
mmmmmm = true;
int index;
@@ -121,7 +124,7 @@ void musicclass::init(void)
rw = SDL_RWFromConstMem(blob.getAddress(index), blob.getSize(index)); \
if (rw == NULL) \
{ \
printf("Unable to read music file header: %s\n", SDL_GetError()); \
vlog_error("Unable to read music file header: %s", SDL_GetError()); \
} \
else \
{ \
@@ -223,7 +226,7 @@ void musicclass::play(int t)
if (!INBOUNDS_VEC(t, musicTracks))
{
puts("play() out-of-bounds!");
vlog_error("play() out-of-bounds!");
currentsong = -1;
return;
}
@@ -236,7 +239,7 @@ void musicclass::play(int t)
// Level Complete theme, no fade in or repeat
if (Mix_PlayMusic(musicTracks[t].m_music, 0) == -1)
{
printf("Mix_PlayMusic: %s\n", Mix_GetError());
vlog_error("Mix_PlayMusic: %s", Mix_GetError());
}
else
{
@@ -264,7 +267,7 @@ void musicclass::play(int t)
}
else if (Mix_PlayMusic(musicTracks[t].m_music, -1) == -1)
{
printf("Mix_PlayMusic: %s\n", Mix_GetError());
vlog_error("Mix_PlayMusic: %s", Mix_GetError());
}
else
{
@@ -535,7 +538,7 @@ void musicclass::playef(int t)
channel = Mix_PlayChannel(-1, soundTracks[t].sound, 0);
if(channel == -1)
{
fprintf(stderr, "Unable to play WAV file: %s\n", Mix_GetError());
vlog_error("Unable to play WAV file: %s", Mix_GetError());
}
}