From b982e423b28a84c94bd2d577bb4655aa143931a7 Mon Sep 17 00:00:00 2001 From: otya128 Date: Tue, 4 Jul 2017 16:55:49 +0900 Subject: [PATCH] Fix Gamecontroller --- README-ja.md | 2 +- README.md | 2 +- SMILEBASIC/petitcomputer.d | 6 ++++++ dub.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README-ja.md b/README-ja.md index e7b1274..5f36952 100644 --- a/README-ja.md +++ b/README-ja.md @@ -11,7 +11,7 @@ MIT # ビルド方法 ```sh -git clone git@github.com:otya128/otyaSMILEBASIC.git +git clone --recursive https://github.com/otya128/otyaSMILEBASIC.git cd otyaSMILEBASIC dub run ``` diff --git a/README.md b/README.md index 3126c34..23ca4d0 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ MIT # How to build ```sh -git clone git@github.com:otya128/otyaSMILEBASIC.git +git clone --recursive https://github.com/otya128/otyaSMILEBASIC.git cd otyaSMILEBASIC dub run ``` diff --git a/SMILEBASIC/petitcomputer.d b/SMILEBASIC/petitcomputer.d index d739aff..fd345bc 100644 --- a/SMILEBASIC/petitcomputer.d +++ b/SMILEBASIC/petitcomputer.d @@ -679,6 +679,11 @@ class PetitComputer DerelictGL.load(); DerelictGL3.load(); + SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt"); + for (int i = 0; i < SDL_NumJoysticks(); i++) + { + AddController(i); + } } catch(Throwable t) { @@ -787,6 +792,7 @@ class PetitComputer renderCondition.mutex.unlock; renderCondition.notify(); } + while(true) { auto profile = SDL_GetTicks(); diff --git a/dub.json b/dub.json index c1edec1..373b8e8 100644 --- a/dub.json +++ b/dub.json @@ -10,5 +10,5 @@ "buildRequirements": ["allowWarnings"], "targetPath": "out", "workingDirectory": "out", - "copyFiles": ["SMILEBASIC/spdef.csv", "SMILEBASIC/dialogresource"] + "copyFiles": ["SMILEBASIC/spdef.csv", "SMILEBASIC/dialogresource", "SDL_GameControllerDB/gamecontrollerdb.txt"] }