void ShmupStage::Resume() { switch( stageFlag ) { case 0: stageFlag = 1; gameStack->Push( (Stage*)(new Splash3Stage()) ); break; case 1: stageFlag = 2; //gameStack->Push( (Stage*)(new Splash3Stage()) ); Craft* tmpPlayer; tmpPlayer = new Craft( (char*)curGame->CraftConfigs->ItemAt( 0 ) ); tmpPlayer->CraftFacing = FACING_RIGHT; tmpPlayer->PositionX = 40; tmpPlayer->PositionY = 200; tmpPlayer->ShieldUpgrades = 1; curGame->SetPlayer( (Craft*)tmpPlayer ); SlotIdx[0] = 1; SlotIdx[1] = 0; SlotIdx[2] = 0; curGame->Player->LoadWeapon( 0, new Weapon( (char*)curGame->WeaponConfigs->ItemAt( 0 ) ) ); curGame->LoadLevel( 0, true ); curGame->State = GAME_STATE_INGAME; font = spFontLoad( "resource/standard.ttf", 17 * spGetSizeFactor() >> SP_ACCURACY ); spFontAdd( font, SP_FONT_GROUP_ASCII, 0 ); //whole ASCII spFontAddBorder( font, 65535 ); break; } }
void resize( Uint16 w, Uint16 h ) { #if defined ZOOMUP || defined ZOOMDOWN #if defined ZOOMUP && defined ZOOMDOWN if (dummy_screen) spDeleteSurface(dummy_screen); #ifdef FIRSTUP dummy_screen = spCreateSurface(screen->w*2,screen->h*2); #else dummy_screen = spCreateSurface(screen->w/2,screen->h/2); #endif #else if (screen) spDeleteSurface(screen); #ifdef ZOOMUP screen = spCreateSurface(real_screen->w/2,real_screen->h/2); #else screen = spCreateSurface(real_screen->w*2,real_screen->h*2); #endif #endif #endif spSelectRenderTarget(screen); //Font Loading if ( font ) spFontDelete( font ); int zoom = spMin( ( screen->w << SP_ACCURACY ) / 320, ( screen->h << SP_ACCURACY ) / 240 ); //at 320x240 == 1.0 font = spFontLoad( "./font/LiberationMono-Regular.ttf", 10 * zoom >> SP_ACCURACY ); spFontAdd( font,SP_FONT_GROUP_ASCII, 0 ); //Just for debug stuff spFontAddBorder( font, spGetFastRGB(127,127,127) ); }
void resize(Uint16 w,Uint16 h) { //Font Loading if ( font ) spFontDelete( font ); font = spFontLoad( "./font/StayPuft.ttf", 17 * spGetSizeFactor() >> SP_ACCURACY ); spFontAdd( font, SP_FONT_GROUP_ASCII, 0 ); //whole ASCII spFontAddBorder( font, 65535 ); spFontAddButton( font, 'A', SP_BUTTON_A_NAME, 65535, spGetRGB( 64, 64, 64 ) ); spFontAddButton( font, 'B', SP_BUTTON_B_NAME, 65535, spGetRGB( 64, 64, 64 ) ); spFontAddButton( font, 'X', SP_BUTTON_X_NAME, 65535, spGetRGB( 64, 64, 64 ) ); spFontAddButton( font, 'Y', SP_BUTTON_Y_NAME, 65535, spGetRGB( 64, 64, 64 ) ); spFontAddButton( font, 'L', SP_BUTTON_L_NAME, 65535, spGetRGB( 64, 64, 64 ) ); spFontAddButton( font, 'R', SP_BUTTON_R_NAME, 65535, spGetRGB( 64, 64, 64 ) ); spFontAddButton( font, 'S', SP_BUTTON_START_NAME, 65535, spGetRGB( 64, 64, 64 ) ); spFontAddButton( font, 'E', SP_BUTTON_SELECT_NAME, 65535, spGetRGB( 64, 64, 64 ) ); }
void resize(Uint16 w,Uint16 h) { //Setup of the new/resized window spSelectRenderTarget(spGetWindowSurface()); spSetPerspective(50.0,(float)spGetWindowSurface()->w/(float)spGetWindowSurface()->h,1.0,100); spBundlePointer translation = settings_get_translation(); spFontShadeButtons(1); //Font Loading spFontSetShadeColor(FONT_BORDER_1); if (font) spFontDelete(font); font = spFontLoad(FONT_LOCATION,FONT_SIZE*spGetSizeFactor()>>SP_ACCURACY); spFontAdd(font,SP_FONT_GROUP_ASCII,FONT_COLOR_1);//whole ASCII spFontAddEveryLetterOfTextBundle(font,translation,FONT_COLOR_1); spFontAddBorder(font,FONT_BORDER_1); spFontMulWidth(font,15<<SP_ACCURACY-4); spFontAddButton( font, 'A', SP_BUTTON_LEFT_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( font, 'B', SP_BUTTON_RIGHT_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( font, 'X', SP_BUTTON_DOWN_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( font, 'Y', SP_BUTTON_UP_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( font, 'L', SP_BUTTON_L_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( font, 'R', SP_BUTTON_R_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( font, 'S', SP_BUTTON_START_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( font, 'E', SP_BUTTON_SELECT_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); settings_set_font(font); spFontSetShadeColor(FONT_BORDER_2); if (small_font) spFontDelete(small_font); small_font = spFontLoad(FONT_LOCATION,FONT_SMALL_SIZE*spGetSizeFactor()>>SP_ACCURACY); spFontAdd(small_font,SP_FONT_GROUP_ASCII,FONT_COLOR_2);//whole ASCII //spFontAdd(small_font,SP_FONT_GROUP_GERMAN,0);//some German letters spFontAddEveryLetterOfTextBundle(small_font,translation,FONT_COLOR_2); spFontAddBorder(small_font,FONT_BORDER_2); spFontMulWidth(small_font,15<<SP_ACCURACY-4); spFontAddButton( small_font, 'A', SP_BUTTON_LEFT_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( small_font, 'B', SP_BUTTON_RIGHT_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( small_font, 'X', SP_BUTTON_DOWN_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( small_font, 'Y', SP_BUTTON_UP_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( small_font, 'L', SP_BUTTON_L_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( small_font, 'R', SP_BUTTON_R_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( small_font, 'S', SP_BUTTON_START_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( small_font, 'E', SP_BUTTON_SELECT_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); settings_set_small_font(small_font); spFontSetShadeColor(FONT_BORDER_1); if (middle_font) spFontDelete(middle_font); middle_font = spFontLoad(FONT_LOCATION,FONT_MIDDLE_SIZE*spGetSizeFactor()>>SP_ACCURACY); spFontAdd(middle_font,SP_FONT_GROUP_ASCII,FONT_COLOR_1);//whole ASCII //spFontAdd(middle_font,SP_FONT_GROUP_GERMAN,0);//some German letters spFontAddEveryLetterOfTextBundle(middle_font,translation,FONT_COLOR_1); spFontAddBorder(middle_font,FONT_BORDER_1); spFontMulWidth(middle_font,15<<SP_ACCURACY-4); spFontAddButton( middle_font, 'A', SP_BUTTON_LEFT_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( middle_font, 'B', SP_BUTTON_RIGHT_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( middle_font, 'X', SP_BUTTON_DOWN_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( middle_font, 'Y', SP_BUTTON_UP_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( middle_font, 'L', SP_BUTTON_L_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( middle_font, 'R', SP_BUTTON_R_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( middle_font, 'S', SP_BUTTON_START_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); spFontAddButton( middle_font, 'E', SP_BUTTON_SELECT_NAME, spGetRGB(230,230,230), spGetRGB(64,64,64)); settings_set_middle_font(middle_font); spFontSetShadeColor(FONT_BORDER_1); if (countdown_font) spFontDelete(countdown_font); countdown_font = spFontLoad(FONT_LOCATION,FONT_COUNTDOWN_SIZE*spGetSizeFactor()>>SP_ACCURACY); spFontAdd(countdown_font,"0123",FONT_COLOR_1); spFontAddBorder(countdown_font,FONT_BORDER_1); settings_set_countdown_font(countdown_font); spFontSetShadeColor(FONT_BORDER_1); if (highscore_font) spFontDelete(highscore_font); highscore_font = spFontLoad(FONT_LOCATION,FONT_HIGHSCORE_SIZE*spGetSizeFactor()>>SP_ACCURACY); spFontAdd(highscore_font,"ABCDEFGHIJKLMNOPQRSTUVWXYZ",FONT_COLOR_1); spFontAddBorder(highscore_font,FONT_BORDER_1); settings_set_highscore_font(highscore_font); //Particles resize_particle(w,h); init_stars(); }