Skip to content

Commit 08776bc

Browse files
committed
Disable SDL_mixer and debug prints
1 parent e39ac9c commit 08776bc

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

desktop_version/src/SoundSystem.cpp

+34-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#include "SoundSystem.h"
33
#include "FileSystemUtils.h"
44

5+
#include <hal/debug.h>
6+
57
MusicTrack::MusicTrack(const char* fileName)
68
{
79
m_music = Mix_LoadMUS(fileName);
@@ -32,7 +34,9 @@ SoundTrack::SoundTrack(const char* fileName)
3234
size_t length = 0;
3335
FILESYSTEM_loadFileToMemory(fileName, &mem, &length);
3436
SDL_RWops *fileIn = SDL_RWFromMem(mem, length);
37+
debugPrint("Loading sound %p %p\n", fileIn, mem);
3538
sound = Mix_LoadWAV_RW(fileIn, 1);
39+
debugPrint("Loaded sound %p\n", sound);
3640
if (length)
3741
{
3842
FILESYSTEM_freeMemory(&mem);
@@ -44,18 +48,47 @@ SoundTrack::SoundTrack(const char* fileName)
4448
}
4549
}
4650

51+
#include <xboxkrnl/xboxkrnl.h>
52+
53+
54+
extern "C" {
55+
extern int nextCol;
56+
extern int nextRow;
57+
}
58+
4759
SoundSystem::SoundSystem()
4860
{
4961
int audio_rate = 44100;
5062
Uint16 audio_format = AUDIO_S16SYS;
5163
int audio_channels = 2;
5264
int audio_buffers = 1024;
53-
65+
#if 0
5466
if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) != 0)
5567
{
5668
fprintf(stderr, "Unable to initialize audio: %s\n", Mix_GetError());
5769
SDL_assert(0 && "Unable to initialize audio!");
5870
}
71+
debugPrint("Okay!\n");
72+
73+
nextCol = 25;
74+
nextRow = 300;
75+
76+
debugPrint(" Memory statistics:\n");
77+
MM_STATISTICS ms;
78+
ms.Length = sizeof(MM_STATISTICS);
79+
MmQueryStatistics(&ms);
80+
#define PRINT(stat) debugPrint(" - " #stat ": %d\n", ms.stat);
81+
PRINT(TotalPhysicalPages)
82+
PRINT(AvailablePages)
83+
PRINT(VirtualMemoryBytesCommitted)
84+
PRINT(VirtualMemoryBytesReserved)
85+
PRINT(CachePagesCommitted)
86+
PRINT(PoolPagesCommitted)
87+
PRINT(StackPagesCommitted)
88+
PRINT(ImagePagesCommitted)
89+
#undef PRINT
90+
91+
#endif
5992
}
6093

6194
void SoundSystem::playMusic(MusicTrack* music)

0 commit comments

Comments
 (0)