-Some of those changes were...bad

This commit is contained in:
Joostinonline 2013-11-12 16:34:59 +00:00
parent 50ac33664e
commit c7fb7d9aaf
3 changed files with 5 additions and 13 deletions

View File

@ -1,6 +1,8 @@
#ifndef __THREAD_H__ #ifndef __THREAD_H__
#define __THREAD_H__ #define __THREAD_H__
#include <ogc/lwp.h>
extern lwp_t Cog_Thread; extern lwp_t Cog_Thread;
extern u64 Last_Cog_Turn; extern u64 Last_Cog_Turn;
extern u8 Cog_Num; extern u8 Cog_Num;

View File

@ -1,7 +1,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <wiiuse/wpad.h> #include <wiiuse/wpad.h>
#include <ogc/lwp_watchdog.h> #include <ogc/lwp_watchdog.h>
#include <ogc/mutex.h>
#include "tahoma_ttf.h" #include "tahoma_ttf.h"
@ -47,8 +46,6 @@ GRRLIB_texImg *tex_window_png;
GRRLIB_texImg *tex_Cogs_png[5]; GRRLIB_texImg *tex_Cogs_png[5];
GRRLIB_texImg *tex_ScreenBuf; GRRLIB_texImg *tex_ScreenBuf;
//mutex_t lock_thread;
typedef struct map_entry typedef struct map_entry
{ {
char name[8]; char name[8];
@ -165,7 +162,6 @@ int initGUI(void) {
tex_Cogs_png[4] = GRRLIB_LoadTexturePNG(Cog5); tex_Cogs_png[4] = GRRLIB_LoadTexturePNG(Cog5);
tex_ScreenBuf = GRRLIB_CreateEmptyTexture(rmode->fbWidth, rmode->efbHeight); tex_ScreenBuf = GRRLIB_CreateEmptyTexture(rmode->fbWidth, rmode->efbHeight);
InitThread(); InitThread();
//LWP_MutexInit(&lock_thread, false);
return 0; return 0;
} }
@ -230,12 +226,10 @@ int printLoading(const char* msg) {
//int i; //int i;
//ResumeThread(); //ResumeThread();
u64 current_ticks = gettick(); u64 current_ticks = gettick();
PauseThread();
//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_DrawImg(0, 0, tex_background_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); GRRLIB_PrintfTTF((640-strlen(msg)*9)/2, 256, myFont, msg, 20, HEX_WHITE);
CopyBuf(); CopyBuf();
ResumeThread();
//for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug //for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug
while(!CheckTime(current_ticks, 250)) { while(!CheckTime(current_ticks, 250)) {
//DrawBuf(); //DrawBuf();
@ -249,7 +243,7 @@ int printSelectIOS(const char* msg, const char* ios) {
int i; int i;
PauseThread(); PauseThread();
GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, HEX_WHITE); 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(msg)*9)/2, 256, myFont, msg, 20, HEX_WHITE);
GRRLIB_PrintfTTF((640-strlen(ios)*9)/2, 300, myFont, ios, 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_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); GRRLIB_PrintfTTF(335-(strlen(BUT_Update)*7.8)/2, 425, myFont, BUT_Update, 14, HEX_WHITE);
CopyBuf(); CopyBuf();
ResumeThread();
for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug
DrawBuf(); DrawBuf();
GRRLIB_Render(); GRRLIB_Render();
@ -277,14 +270,12 @@ int printLoadingBar(const char* msg, const f32 percent) {
notloaded = 536 - loaded; notloaded = 536 - loaded;
//int i; //int i;
PauseThread();
GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, HEX_WHITE); 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(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, 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); GRRLIB_DrawPart(52+loaded, 340, loaded, 0, notloaded, 36, tex_loadingbargrey_png, 0, 1, 1, HEX_WHITE);
CopyBuf(); CopyBuf();
ResumeThread();
//for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug //for (i = 0; i < 3; i++) { //Workaround for GRRLIB_Render() bug
while(!CheckTime(current_ticks, 250)) { while(!CheckTime(current_ticks, 250)) {
//DrawBuf(); //DrawBuf();
@ -296,7 +287,7 @@ int printLoadingBar(const char* msg, const f32 percent) {
int printEndSuccess(const char* msg) { int printEndSuccess(const char* msg) {
int i; int i;
PauseThread(); //PauseThread();
GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, HEX_WHITE); GRRLIB_DrawImg(0, 0, tex_background_png, 0, 1, 1, HEX_WHITE);
GRRLIB_DrawImg(256, 112, tex_Checkicon_png, 0, 1, 1, HEX_WHITE); GRRLIB_DrawImg(256, 112, tex_Checkicon_png, 0, 1, 1, HEX_WHITE);

View File

@ -2,7 +2,6 @@
#include <unistd.h> #include <unistd.h>
#include <ogc/lwp_watchdog.h> #include <ogc/lwp_watchdog.h>
#include <ogc/lwp.h> #include <ogc/lwp.h>
#include <ogc/mutex.h>
#include "thread.h" #include "thread.h"
#include "gui.h" #include "gui.h"
@ -33,7 +32,7 @@ void * DrawCogThread(void *arg) {
inline void InitThread(void) { inline void InitThread(void) {
memset (&stack, 0, STACKSIZE); memset (&stack, 0, STACKSIZE);
LWP_CreateThread (&Cog_Thread, DrawCogThread, NULL, stack, STACKSIZE, PRIORITY); LWP_CreateThread (&Cog_Thread, DrawCogThread, NULL, stack, STACKSIZE, PRIORITY);
//usleep(200); usleep(200);
} }
inline s32 PauseThread(void) { inline s32 PauseThread(void) {