1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 06:50:00 +00:00

bb std::string

This commit is contained in:
Fire-Head 2020-05-04 22:02:54 +03:00
parent 6382b6d2fc
commit 73c809f616

View file

@ -54,7 +54,7 @@ ALuint ALEffect = AL_EFFECT_NULL;
ALuint ALEffectSlot = AL_EFFECTSLOT_NULL; ALuint ALEffectSlot = AL_EFFECTSLOT_NULL;
struct struct
{ {
std::string id; char id[256];
char name[256]; char name[256];
int sources; int sources;
}providers[MAXPROVIDERS]; }providers[MAXPROVIDERS];
@ -137,7 +137,7 @@ add_providers()
{ {
if ( n < MAXPROVIDERS ) if ( n < MAXPROVIDERS )
{ {
providers[n].id=std::string(pDeviceList->GetDeviceName(i), strlen(pDeviceList->GetDeviceName(i))); strcpy(providers[n].id, pDeviceList->GetDeviceName(i));
strncpy(providers[n].name, pDeviceList->GetDeviceName(i), sizeof(providers[n].name)); strncpy(providers[n].name, pDeviceList->GetDeviceName(i), sizeof(providers[n].name));
providers[n].sources = pDeviceList->GetMaxNumSources(i); providers[n].sources = pDeviceList->GetMaxNumSources(i);
SampleManager.Set3DProviderName(n, providers[n].name); SampleManager.Set3DProviderName(n, providers[n].name);
@ -152,7 +152,7 @@ add_providers()
{ {
if ( n < MAXPROVIDERS ) if ( n < MAXPROVIDERS )
{ {
providers[n].id=std::string(pDeviceList->GetDeviceName(i), strlen(pDeviceList->GetDeviceName(i))); strcpy(providers[n].id, pDeviceList->GetDeviceName(i));
strncpy(providers[n].name, pDeviceList->GetDeviceName(i), sizeof(providers[n].name)); strncpy(providers[n].name, pDeviceList->GetDeviceName(i), sizeof(providers[n].name));
strcat(providers[n].name, " EAX"); strcat(providers[n].name, " EAX");
providers[n].sources = pDeviceList->GetMaxNumSources(i); providers[n].sources = pDeviceList->GetMaxNumSources(i);
@ -162,7 +162,7 @@ add_providers()
if ( n < MAXPROVIDERS ) if ( n < MAXPROVIDERS )
{ {
providers[n].id=std::string(pDeviceList->GetDeviceName(i), strlen(pDeviceList->GetDeviceName(i))); strcpy(providers[n].id, pDeviceList->GetDeviceName(i));
strncpy(providers[n].name, pDeviceList->GetDeviceName(i), sizeof(providers[n].name)); strncpy(providers[n].name, pDeviceList->GetDeviceName(i), sizeof(providers[n].name));
strcat(providers[n].name, " EAX3"); strcat(providers[n].name, " EAX3");
providers[n].sources = pDeviceList->GetMaxNumSources(i); providers[n].sources = pDeviceList->GetMaxNumSources(i);
@ -263,7 +263,7 @@ set_new_provider(int index)
ALCint attr[] = {ALC_FREQUENCY,MAX_FREQ,0}; ALCint attr[] = {ALC_FREQUENCY,MAX_FREQ,0};
ALDevice = alcOpenDevice(providers[index].id.c_str()); ALDevice = alcOpenDevice(providers[index].id);
ASSERT(ALDevice != NULL); ASSERT(ALDevice != NULL);
ALContext = alcCreateContext(ALDevice, attr); ALContext = alcCreateContext(ALDevice, attr);