mirror of
https://github.com/retro100/dosbox-wii.git
synced 2025-02-28 15:53:42 +01:00
Using menu thread for showing credits. No extra thread is used.
This commit is contained in:
parent
44c2afc9ae
commit
21c2645ed0
@ -37,10 +37,8 @@ static GuiWindow * mainWindow = NULL;
|
|||||||
static GuiButton * logoBtn = NULL;
|
static GuiButton * logoBtn = NULL;
|
||||||
|
|
||||||
static lwp_t guithread = LWP_THREAD_NULL;
|
static lwp_t guithread = LWP_THREAD_NULL;
|
||||||
static lwp_t creditsthread = LWP_THREAD_NULL;
|
|
||||||
static bool guiHalt = true;
|
static bool guiHalt = true;
|
||||||
static bool ExitRequested = false;
|
static bool ExitRequested = false;
|
||||||
static bool creditsOpen = false;
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* UpdateGUI
|
* UpdateGUI
|
||||||
@ -72,12 +70,6 @@ static void * UpdateGUI (void *arg)
|
|||||||
for(i=3; i >= 0; i--)
|
for(i=3; i >= 0; i--)
|
||||||
mainWindow->Update(&userInput[i]);
|
mainWindow->Update(&userInput[i]);
|
||||||
|
|
||||||
if(!creditsOpen && creditsthread != LWP_THREAD_NULL)
|
|
||||||
{
|
|
||||||
LWP_JoinThread(creditsthread, NULL);
|
|
||||||
creditsthread = LWP_THREAD_NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ExitRequested)
|
if(ExitRequested)
|
||||||
{
|
{
|
||||||
for(i = 0; i <= 255; i += 15)
|
for(i = 0; i <= 255; i += 15)
|
||||||
@ -293,7 +285,7 @@ static void OnScreenKeyboard(char * var, u32 maxlen)
|
|||||||
*
|
*
|
||||||
* THIS MUST NOT BE REMOVED OR DISABLED IN ANY DERIVATIVE WORK
|
* THIS MUST NOT BE REMOVED OR DISABLED IN ANY DERIVATIVE WORK
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
static void * WindowCredits(void *arg)
|
static void WindowCredits()
|
||||||
{
|
{
|
||||||
bool exit = false;
|
bool exit = false;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -372,21 +364,6 @@ static void * WindowCredits(void *arg)
|
|||||||
|
|
||||||
for(i=0; i < numEntries; i++)
|
for(i=0; i < numEntries; i++)
|
||||||
delete txt[i];
|
delete txt[i];
|
||||||
creditsOpen = false;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void DisplayCredits(void * ptr)
|
|
||||||
{
|
|
||||||
if(logoBtn->GetState() != STATE_CLICKED)
|
|
||||||
return;
|
|
||||||
|
|
||||||
logoBtn->ResetState();
|
|
||||||
|
|
||||||
// spawn a new thread to handle the Credits
|
|
||||||
creditsOpen = true;
|
|
||||||
if(creditsthread == LWP_THREAD_NULL)
|
|
||||||
LWP_CreateThread (&creditsthread, WindowCredits, NULL, NULL, 0, 60);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void updateCyclesText(GuiText * cycleText)
|
static void updateCyclesText(GuiText * cycleText)
|
||||||
@ -468,7 +445,6 @@ void HomeMenu ()
|
|||||||
logoBtn->SetSoundOver(&btnSoundOver);
|
logoBtn->SetSoundOver(&btnSoundOver);
|
||||||
logoBtn->SetSoundClick(&btnSoundClick);
|
logoBtn->SetSoundClick(&btnSoundClick);
|
||||||
logoBtn->SetTrigger(&trigA);
|
logoBtn->SetTrigger(&trigA);
|
||||||
logoBtn->SetUpdateCallback(DisplayCredits);
|
|
||||||
|
|
||||||
GuiText cycleText(NULL, 20, (GXColor){255, 255, 255, 255});
|
GuiText cycleText(NULL, 20, (GXColor){255, 255, 255, 255});
|
||||||
cycleText.SetPosition(-215, -180);
|
cycleText.SetPosition(-215, -180);
|
||||||
@ -774,6 +750,11 @@ void HomeMenu ()
|
|||||||
MENU_IncreaseOrDecreaseFrameSkip(true);
|
MENU_IncreaseOrDecreaseFrameSkip(true);
|
||||||
updateFskipText(&fskipText);
|
updateFskipText(&fskipText);
|
||||||
}
|
}
|
||||||
|
else if (logoBtn->GetState() == STATE_CLICKED)
|
||||||
|
{
|
||||||
|
logoBtn->ResetState();
|
||||||
|
WindowCredits();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ShutoffRumble();
|
ShutoffRumble();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user