diff --git a/src/packages/config/IZ_config_guid.h b/src/packages/config/IZ_config_guid.h index d451d45..4603a0e 100644 --- a/src/packages/config/IZ_config_guid.h +++ b/src/packages/config/IZ_config_guid.h @@ -8,7 +8,7 @@ void INI_ConfigLoadGuid(INI_ConfigItem*, const char*); INI_ConfigSaveItemResult INI_ConfigSaveGuid(INI_ConfigItem*, const char*); void INI_ConfigOverrideGuid(INI_ConfigItem*, uint8_t, const char*[]); -#define INI_CONFIG_TYPE_FNS_GUID (INI_ConfigTypeFns) { \ +#define INI_CONFIG_TYPE_GUID (INI_ConfigType) { \ .size = sizeof(SDL_GUID), \ .load = INI_ConfigLoadGuid, \ .save = INI_ConfigSaveGuid, \ diff --git a/src/packages/game/input/IZ_joystick.c b/src/packages/game/input/IZ_joystick.c index 93c4f04..28d2626 100644 --- a/src/packages/game/input/IZ_joystick.c +++ b/src/packages/game/input/IZ_joystick.c @@ -204,32 +204,35 @@ void IZ_JoystickInitializeConfigItems(INI_ConfigItem config_items[]) { sprintf(main_section_name, "Joystick.%d", player_index); u8 base_index = (player_index * (IZ_CONTROLS - 4 + 2)); config_items[base_index] = (INI_ConfigItem) { - INI_CONFIG_TYPE_FNS_I32, + INI_CONFIG_TYPE_I32, main_section_name, "DeviceID", NULL, &IZ_JOYSTICK_DEFAULT_STATE[player_index].config.device_id, NULL, + INI_CONFIG_TRANSFORMER_NONE, NULL, }; config_items[base_index + 1] = (INI_ConfigItem) { - INI_CONFIG_TYPE_FNS_U16, + INI_CONFIG_TYPE_U16, main_section_name, "AxisThreshold", NULL, &IZ_JOYSTICK_DEFAULT_STATE[player_index].config.axis_threshold, IZ_JoystickIsValidAxisThreshold, + INI_CONFIG_TRANSFORMER_NONE, NULL, }; config_items[base_index + 2] = (INI_ConfigItem) { - INI_CONFIG_TYPE_FNS_GUID, + INI_CONFIG_TYPE_GUID, main_section_name, "GUID", NULL, &IZ_JOYSTICK_DEFAULT_STATE[player_index].config.guid, NULL, + INI_CONFIG_TRANSFORMER_NONE, NULL, }; @@ -239,12 +242,13 @@ void IZ_JoystickInitializeConfigItems(INI_ConfigItem config_items[]) { sprintf(control_mapping_section_name, "Joystick.%d.ControlMapping", player_index); for (control_index = 4; control_index < IZ_CONTROLS; control_index += 1) { config_items[base_index + 3 + (control_index - 4)] = (INI_ConfigItem) { - INI_CONFIG_TYPE_FNS_U8, + INI_CONFIG_TYPE_U8, control_mapping_section_name, IZ_ACTION_NAMES[control_index], NULL, &IZ_JOYSTICK_DEFAULT_STATE[player_index].config.control_mapping[control_index], NULL, + INI_CONFIG_TRANSFORMER_NONE, NULL, }; } diff --git a/src/packages/game/input/IZ_keyboard.c b/src/packages/game/input/IZ_keyboard.c index 22b78bc..e364706 100644 --- a/src/packages/game/input/IZ_keyboard.c +++ b/src/packages/game/input/IZ_keyboard.c @@ -58,7 +58,7 @@ void IZ_KeyboardInitializeConfigItems(INI_ConfigItem config_items[]) { sprintf(control_mapping_section_name, "Keyboard.%d.ControlMapping", player_index); for (control_index = 0; control_index < IZ_CONTROLS; control_index += 1) { config_items[player_index * IZ_CONTROLS + control_index] = (INI_ConfigItem) { - INI_CONFIG_TYPE_FNS_I32, + INI_CONFIG_TYPE_I32, control_mapping_section_name, IZ_ACTION_NAMES[control_index], NULL, diff --git a/src/packages/game/input/IZ_midi.c b/src/packages/game/input/IZ_midi.c index b568db3..03cfd00 100644 --- a/src/packages/game/input/IZ_midi.c +++ b/src/packages/game/input/IZ_midi.c @@ -81,30 +81,24 @@ void IZ_MIDIInputInitializeConfigItems(INI_ConfigItem config_items[]) { u16 base_index = (player_index * (IZ_CONTROLS + 2)); config_items[base_index] = (INI_ConfigItem) { - INI_CONFIG_TYPE_FNS_I32, + INI_CONFIG_TYPE_I32, main_section_name, "DeviceID", NULL, &IZ_MIDI_INPUT_DEFAULT_STATE[player_index].config.device_id, NULL, - { - .serialize = NULL, - .deserialize = NULL, - }, + INI_CONFIG_TRANSFORMER_NONE, NULL, }; config_items[base_index + 1] = (INI_ConfigItem) { - INI_CONFIG_TYPE_FNS_U8, + INI_CONFIG_TYPE_U8, main_section_name, "Channel", NULL, &IZ_MIDI_INPUT_DEFAULT_STATE[player_index].config.channel, IZ_MIDIInputIsValidChannel, - { - .serialize = NULL, - .deserialize = NULL, - }, + INI_CONFIG_TRANSFORMER_NONE, NULL, }; @@ -112,7 +106,7 @@ void IZ_MIDIInputInitializeConfigItems(INI_ConfigItem config_items[]) { sprintf(control_mapping_section_name, "MIDIInput.%d.ControlMapping", player_index); for (control_index = 0; control_index < IZ_CONTROLS; control_index += 1) { config_items[base_index + 2 + control_index] = (INI_ConfigItem) { - INI_CONFIG_TYPE_FNS_U8, + INI_CONFIG_TYPE_U8, control_mapping_section_name, IZ_ACTION_NAMES[control_index], NULL, diff --git a/src/packages/game/output/video/IZ_video.c b/src/packages/game/output/video/IZ_video.c index 835ec7b..6785d42 100644 --- a/src/packages/game/output/video/IZ_video.c +++ b/src/packages/game/output/video/IZ_video.c @@ -16,28 +16,34 @@ bool IZ_VideoIsValidMaxFPS(u8 max_fps) { static INI_ConfigItem video_config_items[] = { { - INI_CONFIG_TYPE_FNS_U16, + INI_CONFIG_TYPE_U16, "Video", "Width", NULL, &IZ_VIDEO_DEFAULT_STATE.config.width, IZ_VideoIsValidWidth, + INI_CONFIG_TRANSFORMER_NONE, + NULL, }, { - INI_CONFIG_TYPE_FNS_U16, + INI_CONFIG_TYPE_U16, "Video", "Height", NULL, &IZ_VIDEO_DEFAULT_STATE.config.height, IZ_VideoIsValidHeight, + INI_CONFIG_TRANSFORMER_NONE, + NULL, }, { - INI_CONFIG_TYPE_FNS_U8, + INI_CONFIG_TYPE_U8, "Video", "MaxFps", "-f", &IZ_VIDEO_DEFAULT_STATE.config.max_fps, IZ_VideoIsValidMaxFPS, + INI_CONFIG_TRANSFORMER_NONE, + NULL, }, INI_CONFIG_ITEM_NULL, }; diff --git a/src/packages/net/IZ_net_client.c b/src/packages/net/IZ_net_client.c index 060f18c..e7d44a8 100644 --- a/src/packages/net/IZ_net_client.c +++ b/src/packages/net/IZ_net_client.c @@ -16,31 +16,34 @@ static INI_ConfigItem net_client_config_items[IZ_PLAYERS + 3 + 1]; void IZ_NetClientInitializeConfigItems(INI_ConfigItem config_items[]) { config_items[0] = (INI_ConfigItem) { - INI_CONFIG_TYPE_FNS_U16, - "Network", - "PacketIntervalMs", - "-i", - &IZ_NET_CLIENT_DEFAULT_STATE.config.packet_interval_ms, - IZ_NetClientIsValidPacketIntervalMs, - NULL, + INI_CONFIG_TYPE_U16, + "Network", + "PacketIntervalMs", + "-i", + &IZ_NET_CLIENT_DEFAULT_STATE.config.packet_interval_ms, + IZ_NetClientIsValidPacketIntervalMs, + INI_CONFIG_TRANSFORMER_NONE, + NULL, }; config_items[1] = (INI_ConfigItem) { - INI_CONFIG_TYPE_FNS_U8, - "Network", - "MaxReconnectRetries", - NULL, - &IZ_NET_CLIENT_DEFAULT_STATE.config.max_reconnect_retries, - IZ_NetClientIsValidMaxReconnectRetries, - NULL, + INI_CONFIG_TYPE_U8, + "Network", + "MaxReconnectRetries", + NULL, + &IZ_NET_CLIENT_DEFAULT_STATE.config.max_reconnect_retries, + IZ_NetClientIsValidMaxReconnectRetries, + INI_CONFIG_TRANSFORMER_NONE, + NULL, }; config_items[2] = (INI_ConfigItem) { - INI_CONFIG_TYPE_FNS_U8, - "Network", - "ReconnectIntervalSeconds", - NULL, - &IZ_NET_CLIENT_DEFAULT_STATE.config.reconnect_interval_secs, - IZ_NetClientIsValidReconnectIntervalSeconds, - NULL, + INI_CONFIG_TYPE_U8, + "Network", + "ReconnectIntervalSeconds", + NULL, + &IZ_NET_CLIENT_DEFAULT_STATE.config.reconnect_interval_secs, + IZ_NetClientIsValidReconnectIntervalSeconds, + INI_CONFIG_TRANSFORMER_NONE, + NULL, }; u8 player_index; @@ -55,6 +58,7 @@ void IZ_NetClientInitializeConfigItems(INI_ConfigItem config_items[]) { NULL, &IZ_NET_CLIENT_DEFAULT_STATE.config.usernames[player_index], NULL, + INI_CONFIG_TRANSFORMER_NONE, NULL, }; } diff --git a/src/packages/net/IZ_net_server.c b/src/packages/net/IZ_net_server.c index 869f14c..0a91c71 100644 --- a/src/packages/net/IZ_net_server.c +++ b/src/packages/net/IZ_net_server.c @@ -12,10 +12,7 @@ static INI_ConfigItem net_server_config_items[] = { "-n", &IZ_NET_SERVER_DEFAULT_STATE.config.name, NULL, - { - .serialize = NULL, - .deserialize = NULL, - }, + INI_CONFIG_TRANSFORMER_NONE, NULL, }, { @@ -25,23 +22,17 @@ static INI_ConfigItem net_server_config_items[] = { "-m", &IZ_NET_SERVER_DEFAULT_STATE.config.motd, NULL, - { - .serialize = NULL, - .deserialize = NULL, - }, + INI_CONFIG_TRANSFORMER_NONE, NULL, }, { - INI_CONFIG_TYPE_FNS_U16, + INI_CONFIG_TYPE_U16, "Network", "Port", "-p", &IZ_NET_SERVER_DEFAULT_STATE.config.port, IZ_NetServerIsValidPort, - { - .serialize = NULL, - .deserialize = NULL, - }, + INI_CONFIG_TRANSFORMER_NONE, NULL, }, INI_CONFIG_ITEM_NULL, diff --git a/src/packages/server/db/IZ_repo.c b/src/packages/server/db/IZ_repo.c index 4c86e3b..2d656fb 100644 --- a/src/packages/server/db/IZ_repo.c +++ b/src/packages/server/db/IZ_repo.c @@ -8,10 +8,7 @@ static INI_ConfigItem repo_config_items[] = { "-d", &IZ_REPO_DEFAULT_STATE.config.path, NULL, - { - .serialize = NULL, - .deserialize = NULL, - }, + INI_CONFIG_TRANSFORMER_NONE, NULL, }, INI_CONFIG_ITEM_NULL, diff --git a/subprojects/ini-config b/subprojects/ini-config index 6dbbef4..482c2fa 160000 --- a/subprojects/ini-config +++ b/subprojects/ini-config @@ -1 +1 @@ -Subproject commit 6dbbef47a430649aec60a327512379b8dc0719a3 +Subproject commit 482c2faf41a8dd2c2a65acf0c41649d310dba3c8