summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--ext/ruby2d/ruby2d.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/ruby2d/ruby2d.c b/ext/ruby2d/ruby2d.c
index 49beb2c..0b9e338 100644
--- a/ext/ruby2d/ruby2d.c
+++ b/ext/ruby2d/ruby2d.c
@@ -909,8 +909,11 @@ static R_VAL ruby2d_window_ext_show(R_VAL self) {
S2D_Diagnostics(true);
}
+ // Load controller mappings, if DB file exists
char *controller_mappings_path = RSTRING_PTR(r_iv_get(self, "@controller_mappings_path"));
- S2D_LoadControllerMappingsFromFile(controller_mappings_path);
+ if (S2D_FileExists(controller_mappings_path)) {
+ S2D_LoadControllerMappingsFromFile(controller_mappings_path);
+ }
// Get window attributes
char *title = RSTRING_PTR(r_iv_get(self, "@title"));