From 4015f6be43f4c073ccf87ab1385302d00b61800a Mon Sep 17 00:00:00 2001 From: otya128 Date: Wed, 31 Aug 2016 15:52:31 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AC=E3=83=B3=E3=83=80=E3=83=AA=E3=83=B3?= =?UTF-8?q?=E3=82=B0=E3=82=B9=E3=83=AC=E3=83=83=E3=83=89=E3=81=AE=E5=88=9D?= =?UTF-8?q?=E6=9C=9F=E5=8C=96=E5=BE=85=E6=A9=9F=E3=82=92=E3=81=BE=E3=81=A8?= =?UTF-8?q?=E3=82=82=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SMILEBASIC/petitcomputer.d | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SMILEBASIC/petitcomputer.d b/SMILEBASIC/petitcomputer.d index b642e0d..9481959 100644 --- a/SMILEBASIC/petitcomputer.d +++ b/SMILEBASIC/petitcomputer.d @@ -10,6 +10,7 @@ import std.conv; import std.string; import std.c.stdio; import core.sync.mutex; +import core.sync.condition; import otya.smilebasic.sprite; import otya.smilebasic.error; import otya.smilebasic.bg; @@ -831,6 +832,7 @@ class PetitComputer } protected BG[4] bg; bool quit; + Condition renderCondition; void render() { try @@ -936,6 +938,7 @@ class PetitComputer glEnable(GL_ALPHA_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); xscreen(0, 512, 4); + renderCondition.notify(); while(true) { auto profile = SDL_GetTicks(); @@ -1140,8 +1143,9 @@ class PetitComputer for(int i = 0; i < bg.length; i++) bg[i] = new BG(this); core.thread.Thread thread = new core.thread.Thread(&render); + renderCondition = new Condition(new Mutex()); thread.start(); - while(!buttonTable){} + renderCondition.wait(); auto startTicks = SDL_GetTicks(); Parser parser; otya.smilebasic.vm.VM vm;