From c2a38339580a65563335831270f6c18fc7b507a5 Mon Sep 17 00:00:00 2001 From: otya128 Date: Mon, 26 Dec 2016 22:55:12 +0900 Subject: [PATCH] Fix otya.smilebasic.dialog.Text --- SMILEBASIC/dialog.d | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/SMILEBASIC/dialog.d b/SMILEBASIC/dialog.d index e694759..1f8b9a1 100644 --- a/SMILEBASIC/dialog.d +++ b/SMILEBASIC/dialog.d @@ -103,8 +103,11 @@ struct Text this(PetitComputer petitcom, wchar* text, SDL_Color color, uint width) { auto surface = petitcom.dialogResource.font.TTF_RenderUNICODE_Blended_Wrapped((cast(ushort*)text), color, width); - texture = new GraphicPage(surface); - texture.createTexture(petitcom.renderer, petitcom.textureScaleMode); + if (surface) + { + texture = new GraphicPage(surface); + texture.createTexture(petitcom.renderer, petitcom.textureScaleMode); + } } ~this() { @@ -192,6 +195,8 @@ class Dialog : DialogBase } void renderContent() { + if (!message) + return; glDepthMask(GL_FALSE); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND);