A few comments from glancing at your code:
- ptr->field is equivalent and the preferred way to perform (*ptr).field.
- Please be consistent about functionCase, variable_case, etc. Pick whatever you want, but stick with it: I see functions printUInt64, missing_appvars, and Draw just for the first three functions, which is three separate casing styles.
- Short-circuiting and guaranteed in-order evaluation means that you can simplify this:
Code: if (var == 0)
{
return 1;
}
if (ti_GetC(var) != 'a')
{
return 1;
}
if (ti_Read(Player, sizeof(struct player_t), 1, var) != 1)
{
return 1;
}
if (ti_GetC(var) != 'b')
{
return 1;
}
if (ti_Read(Counts, sizeof(struct counts_t), 1, var) != 1)
{
return 1;
}
if (ti_GetC(var) != 'c')
{
return 1;
}
if (ti_Read(Prices, sizeof(struct prices_t), 1, var) != 1)
{
return 1;
}
to Code: if (var == 0 || ti_GetC(var) != 'a') || ti_Read(Player, sizeof(struct player_t), 1, var) != 1 ||
ti_GetC(var) != 'b' || ti_Read(Counts, sizeof(struct counts_t), 1, var) != 1 || || ti_GetC(var) != 'c' ||
ti_Read(Prices, sizeof(struct prices_t), 1, var) != 1)
{
return 1;
}
- You can clean up your list of conditionals to increment Player.unlocked using a switch/case construct with cases for each possible value of Player.unlocked.