1
1
Fork 0
Browse Source

bug fix

master
alistair 3 years ago
parent
commit
bd868a0137
  1. 5
      src/controlscheme.c
  2. 1
      src/game.c
  3. 6
      src/main.c

5
src/controlscheme.c

@ -12,6 +12,7 @@ struct InputMap input_map; @@ -12,6 +12,7 @@ struct InputMap input_map;
struct InputMap_Ser {
unsigned int id;
unsigned int ver;
size_t size;
struct InputMap input_map;
};
@ -77,6 +78,9 @@ int load_controls(void) { @@ -77,6 +78,9 @@ int load_controls(void) {
struct InputMap_Ser *im = (struct InputMap_Ser *)b.data;
if (im->size != sizeof(struct InputMap_Ser))
return 0;
if (im->id != INPUT_MAP_ID)
return 0;
@ -93,6 +97,7 @@ void save_controls(void) { @@ -93,6 +97,7 @@ void save_controls(void) {
struct InputMap_Ser im;
im.id = INPUT_MAP_ID;
im.ver = INPUT_MAP_VERSION;
im.size = sizeof(struct InputMap_Ser);
im.input_map = input_map;
fwrite(&im, sizeof(unsigned char), sizeof(struct InputMap_Ser), f);

1
src/game.c

@ -1754,6 +1754,7 @@ void handle_input_event(SDL_Event event) { @@ -1754,6 +1754,7 @@ void handle_input_event(SDL_Event event) {
if (sc == input_map.goto_level) {
gameui.currently_bound_textbox = textboxes + TB_LEVEL_CHOOSER;
reset_textbox(gameui.currently_bound_textbox);
};
if (sc == input_map.high_contrast_mode) {

6
src/main.c

@ -168,15 +168,13 @@ int main (int argc, char** argv) { @@ -168,15 +168,13 @@ int main (int argc, char** argv) {
/*
* TODO:
* - Fix open screen and pause screens
* - Allow setting and saving/loading differnet control schemes
* - Allow starting a specific level
* - Allow adjusging level lengths?
* - Ensure next_level doesn't leak memory
* - fix that weird jitter
* - Fix open screen and pause screens
* - make the end of level look sane
* - restart level
* - make sure goto level doesn't log an end-0f-level time
* - make sure goto level doesn't log an end-0f-level time?
*/

Loading…
Cancel
Save