mirror of
https://github.com/simtactics/niotso.git
synced 2025-07-04 05:37:02 -04:00
* License header formatting change
* New IFF chunk formats supported: CST, FBMP, CATS * Rebranded libfar to simply far * Started preliminary work on the hitutils package
This commit is contained in:
parent
55659f43b5
commit
bc51bb4aad
96 changed files with 2321 additions and 424 deletions
|
@ -1,5 +1,8 @@
|
|||
/*
|
||||
Niotso - Copyright (C) 2012 Fatbag <X-Fi6@phppoll.org>
|
||||
Niotso - The New Implementation of The Sims Online
|
||||
Audio/Startup.cpp
|
||||
Copyright (c) 2012 Niotso Project <http://niotso.org/>
|
||||
Author(s): Fatbag <X-Fi6@phppoll.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -24,7 +27,7 @@ IXAudio2MasteringVoice *MasterVoice = NULL;
|
|||
|
||||
int Initialize(){
|
||||
HRESULT result;
|
||||
|
||||
|
||||
result = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE | COINIT_SPEED_OVER_MEMORY);
|
||||
if(result != S_OK){
|
||||
MessageBox(Window::hWnd, "Failed to initialize Microsoft COM.", NULL, MB_OK | MB_ICONERROR);
|
||||
|
@ -39,7 +42,7 @@ int Initialize(){
|
|||
Shutdown();
|
||||
return ERROR_AUDIO_INIT_XAUDIO2;
|
||||
}
|
||||
|
||||
|
||||
result = pXAudio2->CreateMasteringVoice(&MasterVoice, 2, 44100, 0, 0, NULL);
|
||||
if(result != S_OK){
|
||||
MessageBox(Window::hWnd, "Failed to create the mastering voice for XAudio2.", NULL, MB_OK | MB_ICONERROR);
|
||||
|
@ -59,7 +62,7 @@ PlayableSound_t * LoadSound(const Sound_t * Sound){
|
|||
Sound->BitDepth, //wBitsPerSample
|
||||
0 //cbSize
|
||||
};
|
||||
|
||||
|
||||
const XAUDIO2_BUFFER buffer = {
|
||||
0, //Flags
|
||||
Sound->Duration * wfx.nBlockAlign, //AudioBytes
|
||||
|
@ -71,13 +74,13 @@ PlayableSound_t * LoadSound(const Sound_t * Sound){
|
|||
XAUDIO2_LOOP_INFINITE, //LoopCount
|
||||
NULL, //pContext
|
||||
};
|
||||
|
||||
|
||||
IXAudio2SourceVoice* pSourceVoice;
|
||||
if(FAILED(pXAudio2->CreateSourceVoice(&pSourceVoice, &wfx)))
|
||||
return NULL;
|
||||
if(FAILED(pSourceVoice->SubmitSourceBuffer(&buffer)))
|
||||
return NULL;
|
||||
|
||||
|
||||
PlayableSound_t * PlayableSound = (PlayableSound_t*) malloc(sizeof(PlayableSound_t));
|
||||
if(!PlayableSound)
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue