From 0c7ac826c336797590f0097d607d4784c97fe230 Mon Sep 17 00:00:00 2001
From: dimok321 <15055714+dimok789@users.noreply.github.com>
Date: Sat, 17 Oct 2009 22:50:42 +0000
Subject: [PATCH] Optimization Changes Part 2:
A few corrections to the changes in part 1:
*clock fix
*progressbar fix for language update
*GX DrawDone() changed
---
gui.pnproj | 2 +-
source/FreeTypeGX.cpp | 2 --
source/libwiigui/gui.h | 1 +
source/menu.cpp | 5 ++++-
source/prompts/ProgressWindow.cpp | 1 +
source/video.cpp | 2 +-
6 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/gui.pnproj b/gui.pnproj
index 607c3d56..474de74a 100644
--- a/gui.pnproj
+++ b/gui.pnproj
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/source/FreeTypeGX.cpp b/source/FreeTypeGX.cpp
index 55e0e8ff..fa190e53 100644
--- a/source/FreeTypeGX.cpp
+++ b/source/FreeTypeGX.cpp
@@ -746,7 +746,6 @@ void FreeTypeGX::copyTextureToFramebuffer(GXTexObj *texObj, f32 texWidth, f32 te
GX_Color4u8(color.r, color.g, color.b, color.a);
GX_TexCoord2f32(0.0f, 1.0f);
GX_End();
- GX_DrawDone();
this->setDefaultMode();
}
@@ -780,7 +779,6 @@ void FreeTypeGX::copyFeatureToFramebuffer(f32 featureWidth, f32 featureHeight, i
GX_Position2s16(screenX, featureHeight + screenY);
GX_Color4u8(color.r, color.g, color.b, color.a);
GX_End();
- GX_DrawDone();
this->setDefaultMode();
}
diff --git a/source/libwiigui/gui.h b/source/libwiigui/gui.h
index f5ed53be..c8062616 100644
--- a/source/libwiigui/gui.h
+++ b/source/libwiigui/gui.h
@@ -93,6 +93,7 @@ enum
enum
{
+ NONE,
WRAP,
LONGTEXT,
DOTTED,
diff --git a/source/menu.cpp b/source/menu.cpp
index be540a57..7b175588 100644
--- a/source/menu.cpp
+++ b/source/menu.cpp
@@ -329,6 +329,7 @@ int MenuDiscList() {
int dataed = -1;
int cosa=0,sina=0;
int selectImg1 = 0;
+ bool firstRun = true;
char ID[4];
char IDfull[7];
u32 covert = 0;
@@ -892,8 +893,10 @@ int MenuDiscList() {
}
//CLOCK update every 10 secs
- if(frameCount % (60*10))
+ if(frameCount % 600 == 0 || firstRun)
{
+ firstRun = false;
+
time_t rawtime = time(0); //this fixes code dump caused by the clock
if (((Settings.hddinfo == hr12)||(Settings.hddinfo == hr24)) && rawtime != lastrawtime) {
lastrawtime = rawtime;
diff --git a/source/prompts/ProgressWindow.cpp b/source/prompts/ProgressWindow.cpp
index 0358aac8..344ea443 100644
--- a/source/prompts/ProgressWindow.cpp
+++ b/source/prompts/ProgressWindow.cpp
@@ -386,6 +386,7 @@ void ShowProgress(const char *title, const char *msg1, char *dynmsg2, f32 done,
showProgress = 1;
progressDone = 100.0*done/total;
+ changed = true;
LWP_ResumeThread(progressthread);
}
diff --git a/source/video.cpp b/source/video.cpp
index 4f549012..45f99381 100644
--- a/source/video.cpp
+++ b/source/video.cpp
@@ -218,12 +218,12 @@ void StopGX() {
* Renders everything current sent to GX, and flushes video
***************************************************************************/
void Menu_Render() {
- GX_DrawDone ();
whichfb ^= 1; // flip framebuffer
GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
GX_SetColorUpdate(GX_TRUE);
GX_CopyDisp(xfb[whichfb],GX_TRUE);
+ GX_DrawDone ();
VIDEO_SetNextFramebuffer(xfb[whichfb]);
VIDEO_Flush();
VIDEO_WaitVSync();