Skip to content

Commit

Permalink
Loading Screen with ellipse
Browse files Browse the repository at this point in the history
  • Loading branch information
krazynez committed Jul 21, 2023
1 parent 2b367ae commit 3cbcf95
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions extras/menus/xMenu/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,34 @@ PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);

using namespace std;

std::string startup_txt = "Starting Menu";
string startup_txt = "Loading ";

static uint8_t dots = 0;

static volatile bool loading = true;

int startup_thread(int argc, void* argp){
int i;
std::stringstream startup_holder;
stringstream startup_runner;
for(i=0;i<startup_txt.length();i++) {
startup_holder << startup_txt[i];
debugScreen(startup_holder.str().c_str(), 180, 130);
sceKernelDelayThread(15000);
//void printText(float x, float y, const char *text, u32 color = WHITE_COLOR);
startup_runner << startup_txt[i];
// debugScreen(startup_runner.str().c_str(), 180, 130);
// sceKernelDelayThread(15000);
}


while (loading){
startup_holder << ".";
debugScreen(startup_holder.str().c_str(), 180, 130);
sceKernelDelayThread(10000);
debugScreen(startup_runner.str().c_str(), 180, 130);
if(dots>3) {
startup_runner.str(startup_txt);
dots=0;
}
else {
startup_runner.str(startup_txt + string(dots, '.'));
}
dots++;
sceKernelDelayThread(100000);
}

return 0;
Expand Down Expand Up @@ -82,6 +93,7 @@ int main(int argc, char** argv){
initGraphics();
common::loadData();

sceKernelDelayThread(1000000);
loading = false;
sceKernelWaitThreadEnd(thid, NULL);
sceKernelDeleteThread(thid);
Expand Down

0 comments on commit 3cbcf95

Please sign in to comment.