Merge pull request #68 from 50thomatoes50/fix_unsigned_char_dr2locale

use unsigned char to support extended ascii
This commit is contained in:
Ilya 2020-12-29 17:46:58 +06:00 committed by GitHub
commit bb123fc440
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,9 +57,9 @@ void DeinitStringMng()
// [D] Driver 1 PC function
int InitStringLanguage(char *filename, int mission)
{
char *buffer;
char *cptr;
char *ln;
unsigned char *buffer;
unsigned char *cptr;
unsigned char *ln;
int i;
int size;
@ -74,14 +74,14 @@ int InitStringLanguage(char *filename, int mission)
size = ftell(fp);
fseek(fp, 0, SEEK_SET);
buffer = (char*)malloc(size);
buffer = (unsigned char*)malloc(size);
fread(buffer, 1, size, fp);
fclose(fp);
if (mission)
gMisssionLanguageBuffer = buffer;
gMisssionLanguageBuffer = (char*)buffer;
else
gGameLanguageBuffer = buffer;
gGameLanguageBuffer = (char*)buffer;
cptr = buffer;
for (i = 0; i < MAX_LANGUAGE_TEXT; i++)
@ -96,9 +96,9 @@ int InitStringLanguage(char *filename, int mission)
else
{
if (mission)
gMissionLangTable[i] = cptr;
gMissionLangTable[i] = (char*)cptr;
else
gGameLangTable[i] = cptr;
gGameLangTable[i] = (char*)cptr;
// go to next line
ln = cptr;