* Fixed MP3 playback with libmpg123

* Finally removed the dependency on libstdc++ with TDM GCC, reducing the size of the exe from 153kB to 87kB
This commit is contained in:
Fatbag 2012-06-28 07:00:45 -05:00
parent f00c41f26c
commit 56f6487206
13 changed files with 63 additions and 53 deletions

View file

@ -5,11 +5,7 @@
ruby-specific header to provide mingw-friendly xaudio2 interfaces
*/
#include <windows.h>
#undef NULL
#define NULL 0
#include <guiddef.h>
#include <unknwn.h>
#include <mmreg.h>
DEFINE_GUID(CLSID_XAudio2, 0xe21a7345, 0xeb21, 0x468e, 0xbe, 0x50, 0x80, 0x4d, 0xb9, 0x7c, 0xf7, 0x08);

View file

@ -23,6 +23,13 @@
static void Shutdown();
Scene * CurrentScene;
#ifdef _WIN32
/* TDM GCC bonus feature; saves 66 kB in the binary :) */
/* */ void* operator new(unsigned size){return malloc(size);}
/* */ void operator delete(void *ptr){free(ptr);}
/* */ extern "C" void __cxa_pure_virtual(){}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int)
{
int result;
@ -121,4 +128,6 @@ static void Shutdown()
Graphics::Shutdown();
System::Shutdown();
Window::Shutdown();
}
}
#endif

View file

@ -19,18 +19,24 @@
*/
//Compiler/platform constants
#define WINVER 0x0502
#define _WIN32_WINNT 0x0502
#define _CRT_SECURE_NO_WARNINGS
#ifdef _WIN32
#define WINVER 0x0502
#define _WIN32_WINNT 0x0502
#define NTDDI_VERSION 0x05010300
#define _CRT_SECURE_NO_WARNINGS
#endif
//Standard libraries
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <windows.h>
#undef NULL
#define NULL 0
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef NULL
#define NULL 0
#endif
//Codebase libraries
#include "FileHandler.hpp"

View file

@ -23,8 +23,6 @@
namespace System {
HINSTANCE hInst = NULL;
HANDLE Process;
HANDLE ProcessHeap;
LARGE_INTEGER ClockFreq;
volatile float FramePeriod;
UserInput_t UserInput = UserInput_t();

View file

@ -23,8 +23,6 @@ namespace System {
void Shutdown();
extern HINSTANCE hInst;
extern HANDLE Process;
extern HANDLE ProcessHeap;
extern LARGE_INTEGER ClockFreq;
extern volatile float FramePeriod;