void GameEnd(void) { _tty_under_water = 1; _fade_edges = 1; SwapScreens(1); LoadScreen("end"); SwapScreens(0); Tty("SPACE PLUMBER MISSION REPORT\a\n\n" "ALL LEVELS HAS BEEN SECURED.\a\n" "PRESSURE SYSTEM RESTARTED.\a\n" "AQUA ENTERPRISES, INC. MAIN\n" "PLANT IS AGAIN FULLY FUNCTIONAL.\a\n\n" "WHAT ABOUT SOME DAYS OF VACATION?\n"); qdgdfv_clear_virtual_screen(); Tty("RESPONSE FROM HIGH COMMAND\a\n\n" "CONGRATULATIONS.\a\n\n" "VACATION REQUESTS MUST BE MADE\n" "BY FILLING THE FORM TT-243/F.\a\n" "THIS FORM IS UNAVAILABLE FOR NOW.\a\n\n" "END OF TRANSMISSION.\n"); _level_resolved = 0; _last_level_resolved = 0; }
void DanaeRestoreFullScreen() { MenuReInitAll(); AdjustUI(); LoadScreen(); }
bool Game::Run() { SplashScreen(); LoadScreen(); Initialize(); _currentState=_pMenu; //_currentState = new Level1(_rWindow,_rSfmlDebugDraw,_pWorld,score); LoadContent(); Clock timeElapsed; while ( _rWindow.isOpen() ) { _rWindow.pollEvent(e); if ( e.type == Event::Closed ) { _rWindow.close(); UnloadContent(); break; } if(e.type==Event::KeyPressed) { if(Keyboard::isKeyPressed(Keyboard::LAlt) && Keyboard::isKeyPressed(Keyboard::F4)) { _rWindow.close(); UnloadContent(); break; } } HandleInput( e ); //Time lastUpdateCall = timeElapsed.restart(); if ( timeElapsed.getElapsedTime().asMilliseconds() >= timeStep) { Update( e, oldEvent, timeElapsed.restart() ); } Time lastDrawCall = /*lastUpdateCall +*/ timeElapsed.getElapsedTime(); //.restart(); Draw( _rWindow, lastDrawCall ); oldEvent = e; } return true; }
void runloadscreen(){ Display d=newDisplay(); startFrame(d); LoadScreen(d); quit(d); }
void Help(void) { LoadScreen("help"); for (;;) { qdgdfv_dump_virtual_screen(); qdgdfv_input_poll(); if (_qdgdfv_key_escape || _qdgdfv_key_enter) break; } while (_qdgdfv_key_escape || _qdgdfv_key_enter) qdgdfv_input_poll(); }
int MakeGraphFromScreen(void) { GUINITCHECK; DXPGRAPHICSHANDLE *gptr = dxpGraphicsCreateGraphicHandle(); if ( !gptr ) return -1; DXPTEXTURE3 *texptr = LoadScreen(); if ( !texptr ) { dxpGraphicsReleseGraphicHandle(gptr); return -1; } gptr->tex = texptr; ++texptr->refcount; gptr->u0 = gptr->v0 = 0; gptr->u1 = texptr->umax; gptr->v1 = texptr->vmax; if ( dxpGraphicsData.create_vram_graph ) MoveGraphToVRAM( gptr->handle ); if ( dxpGraphicsData.create_swizzled_graph ) SwizzleGraph( gptr->handle ); sceKernelDcacheWritebackAll(); return gptr->handle; }
/* ================ ParseScript ================ */ void ParseScript (void) { int cmd; int size; fTransparent255 = false; do { // // get a command / lump name // GetToken (true); if (endofscript) break; if (!Q_strcasecmp (token,"$LOAD")) { GetToken (false); LoadScreen (token); continue; } if (!Q_strcasecmp (token,"$DEST")) { GetToken (false); strcpy (destfile, token); continue; } if (!Q_strcasecmp (token,"$SINGLEDEST")) { GetToken (false); strcpy (destfile, token); savesingle = true; continue; } if (!Q_strcasecmp (token,"$LOADBMP")) { GetToken (false); fTransparent255 = false; LoadScreenBMP (token); continue; } // // new lump // if (strlen(token) >= sizeof(lumpname) ) Error ("\"%s\" is too long to be a lump name",token); memset (lumpname,0,sizeof(lumpname)); strcpy (lumpname, token); for (size=0 ; size<sizeof(lumpname) ; size++) lumpname[size] = tolower(lumpname[size]); // // get the grab command // lump_p = lumpbuffer; GetToken (false); // // call a routine to grab some data and put it in lumpbuffer // with lump_p pointing after the last byte to be saved // for (cmd=0 ; commands[cmd].name ; cmd++) if ( !Q_strcasecmp(token,commands[cmd].name) ) { commands[cmd].function (); break; } if ( !commands[cmd].name ) Error ("Unrecognized token '%s' at line %i",token,scriptline); grabbed++; if (savesingle) WriteFile (); else WriteLump (TYP_LUMPY+cmd, 0); } while (!endofscript); }
int Menu(void) { int up, down; int menu_opt = 0; if (_menu_mask == NULL) _menu_mask = qdgdfv_malloc(SCREEN_X_SIZE * SCREEN_Y_SIZE); _text_mask_x = -1; up = down = 0; qdgdfv_clear_virtual_screen(); qdgdfv_load_pcx((unsigned char *) _menu_mask, "graph/menu.pcx", SCREEN_X_SIZE * SCREEN_Y_SIZE); SwapScreens(1); LoadScreen("wmenu"); SwapScreens(0); qdgdfv_load_pcx((unsigned char *) cursor, "graph/cursor.pcx", CURSOR_SIZE); for (;;) { DrawWaterVirtualScreen(); DrawMenu(menu_opt); qdgdfv_dump_virtual_screen(); qdgdfv_input_poll(); if (_qdgdfv_key_up) { down = 0; if (up == 0) { up = 1; menu_opt--; if (menu_opt == -1) menu_opt = 4; } } else up = 0; if (_qdgdfv_key_down) { up = 0; if (down == 0) { down = 1; menu_opt++; if (menu_opt == 5) menu_opt = 0; } } else down = 0; if (_qdgdfv_key_escape) { menu_opt = -1; break; } if (_qdgdfv_key_enter) break; } /* wait until no key is pressed */ while (_qdgdfv_key_escape || _qdgdfv_key_enter || _qdgdfv_key_up || _qdgdfv_key_down) qdgdfv_input_poll(); return (menu_opt); }
void Intro(void) /* intro */ { time_t t; music = qdgdfa_load_sound("sound/holst.wav"); qdgdfa_play_sound(music, 1); LoadScreen("aolabs"); for (t = time(NULL); t + 10 > time(NULL);) { qdgdfv_dump_virtual_screen(); qdgdfv_input_poll(); if (_qdgdfv_key_escape) { while (_qdgdfv_key_escape) qdgdfv_input_poll(); return; } if (_qdgdfv_key_enter) { while (_qdgdfv_key_enter) qdgdfv_input_poll(); return; } } qdgdfv_clear_virtual_screen(); qdgdfv_dump_virtual_screen(); SwapScreens(1); LoadScreen("logo"); SwapScreens(0); for (t = time(NULL); t + 15 > time(NULL);) { DrawWaterVirtualScreen(); qdgdfv_dump_virtual_screen(); qdgdfv_input_poll(); if (_qdgdfv_key_escape) { while (_qdgdfv_key_escape) qdgdfv_input_poll(); return; } if (_qdgdfv_key_enter) { while (_qdgdfv_key_enter) qdgdfv_input_poll(); return; } } LoadScreen("planet"); if (!Tty ("SPACE PLUMBER MISSION BRIEFING\n\n\nPLANET: X-239-LQ (TSUNAMI XXVI)\a\nSURFACE: 100% WATER\a\n" "RESOURCES: URANIUM AND THALIUM\a\nEXPLOITED BY:\n" " 98% AQUA ENTERPRISES, INC.\n 02% OTHER COMPANIES.\n")) return; LoadScreen("planet"); Tty("PROBLEM DESCRIPTION:\a\n MAIN PROCESSING PLANT\n" " PRESSURE SYSTEM MALFUNCTION.\a\n" " ALL TECHNICIANS EVACUATED.\a\n\n" "MISSION: ACTIVATE ALL WATER\n" " EXTRACTION PUMPS.\a\n" " DEACTIVATE SECURITY CONSOLES\n" " WHERE AVAILABLE.\n"); }
void Game::HandleState(State::LevelState lState) { if(lState==State::Complete) { if(stateName==GameState::ScoreBoard)//ScoreBoard will always return completed { stateName=GameState::Menu; if(_pcurLevel!=NULL) { _pcurLevel->UnloadContent(); delete _pcurLevel; } _pcurLevel=NULL; } else if(stateName==Menu)//Menu will return completed when new game is selected { if(_pcurLevel!=NULL) { _pcurLevel->UnloadContent(); delete _pcurLevel; } _pcurLevel=NULL; score=new Score(_rWindow,_rSfmlDebugDraw,_pWorld); // Initializing new score stateName=(GameState)(stateName+1); } else { stateName=(GameState)(stateName+1); if(_currentState==(State*)_pcurLevel) _pcurLevel=NULL; _currentState->UnloadContent(); delete _currentState; } switch(stateName) { case(Menu): _currentState=_pMenu; _pMenu->SetMenuState(1); // Argument(1) For New Menu ... break; case(Level_1): LoadScreen(); _currentState=new Level1(_rWindow,_rSfmlDebugDraw,_pWorld,score); _currentState->LoadContent(); break; //case(Level_2) : // _currentState = new Level2(_rWindow, _rSfmlDebugDraw, _pWorld, score); // _currentState->LoadContent(); // break; case(ScoreBoard): _currentState=score; _currentState->LoadContent(); break; } } else if(lState==State::Paused) { if(stateName==GameState::Level_1) { LevelNo=Level_1; _pcurLevel=_currentState; stateName=GameState::Menu; _currentState=_pMenu; _pMenu->SetMenuState(0);// Paused Menu _pcurLevel->ResetLevelState(); } //if (stateName == GameState::Level_2) //{ // LevelNo = Level_2; // _pcurLevel = _currentState; // stateName = GameState::Menu; // _currentState = _pMenu; // _pMenu->SetMenuState(0);// Paused Menu // _pcurLevel->ResetLevelState(); //} } else if(lState==State::Playing) { if(stateName==Menu) { stateName=LevelNo; _currentState=_pcurLevel; } } else if(lState==State::Lost) { if(stateName==GameState::Menu)//Menu will return lost when Exit is pressed { stateName=GameState::Exit; ExitScreen(); } else { stateName=GameState::ScoreBoard; _currentState=score; _currentState->LoadContent(); } } }
BOOL DumpImage(HDC hScreen, HBITMAP hBitmap, int anX, int anY, int anWidth, int anHeight, LPCWSTR pszFile, bool PreserveTransparency/*=true*/) { BOOL lbRc = FALSE; LPBYTE pScreen = NULL; DWORD cbOut = 0; wchar_t* pszDot = NULL; wchar_t szFile[MAX_PATH+1] = {}; if (pszFile) { lstrcpynW(szFile, pszFile, MAX_PATH); pszDot = (wchar_t*)PointToExt(szFile); } #ifdef PNGDUMP // Если передали готовый hBitmap - сохранить сразу if (pszDot) lstrcpyW(pszDot, L".png"); if (hBitmap && SaveImageEx(szFile, hBitmap)) { return TRUE; } #endif // иначе - снять копию с hScreen if (!LoadScreen(hScreen, anX, anY, anWidth, anHeight, &pScreen, &cbOut, PreserveTransparency)) return FALSE; if (!*szFile) { //static wchar_t szLastDumpFile[MAX_PATH]; SYSTEMTIME st; GetLocalTime(&st); _wsprintf(szFile, SKIPLEN(countof(szFile)) L"%02u%02u%02u%02u%02u%02u", st.wYear%100, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond); OPENFILENAME ofn; memset(&ofn,0,sizeof(ofn)); ofn.lStructSize=sizeof(ofn); HWND h = GetForegroundWindow(); DWORD nPID = 0; if (h) GetWindowThreadProcessId(h, &nPID); ofn.hwndOwner = (nPID == GetCurrentProcessId()) ? h : ghWnd; #ifdef PNGDUMP ofn.lpstrFilter = L"PNG (*.png)\0*.png\0JPEG (*.jpg)\0*.jpg\0BMP (*.bmp)\0*.bmp\0\0"; ofn.lpstrDefExt = L"png"; #else ofn.lpstrFilter = L"BMP (*.bmp)\0*.bmp\0\0"; ofn.lpstrDefExt = L"bmp"; #endif ofn.nFilterIndex = 1; ofn.lpstrFile = szFile; ofn.nMaxFile = countof(szFile); ofn.lpstrTitle = L"Save screenshot"; ofn.Flags = OFN_ENABLESIZING|OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST|OFN_EXPLORER|OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT; if (!GetSaveFileName(&ofn) || ((pszDot = (wchar_t*)PointToExt(szFile)) == NULL)) { lbRc = TRUE; // чтобы не ругалось... goto wrap; } //wcscpy_c(szFile, szLastDumpFile); } #ifdef PNGDUMP if (SaveImageEx(szFile, pScreen, cbOut)) { lbRc = TRUE; goto wrap; } #endif if (pScreen && cbOut) { if (pszDot) { #ifdef PNGDUMP lstrcpyW(pszDot, L".png"); #else lstrcpyW(pszDot, L".bmp"); #endif HANDLE hFile = CreateFile(szFile, GENERIC_WRITE, FILE_SHARE_READ, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (hFile != INVALID_HANDLE_VALUE) { DWORD dwWritten = 0; lbRc = WriteFile(hFile, pScreen, cbOut, &dwWritten, 0); CloseHandle(hFile); } } } wrap: SafeFree(pScreen); return lbRc; }
int main( int argc, char **argv) { // defaultExceptionHandler(); if (fatInitDefault()) { fifoWaitValue32(FIFO_USER_02); if (fifoGetValue32(FIFO_USER_01) == 0) { int size = 32; FILE* ResetData = fopen("sd:/hiya/ResetData.bin","rb"); fread((void*)0x02000300,1,size,ResetData); fclose(ResetData); fifoSendValue32(FIFO_USER_08, 1); for (int i = 0; i < 5; i++) { swiWaitForVBlank(); } } LoadSettings(); bool gotoSettings = false; if (access("sd:/hiya/settings.ini", F_OK)) { gotoSettings = true; } scanKeys(); if(keysHeld() & KEY_SELECT) gotoSettings = true; if(gotoSettings) { // Subscreen as a console videoSetMode(MODE_0_2D); vramSetBankG(VRAM_G_MAIN_BG); videoSetModeSub(MODE_0_2D); vramSetBankH(VRAM_H_SUB_BG); int pressed = 0; bool menuprinted = true; while(1) { if(menuprinted) { consoleInit(NULL, 0, BgType_Text4bpp, BgSize_T_256x256, 15, 0, true, true); consoleClear(); printf("HiyaCFW v1.0 configuration\n"); printf("Press A to select, START to save"); printf("\n"); if(cursorPosition == 0) printf(">"); else printf(" "); printf("Splash: "); if(splash) printf("Off( ), On(x)"); else printf("Off(x), On( )"); printf("\n\n"); if(cursorPosition == 1) printf(">"); else printf(" "); if(dsiSplash) printf("(x)"); else printf("( )"); printf(" DSi Splash/H&S screen"); consoleInit(NULL, 1, BgType_Text4bpp, BgSize_T_256x256, 15, 0, false, true); consoleClear(); if(cursorPosition == 0) { printf("Enable splash screen."); } else if(cursorPosition == 1) { printf("Enable showing the DSi Splash/\n"); printf("Health & Safety screen."); } menuprinted = false; } do { scanKeys(); pressed = keysDownRepeat(); swiWaitForVBlank(); } while (!pressed); if (pressed & KEY_A) { switch(cursorPosition){ case 0: default: splash = !splash; break; case 1: dsiSplash = !dsiSplash; break; } menuprinted = true; } if (pressed & KEY_UP) { cursorPosition -= 1; menuprinted = true; } else if (pressed & KEY_DOWN) { cursorPosition += 1; menuprinted = true; } if (cursorPosition < 0) cursorPosition = 1; if (cursorPosition > 1) cursorPosition = 0; if (pressed & KEY_START) { SaveSettings(); break; } } } if(dsiSplash) fifoSendValue32(FIFO_USER_03, 1); if(splash) { BootSplashInit(); LoadScreen(); for (int i = 0; i < 60*3; i++) { swiWaitForVBlank(); } } runNdsFile("/BOOTLOADER.NDS", 0, NULL); } else { BootSplashInit(); // Display Error Screen swiDecompressLZSSVram ((void*)topErrorTiles, (void*)CHAR_BASE_BLOCK(2), 0, &decompressBiosCallback); swiDecompressLZSSVram ((void*)subErrorTiles, (void*)CHAR_BASE_BLOCK_SUB(2), 0, &decompressBiosCallback); vramcpy_ui (&BG_PALETTE[0], topErrorPal, topErrorPalLen); vramcpy_ui (&BG_PALETTE_SUB[0], subErrorPal, subErrorPalLen); } while(1) { swiWaitForVBlank(); } }