From f30625645feeaa578bc9390fb0488a7e194ad5f5 Mon Sep 17 00:00:00 2001 From: deb Date: Sun, 31 Jul 2016 07:15:31 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=82=BD=E3=83=BC=E3=82=B9=E3=81=AE?= =?UTF-8?q?=E3=83=80=E3=82=A6=E3=83=B3=E3=83=AD=E3=83=BC=E3=83=89=E5=85=88?= =?UTF-8?q?=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SMILEBASIC/petitcomputer.d | 45 ++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/SMILEBASIC/petitcomputer.d b/SMILEBASIC/petitcomputer.d index ad1b0eb..e41cb13 100644 --- a/SMILEBASIC/petitcomputer.d +++ b/SMILEBASIC/petitcomputer.d @@ -241,7 +241,7 @@ class PetitComputer GraphicPage createGRPF(string file) { SDL_RWops* stream = SDL_RWFromFile(toStringz(file), toStringz("rb")); - auto src = IMG_LoadPNG_RW(stream); + auto src = IMG_Load_RW(stream, 0); SDL_Surface* surface = SDL_CreateRGBSurface(0, src.w, src.h, 32, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);//0xff000000, 0x00ff0000, 0x0000ff00, 0xFF); SDL_Rect rect; rect.x = 0; @@ -381,19 +381,19 @@ class PetitComputer if(!exists(fontFile)) { writeln("download font"); - download("http://smileboom.com/special/ptcm3/download/unicode/image/res_font_table-320.png", + download("http://smilebasic.com/wordpress/wp-content/themes/smilebasic/publishimage/appendix/res_font_table-320.png", fontFile); } if(!exists(spriteFile)) { writeln("download sprite"); - download("http://smileboom.com/special/ptcm3/image/ss-story-attachment-1.png", + download("http://dengekionline.com/elem/000/000/927/927124/petitcom_16_cs1w1_512x512.jpg", spriteFile); } if(!exists(BGFile)) { writeln("download BG"); - download("http://smileboom.com/special/ptcm3/image/ss-story-attachment-2.png", + download("http://dengekionline.com/elem/000/000/927/927125/petitcom_17_cs1w1_512x512.jpg", BGFile); } if(!exists(fontTableFile)) @@ -833,23 +833,30 @@ class PetitComputer bool quit; void render() { - paint.buffer = new uint[512 * 512]; - DerelictSDL2.load(); - DerelictSDL2Image.load(); - GRPF = createGRPF(fontFile); - GRP = new GraphicPage[6]; - for(int i = 0; i < 4; i++) + try { - GRP[i] = createEmptyPage(); - } - sppage = 4; - GRP[4] = createGRPF(spriteFile); - bgpage = 5; - GRP[5] = createGRPF(BGFile); - SDL_Init(SDL_INIT_VIDEO); + paint.buffer = new uint[512 * 512]; + DerelictSDL2.load(); + DerelictSDL2Image.load(); + GRPF = createGRPF(fontFile); + GRP = new GraphicPage[6]; + for(int i = 0; i < 4; i++) + { + GRP[i] = createEmptyPage(); + } + sppage = 4; + GRP[4] = createGRPF(spriteFile); + bgpage = 5; + GRP[5] = createGRPF(BGFile); + SDL_Init(SDL_INIT_VIDEO); - DerelictGL.load(); - DerelictGL3.load(); + DerelictGL.load(); + DerelictGL3.load(); + } + catch(Throwable t) + { + writeln(t); + } bool renderprofile;// = true; try {