From c7fb7d9aaf8c13e863038a88b41e7ff6066a1f24 Mon Sep 17 00:00:00 2001 From: Joostinonline Date: Tue, 12 Nov 2013 16:34:59 +0000 Subject: [PATCH] -Some of those changes were...bad --- include/thread.h | 2 ++ source/gui.c | 13 ++----------- source/thread.c | 3 +-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/include/thread.h b/include/thread.h index f146610..68f843c 100644 --- a/include/thread.h +++ b/include/thread.h @@ -1,6 +1,8 @@ #ifndef __THREAD_H__ #define __THREAD_H__ +#include + extern lwp_t Cog_Thread; extern u64 Last_Cog_Turn; extern u8 Cog_Num; diff --git a/source/gui.c b/source/gui.c index 6c5fd85..a0dcb76 100644 --- a/source/gui.c +++ b/source/gui.c @@ -1,7 +1,6 @@ #include #include #include -#include #include "tahoma_ttf.h" @@ -47,8 +46,6 @@ GRRLIB_texImg *tex_window_png; GRRLIB_texImg *tex_Cogs_png[5]; GRRLIB_texImg *tex_ScreenBuf; -//mutex_t lock_thread; - typedef struct map_entry { char name[8]; @@ -165,7 +162,6 @@ int initGUI(void) { tex_Cogs_png[4] = GRRLIB_LoadTexturePNG(Cog5); tex_ScreenBuf = GRRLIB_CreateEmptyTexture(rmode->fbWidth, rmode->efbHeight); InitThread(); - //LWP_MutexInit(&lock_thread, false); return 0; } @@ -230,12 +226,10 @@ int printLoading(const char* msg) { //int i; //ResumeThread(); u64 current_ticks = gettick(); - PauseThread(); //GRRLIB_DrawImg(256, 112, tex_Refreshicon_png, 0, 1, 1, HEX_WHITE); GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, HEX_WHITE); GRRLIB_PrintfTTF((640-strlen(msg)*9)/2, 256, myFont, msg, 20, HEX_WHITE); CopyBuf(); - ResumeThread(); //for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug while(!CheckTime(current_ticks, 250)) { //DrawBuf(); @@ -249,7 +243,7 @@ int printSelectIOS(const char* msg, const char* ios) { int i; PauseThread(); GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, HEX_WHITE); - //GRRLIB_DrawImg(256, 112, tex_Refreshicon_png, 0, 1, 1, HEX_WHITE); + GRRLIB_DrawImg(256, 112, tex_Refreshicon_png, 0, 1, 1, HEX_WHITE); GRRLIB_PrintfTTF((640-strlen(msg)*9)/2, 256, myFont, msg, 20, HEX_WHITE); GRRLIB_PrintfTTF((640-strlen(ios)*9)/2, 300, myFont, ios, 20, HEX_WHITE); @@ -259,7 +253,6 @@ int printSelectIOS(const char* msg, const char* ios) { GRRLIB_DrawImg(310, 388, tex_WiiButtonPlus_png, 0, 1, 1, HEX_WHITE); GRRLIB_PrintfTTF(335-(strlen(BUT_Update)*7.8)/2, 425, myFont, BUT_Update, 14, HEX_WHITE); CopyBuf(); - ResumeThread(); for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug DrawBuf(); GRRLIB_Render(); @@ -277,14 +270,12 @@ int printLoadingBar(const char* msg, const f32 percent) { notloaded = 536 - loaded; //int i; - PauseThread(); GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, HEX_WHITE); //GRRLIB_DrawImg(256, 112, tex_Refreshicon_png, 0, 1, 1, HEX_WHITE); GRRLIB_PrintfTTF((640-strlen(msg)*9)/2, 256, myFont, msg, 20, HEX_WHITE); GRRLIB_DrawPart(52, 340, 0, 0, loaded, 36, tex_loadingbarblue_png, 0, 1, 1, HEX_WHITE); GRRLIB_DrawPart(52+loaded, 340, loaded, 0, notloaded, 36, tex_loadingbargrey_png, 0, 1, 1, HEX_WHITE); CopyBuf(); - ResumeThread(); //for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug while(!CheckTime(current_ticks, 250)) { //DrawBuf(); @@ -296,7 +287,7 @@ int printLoadingBar(const char* msg, const f32 percent) { int printEndSuccess(const char* msg) { int i; - PauseThread(); + //PauseThread(); GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, HEX_WHITE); GRRLIB_DrawImg(256, 112, tex_Checkicon_png, 0, 1, 1, HEX_WHITE); diff --git a/source/thread.c b/source/thread.c index a46f3ad..d68645e 100644 --- a/source/thread.c +++ b/source/thread.c @@ -2,7 +2,6 @@ #include #include #include -#include #include "thread.h" #include "gui.h" @@ -33,7 +32,7 @@ void * DrawCogThread(void *arg) { inline void InitThread(void) { memset (&stack, 0, STACKSIZE); LWP_CreateThread (&Cog_Thread, DrawCogThread, NULL, stack, STACKSIZE, PRIORITY); - //usleep(200); + usleep(200); } inline s32 PauseThread(void) {