C client: fix a few compile errors

This commit is contained in:
UnknownShadow200 2018-08-29 05:30:08 +10:00
parent 725ea1b351
commit ff8889bc7e
8 changed files with 17 additions and 18 deletions

View File

@ -386,8 +386,8 @@ static void ResolutionCommand_Execute(STRING_PURE String* args, Int32 argsCount)
} else {
struct Size2D size = { width, height };
Window_SetClientSize(size);
Options_SetInt32(OPT_WINDOW_WIDTH, width);
Options_SetInt32(OPT_WINDOW_HEIGHT, height);
Options_SetInt(OPT_WINDOW_WIDTH, width);
Options_SetInt(OPT_WINDOW_HEIGHT, height);
}
}

View File

@ -143,7 +143,7 @@ bool Game_ChangeTerrainAtlas(struct Bitmap* atlas) {
void Game_SetViewDistance(Int32 distance, bool userDist) {
if (userDist) {
Game_UserViewDistance = distance;
Options_SetInt32(OPT_VIEW_DISTANCE, distance);
Options_SetInt(OPT_VIEW_DISTANCE, distance);
}
distance = min(distance, Game_MaxViewDistance);

View File

@ -366,7 +366,7 @@ static void ListScreen_UpdatePage(struct ListScreen* screen) {
screen->Buttons[6].Disabled = screen->CurrentIndex >= end;
if (Game_ClassicMode) return;
UInt8 pageBuffer[STRING_SIZE];
char pageBuffer[STRING_SIZE];
String page = String_FromArray(pageBuffer);
Int32 num = (screen->CurrentIndex / LIST_SCREEN_ITEMS) + 1;
Int32 pages = Math_CeilDiv(screen->Entries.Count, LIST_SCREEN_ITEMS);
@ -2263,7 +2263,7 @@ static void ClassicOptionsScreen_GetMusic(STRING_TRANSIENT String* v) { Menu_Get
static void ClassicOptionsScreen_SetMusic(STRING_PURE String* v) {
Game_MusicVolume = String_CaselessEqualsConst(v, "ON") ? 100 : 0;
Audio_SetMusic(Game_MusicVolume);
Options_SetInt32(OPT_MUSIC_VOLUME, Game_MusicVolume);
Options_SetInt(OPT_MUSIC_VOLUME, Game_MusicVolume);
}
static void ClassicOptionsScreen_GetInvert(STRING_TRANSIENT String* v) { Menu_GetBool(v, Game_InvertMouse); }
@ -2295,7 +2295,7 @@ static void ClassicOptionsScreen_GetSounds(STRING_TRANSIENT String* v) { Menu_Ge
static void ClassicOptionsScreen_SetSounds(STRING_PURE String* v) {
Game_SoundsVolume = String_CaselessEqualsConst(v, "ON") ? 100 : 0;
Audio_SetSounds(Game_SoundsVolume);
Options_SetInt32(OPT_SOUND_VOLUME, Game_SoundsVolume);
Options_SetInt(OPT_SOUND_VOLUME, Game_SoundsVolume);
}
static void ClassicOptionsScreen_GetShowFPS(STRING_TRANSIENT String* v) { Menu_GetBool(v, Game_ShowFPS); }

View File

@ -205,9 +205,9 @@ void Window_Create(Int32 x, Int32 y, Int32 width, Int32 height, STRING_REF Strin
Window_Exists = true;
}
char clipboard_copy_buffer[String_BufferSize(256)];
char clipboard_copy_buffer[256];
String clipboard_copy_text = String_FromArray(clipboard_copy_buffer);
char clipboard_paste_buffer[String_BufferSize(256)];
char clipboard_paste_buffer[256];
String clipboard_paste_text = String_FromArray(clipboard_paste_buffer);
void Window_GetClipboardText(STRING_TRANSIENT String* value) {

View File

@ -129,7 +129,7 @@ void Options_SetBool(const char* keyRaw, bool value) {
}
}
void Options_SetInt32(const char* keyRaw, Int32 value) {
void Options_SetInt(const char* keyRaw, Int32 value) {
char numBuffer[STRING_INT_CHARS];
String numStr = String_FromArray(numBuffer);
String_AppendInt32(&numStr, value);

View File

@ -83,7 +83,7 @@ Real32 Options_GetFloat(const char* key, Real32 min, Real32 max, Real32 defValue
UInt32 Options_GetEnum(const char* key, UInt32 defValue, const char** names, UInt32 namesCount);
void Options_SetBool(const char* keyRaw, bool value);
void Options_SetInt32(const char* keyRaw, Int32 value);
void Options_SetInt(const char* keyRaw, Int32 value);
void Options_Set(const char* keyRaw, STRING_PURE String* value);
void Options_Load(void);
void Options_Save(void);

View File

@ -435,7 +435,7 @@ ReturnCode Directory_Enum(STRING_PURE String* path, void* obj, Directory_EnumCal
return result;
}
ReturnCode File_GetModifiedTime_MS(STRING_PURE String* path, DateTime* time) {
ReturnCode File_GetModifiedTime_MS(STRING_PURE String* path, UInt64* time) {
char str[600]; Platform_ConvertString(str, path);
struct stat sb;
if (stat(str, &sb) == -1) return errno;

View File

@ -1320,9 +1320,8 @@ void InputWidget_Create(struct InputWidget* widget, struct FontDesc* font, STRIN
/*########################################################################################################################*
*---------------------------------------------------struct MenuInputValidator----------------------------------------------------*
*---------------------------------------------------MenuInputValidator----------------------------------------------------*
*#########################################################################################################################*/
static bool MenuInputValidator_AlwaysValidChar(struct MenuInputValidator* v, char c) { return true; }
static bool MenuInputValidator_AlwaysValidString(struct MenuInputValidator* v, STRING_PURE String* s) { return true; }
static void HexColValidator_GetRange(struct MenuInputValidator* v, STRING_TRANSIENT String* range) {