16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 06:29:18 +02:00

removed dependencies on the old parser. The code can now be compiled outside of Borland C++

This commit is contained in:
tmj-fstate
2017-01-15 15:04:17 +01:00
parent 7df7c8b76e
commit 15cf3d73a8
87 changed files with 3395 additions and 3232 deletions

View File

@@ -7,15 +7,13 @@ obtain one at
http://mozilla.org/MPL/2.0/.
*/
#include "system.hpp"
#include "classes.hpp"
#pragma hdrstop
#include "stdafx.h"
#define STRICT
#include "Sound.h"
#include "Usefull.h"
#include "Globals.h"
#include <mctools.h>
#include "Logs.h"
#include "Usefull.h"
#include "mczapkie/mctools.h"
//#define SAFE_DELETE(p) { if(p) { delete (p); (p)=NULL; } }
#define SAFE_RELEASE(p) \
{ \
@@ -59,7 +57,7 @@ TSoundContainer::TSoundContainer(LPDIRECTSOUND pDS, const char *Directory, const
{
// SetFileUI( hDlg, TEXT("Bad wave file.") );
return;
ErrorLog("Missed sound: " + string(strFileName));
ErrorLog( "Missed sound: " + std::string(strFileName) );
}
strcpy(Name, ToLower(strFileName).c_str());
@@ -206,10 +204,10 @@ void TSoundsManager::LoadSounds(char *Directory)
LPDIRECTSOUNDBUFFER TSoundsManager::GetFromName(const char *Name, bool Dynamic, float *fSamplingRate)
{ // wyszukanie dŸwiêku w pamiêci albo wczytanie z pliku
AnsiString file;
std::string file;
if (Dynamic)
{ // próba wczytania z katalogu pojazdu
file = AnsiString(Global::asCurrentDynamicPath.c_str()) + AnsiString(Name);
file = Global::asCurrentDynamicPath + Name;
if (FileExists(file))
Name = file.c_str(); // nowa nazwa
else
@@ -260,7 +258,7 @@ LPDIRECTSOUNDBUFFER TSoundsManager::GetFromName(const char *Name, bool Dynamic,
*fSamplingRate = Next->fSamplingRate; // czêstotliwoœæ
return Next->GetUnique(pDS);
}
ErrorLog("Missed sound: " + string(Name));
ErrorLog("Missed sound: " + std::string(Name) );
return (NULL);
};