void LifeMeterTime::Load( const PlayerState *pPlayerState, PlayerStageStats *pPlayerStageStats ) { LifeMeter::Load( pPlayerState, pPlayerStageStats ); const RString sType = "LifeMeterTime"; m_sprBackground.Load( THEME->GetPathG(sType,"background") ); m_sprBackground->SetName( "Background" ); m_sprBackground->ZoomToWidth( METER_WIDTH ); m_sprBackground->ZoomToHeight( METER_HEIGHT ); this->AddChild( m_sprBackground ); m_quadDangerGlow.ZoomToWidth( METER_WIDTH ); m_quadDangerGlow.ZoomToHeight( METER_HEIGHT ); // hardcoded effects... m_quadDangerGlow.SetEffectDiffuseShift(); m_quadDangerGlow.SetEffectColor1( RageColor(1,0,0,0.8f) ); m_quadDangerGlow.SetEffectColor2( RageColor(1,0,0,0) ); m_quadDangerGlow.SetEffectClock( Actor::CLOCK_BGM_BEAT ); this->AddChild( &m_quadDangerGlow ); m_pStream = new StreamDisplay; bool bExtra = GAMESTATE->IsAnExtraStage(); m_pStream->Load( bExtra ? "StreamDisplayExtra" : "StreamDisplay" ); this->AddChild( m_pStream ); RString sExtra = bExtra ? "extra " : ""; m_sprFrame.Load( THEME->GetPathG(sType,sExtra+"frame") ); m_sprFrame->SetName( "Frame" ); this->AddChild( m_sprFrame ); m_soundGainLife.Load( THEME->GetPathS(sType,"GainLife") ); }
void ScreenPlayerOptions::HandleScreenMessage( const ScreenMessage SM ) { if( m_bAskOptionsMessage ) { switch( SM ) { case SM_BeginFadingOut: // when the user accepts the page of options { m_bAcceptedChoices = true; float fShowSeconds = m_Out.GetLengthSeconds(); // show "hold START for options" m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); m_sprOptionsMessage.BeginTweening( 0.15f ); // fade in m_sprOptionsMessage.SetZoomY( 1 ); m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,1) ); m_sprOptionsMessage.BeginTweening( fShowSeconds-0.3f ); // sleep m_sprOptionsMessage.BeginTweening( 0.15f ); // fade out m_sprOptionsMessage.SetDiffuse( RageColor(1,1,1,0) ); m_sprOptionsMessage.SetZoomY( 0 ); } break; } } ScreenOptionsMaster::HandleScreenMessage( SM ); }
void ScreenMiniMenu::AfterLineChanged() { m_textLabel[m_iCurLine].SetEffectGlowShift( 1.0f, RageColor(0,0.5f,0,1), RageColor(0,1,0,1) ); m_textAnswer[m_iCurLine].SetEffectGlowShift( 1.0f, RageColor(0,0.5f,0,1), RageColor(0,1,0,1) ); m_textLabel[m_iCurLine].SetZoom( ZOOM_SELECTED ); m_textAnswer[m_iCurLine].SetZoom( ZOOM_SELECTED ); }
void ScreenSelectDifficulty::UpdateSelectableChoices() { for( int page=0; page<NUM_PAGES; page++ ) { /* XXX: If a player joins during the tween-in, this diffuse change * will be undone by the tween. Hmm. */ for( unsigned i=0; i<m_GameCommands[page].size(); i++ ) { /* If the icon is text, use a dimmer diffuse, or we won't be * able to see the glow. */ if( m_GameCommands[page][i].IsPlayable() ) { m_sprInfo[page][i].SetDiffuse( RageColor(1,1,1,1) ); m_sprPicture[page][i].SetDiffuse( RageColor(1,1,1,1) ); } else { m_sprInfo[page][i].SetDiffuse( DISABLED_COLOR ); m_sprPicture[page][i].SetDiffuse( DISABLED_COLOR ); } } } // I'm not sure why this was here -- but there seem no ill effects // of it's removal. // //FOREACH_HumanPlayer( p ) // { // MenuRight( p ); // MenuLeft( p ); // } }
void ScreenSelectStyle::AfterChange() { m_sprIcon[m_iSelection].RunCommands( ICON_GAIN_FOCUS_COMMAND ); m_textIcon[m_iSelection].RunCommands( ICON_GAIN_FOCUS_COMMAND ); m_sprPicture[m_iSelection].SetDiffuse( RageColor(1,1,1,1) ); m_sprInfo[m_iSelection].SetDiffuse( RageColor(1,1,1,1) ); m_sprPicture[m_iSelection].SetZoom( 1 ); m_sprInfo[m_iSelection].SetZoom( 1 ); SET_XY_AND_ON_COMMAND( m_sprPicture[m_iSelection] ); SET_XY_AND_ON_COMMAND( m_sprInfo[m_iSelection] ); }
void OptionsCursor::SetCanGo( bool bCanGoLeft, bool bCanGoRight ) { if( m_sprCanGoLeft ) { m_sprCanGoLeft->EnableAnimation( bCanGoLeft ); m_sprCanGoRight->EnableAnimation( bCanGoRight ); m_sprCanGoLeft->SetDiffuse( bCanGoLeft ? RageColor(1,1,1,1) : RageColor(1,1,1,0) ); m_sprCanGoRight->SetDiffuse( bCanGoRight ? RageColor(1,1,1,1) : RageColor(1,1,1,0) ); } }
void EditCoursesSongMenu::ChangeToRow( Row newRow ) { m_SelectedRow = newRow; for( int i=0; i<2; i++ ) m_sprArrows[i].SetY( ROW_Y(newRow) ); m_sprArrows[0].SetDiffuse( CanGoLeft()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) ); m_sprArrows[1].SetDiffuse( CanGoRight()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) ); m_sprArrows[0].EnableAnimation( CanGoLeft() ); m_sprArrows[1].EnableAnimation( CanGoRight() ); }
void ScreenSelectStyle::BeforeChange() { // dim/hide old selection m_sprIcon[m_iSelection].RunCommands( ICON_LOSE_FOCUS_COMMAND ); m_textIcon[m_iSelection].RunCommands( ICON_LOSE_FOCUS_COMMAND ); m_sprPicture[m_iSelection].StopTweening(); m_sprInfo[m_iSelection].StopTweening(); m_sprPicture[m_iSelection].SetDiffuse( RageColor(1,1,1,0) ); m_sprInfo[m_iSelection].SetDiffuse( RageColor(1,1,1,0) ); m_sprPicture[m_iSelection].SetGlow( RageColor(1,1,1,0) ); m_sprInfo[m_iSelection].SetGlow( RageColor(1,1,1,0) ); }
void ScreenNetRoom::UpdateRoomsList() { int difference = 0; RoomWheelItemData* itemData = NULL; difference = m_RoomWheel.GetNumItems() - m_Rooms.size(); if( !m_RoomWheel.IsEmpty() ) { if( difference > 0 ) for( int x = 0; x < difference; ++x ) m_RoomWheel.RemoveItem( m_RoomWheel.GetNumItems() - 1 ); else { difference = abs( difference ); for( int x = 0; x < difference; ++x ) m_RoomWheel.AddItem( new RoomWheelItemData(WheelItemDataType_Generic, "", "", RageColor(1,1,1,1)) ); } } else { for ( unsigned int x = 0; x < m_Rooms.size(); ++x) m_RoomWheel.AddItem( new RoomWheelItemData(WheelItemDataType_Generic, "", "", RageColor(1,1,1,1)) ); } for( unsigned int i = 0; i < m_Rooms.size(); ++i ) { itemData = m_RoomWheel.GetItem( i ); itemData->m_sText = m_Rooms[i].Name(); itemData->m_sDesc = m_Rooms[i].Description(); itemData->m_iFlags = m_Rooms[i].GetFlags(); switch( m_Rooms[i].State() ) { case 0: itemData->m_color = THEME->GetMetricC( m_sName, "OpenRoomColor"); break; case 2: itemData->m_color = THEME->GetMetricC( m_sName, "InGameRoomColor"); break; default: itemData->m_color = THEME->GetMetricC( m_sName, "OpenRoomColor"); break; } if ( m_Rooms[i].GetFlags() % 2 ) itemData->m_color = THEME->GetMetricC( m_sName, "PasswdRoomColor"); } m_RoomWheel.RebuildWheelItems(); }
void EditCoursesMenu::ChangeToRow( Row newRow ) { m_SelectedRow = newRow; const float fRowY = ROW_Y(newRow); const bool bCanGoLeft = CanGoLeft(), bCanGoRight = CanGoRight(); m_sprArrows[0].SetY( fRowY ); m_sprArrows[1].SetY( fRowY ); m_sprArrows[0].SetDiffuse( bCanGoLeft?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) ); m_sprArrows[1].SetDiffuse( bCanGoRight?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) ); m_sprArrows[0].EnableAnimation( bCanGoLeft ); m_sprArrows[1].EnableAnimation( bCanGoRight ); }
void ScreenStatsOverlay::Init() { Screen::Init(); m_textStats.LoadFromFont( THEME->GetPathF(m_sName,"stats") ); m_textStats.SetName( "Stats" ); LOAD_ALL_COMMANDS_AND_SET_XY_AND_ON_COMMAND( m_textStats ); this->AddChild( &m_textStats ); /* "Was that a skip?" This displays a message when an update takes * abnormally long, to quantify skips more precisely, verify them * when they're subtle, and show the time it happened, so you can pinpoint * the time in the log. */ m_LastSkip = 0; SHOW_SKIPS.Load( m_sName, "ShowSkips" ); if( SHOW_SKIPS ) { SKIP_X.Load( m_sName, "SkipX" ); SKIP_Y.Load( m_sName, "SkipY" ); SKIP_SPACING_Y.Load( m_sName, "SkipSpacingY" ); SKIP_WIDTH.Load( m_sName, "SkipWidth" ); RectF rectSkips = RectF( SKIP_X-SKIP_WIDTH/2, SKIP_Y-(SKIP_SPACING_Y*NUM_SKIPS_TO_SHOW)/2 - 10, SKIP_X+SKIP_WIDTH/2, SKIP_Y+(SKIP_SPACING_Y*NUM_SKIPS_TO_SHOW)/2 + 10 ); m_quadSkipBackground.StretchTo( rectSkips ); m_quadSkipBackground.SetDiffuse( RageColor(0,0,0,0.4f) ); this->AddChild(&m_quadSkipBackground); for( int i=0; i<NUM_SKIPS_TO_SHOW; i++ ) { /* This is somewhat big. Let's put it on the right side, where it'll * obscure the 2P side during gameplay; there's nowhere to put it that * doesn't obscure something, and it's just a diagnostic. */ m_textSkips[i].LoadFromFont( THEME->GetPathF("Common","normal") ); m_textSkips[i].SetX( SKIP_X ); m_textSkips[i].SetY( SCALE( i, 0, NUM_SKIPS_TO_SHOW-1, rectSkips.top + 10, rectSkips.bottom - 10 ) ); m_textSkips[i].SetDiffuse( RageColor(1,1,1,0) ); m_textSkips[i].SetShadowLength( 0 ); this->AddChild( &m_textSkips[i] ); } } this->SubscribeToMessage( "ShowStatsChanged" ); }
void Actor::TweenState::Init() { pos = RageVector3( 0, 0, 0 ); rotation = RageVector3( 0, 0, 0 ); quat = RageVector4( 0, 0, 0, 1 ); scale = RageVector3( 1, 1, 1 ); crop = RectF( 0,0,0,0 ); fade = RectF( 0,0,0,0 ); fadecolor = RageColor( 1, 1, 1, 0 ); for(int i=0; i<4; i++) diffuse[i] = RageColor( 1, 1, 1, 1 ); glow = RageColor( 1, 1, 1, 0 ); glowmode = GLOW_WHITEN; }
void ScreenStatsOverlay::AddTimestampLine( const RString &txt, const RageColor &color ) { m_textSkips[m_LastSkip].SetText( txt ); m_textSkips[m_LastSkip].StopTweening(); m_textSkips[m_LastSkip].SetDiffuse( RageColor(1,1,1,1) ); m_textSkips[m_LastSkip].BeginTweening( 0.2f ); m_textSkips[m_LastSkip].SetDiffuse( color ); m_textSkips[m_LastSkip].BeginTweening( 3.0f ); m_textSkips[m_LastSkip].BeginTweening( 0.2f ); m_textSkips[m_LastSkip].SetDiffuse( RageColor(1,1,1,0) ); m_LastSkip++; m_LastSkip %= NUM_SKIPS_TO_SHOW; }
static RageColor GetBrightnessColor( float fBrightnessPercent ) { RageColor cBrightness = RageColor( 0,0,0,1-fBrightnessPercent ); RageColor cClamp = RageColor( 0.5f,0.5f,0.5f,CLAMP_OUTPUT_PERCENT ); // blend the two colors above as if cBrightness is drawn, then cClamp drawn on top cBrightness.a *= (1-cClamp.a); // premultiply alpha RageColor ret; ret.a = cBrightness.a + cClamp.a; ret.r = (cBrightness.r * cBrightness.a + cClamp.r * cClamp.a) / ret.a; ret.g = (cBrightness.g * cBrightness.a + cClamp.g * cClamp.a) / ret.a; ret.b = (cBrightness.b * cBrightness.a + cClamp.b * cClamp.a) / ret.a; return ret; }
void FadingBanner::BeforeChange() { m_Banner[m_iIndexFront].SetDiffuse( RageColor(1,1,1,1) ); m_iIndexFront = GetBackIndex(); m_Banner[m_iIndexFront].SetDiffuse( RageColor(1,1,1,1) ); m_Banner[m_iIndexFront].StopTweening(); m_Banner[m_iIndexFront].BeginTweening( FADE_SECONDS ); // fade out m_Banner[m_iIndexFront].SetDiffuse( RageColor(1,1,1,0) ); /* We're about to load a banner. It'll probably cause a frame skip or * two. Skip an update, so the fade-in doesn't skip. */ m_bSkipNextBannerUpdate = true; }
LifeMeterStream() { METER_WIDTH.Refresh(); METER_HEIGHT.Refresh(); DANGER_THRESHOLD.Refresh(); NUM_CHAMBERS.Refresh(); NUM_STRIPS.Refresh(); bool bExtra = GAMESTATE->IsExtraStage()||GAMESTATE->IsExtraStage2(); m_quadMask.SetDiffuse( RageColor(0,0,0,1) ); m_quadMask.SetZ( 1 ); m_quadMask.SetBlendMode( BLEND_NO_EFFECT ); m_quadMask.SetUseZBuffer( true ); CString sGraphicPath; RageTextureID ID; ID.bStretch = true; sGraphicPath = ssprintf("LifeMeterBar %snormal", bExtra?"extra ":""); ID.filename = THEME->GetPathToG(sGraphicPath); m_sprStreamNormal.Load( ID ); m_sprStreamNormal.SetUseZBuffer( true ); sGraphicPath = ssprintf("LifeMeterBar %shot", bExtra?"extra ":""); ID.filename = THEME->GetPathToG(sGraphicPath); m_sprStreamHot.Load( ID ); m_sprStreamHot.SetUseZBuffer( true ); sGraphicPath = ssprintf("LifeMeterBar %sframe", bExtra?"extra ":""); ID.filename = THEME->GetPathToG(sGraphicPath); m_sprFrame.Load( ID ); }
void DifficultyRating::SetDifficulty(int Difficulty) { iCurrentDifficulty = Difficulty; for(int i=0; i<iMaxElements; i++) { if(i < iCurrentDifficulty) { m_apSprites[i]->SetDiffuse( RageColor(1,1,1,1) ); } else { m_apSprites[i]->SetDiffuse( RageColor(1,1,1,0) ); } } }
void OptionRow::PositionUnderlines( PlayerNumber pn ) { if( m_RowType == ROW_EXIT ) return; vector<OptionsCursor*> &vpUnderlines = m_Underline[pn]; PlayerNumber pnTakeSelectedFrom = m_RowDef.bOneChoiceForAllPlayers ? PLAYER_1 : pn; const int iNumUnderlines = (m_RowDef.layoutType == LAYOUT_SHOW_ONE_IN_ROW) ? 1 : vpUnderlines.size(); for( int i=0; i<iNumUnderlines; i++ ) { OptionsCursor& ul = *vpUnderlines[i]; int iChoiceWithFocus = (m_RowDef.layoutType == LAYOUT_SHOW_ONE_IN_ROW) ? m_iChoiceInRowWithFocus[pnTakeSelectedFrom] : i; /* Don't tween X movement and color changes. */ int iWidth, iX, iY; GetWidthXY( pn, iChoiceWithFocus, iWidth, iX, iY ); ul.SetGlobalX( (float)iX ); ul.SetGlobalDiffuseColor( RageColor(1,1,1, 1.0f) ); ASSERT( m_vbSelected[pnTakeSelectedFrom].size() == m_RowDef.choices.size() ); bool bSelected = (iChoiceWithFocus==-1) ? false : m_vbSelected[pnTakeSelectedFrom][ iChoiceWithFocus ]; bool bHidden = !bSelected || m_bHidden; ul.StopTweening(); ul.BeginTweening( TWEEN_SECONDS ); ul.SetHidden( bHidden ); ul.SetBarWidth( iWidth ); } }
BitmapText::BitmapText() { // Loading these theme metrics is slow, so only do it ever 20th time. static int iReloadCounter = 0; if( iReloadCounter%20==0 ) { RAINBOW_COLORS.resize( NUM_RAINBOW_COLORS ); for( unsigned i = 0; i < RAINBOW_COLORS.size(); ++i ) RAINBOW_COLORS[i] = RAINBOW_COLOR(i); } iReloadCounter++; m_pFont = NULL; m_bUppercase = false; m_bRainbowScroll = false; m_bJitter = false; m_iWrapWidthPixels = -1; m_fMaxWidth = 0; m_fMaxHeight = 0; m_iVertSpacing = 0; m_bHasGlowAttribute = false; m_StrokeColor = RageColor(1,1,1,1); SetShadowLength( 4 ); }
BitmapText::BitmapText() { // Loading these theme metrics is slow, so only do it every 20th time. // todo: why not check to see if you need to bother updating this at all? -aj static int iReloadCounter = 0; if( iReloadCounter % 20==0 ) { RAINBOW_COLORS.resize( NUM_RAINBOW_COLORS ); for( unsigned i = 0; i < RAINBOW_COLORS.size(); ++i ) RAINBOW_COLORS[i] = RAINBOW_COLOR(i); } iReloadCounter++; m_pFont = NULL; m_bUppercase = false; m_bRainbowScroll = false; m_bJitter = false; m_iWrapWidthPixels = -1; m_fMaxWidth = 0; m_fMaxHeight = 0; m_iVertSpacing = 0; m_bHasGlowAttribute = false; // We'd be better off not adding strokes to things we can't control // themewise (ScreenDebugOverlay for example). -Midiman m_StrokeColor = RageColor(0,0,0,0); // Never, this way we dont have awkward settings between themes. -Midiman SetShadowLength( 0 ); // SM4SVN r28328, "draw glow using stroke texture" forces the BitmapText to // glow both the inner and stroke elements. This makes BitmapText elements // with an invisible stroke have a glowing stroke instead. Not good. -aj m_TextGlowMode = TextGlowMode_Both; // Both used for compatibility with SM4 }
void HoldJudgment::Reset() { m_sprJudgment.SetDiffuse( RageColor(1,1,1,0) ); m_sprJudgment.SetXY( 0, 0 ); m_sprJudgment.StopTweening(); m_sprJudgment.SetEffectNone(); }
Font::Font() { m_iRefCount = 0; m_pDefault = NULL; m_bRightToLeft = false; m_DefaultStrokeColor = RageColor(1,1,1,1); }
void LifeMeterBattery::Load( PlayerNumber pn ) { LifeMeter::Load( pn ); bool bPlayerEnabled = GAMESTATE->IsPlayerEnabled(pn); m_sprFrame.Load( THEME->GetPathG("LifeMeterBattery","frame") ); this->AddChild( &m_sprFrame ); m_sprBattery.Load( THEME->GetPathG("LifeMeterBattery","lives 1x4") ); m_sprBattery.StopAnimating(); if( bPlayerEnabled ) this->AddChild( &m_sprBattery ); m_textNumLives.LoadFromFont( THEME->GetPathF("LifeMeterBattery", "lives") ); m_textNumLives.SetDiffuse( RageColor(1,1,1,1) ); m_textNumLives.SetShadowLength( 0 ); if( bPlayerEnabled ) this->AddChild( &m_textNumLives ); m_sprFrame.SetZoomX( pn==PLAYER_1 ? 1.0f : -1.0f ); m_sprBattery.SetZoomX( pn==PLAYER_1 ? 1.0f : -1.0f ); m_sprBattery.SetX( BATTERY_X[pn] ); m_textNumLives.SetX( NUM_X[pn] ); m_textNumLives.SetY( NUM_Y ); if( bPlayerEnabled ) { m_Percent.Load( pn, &STATSMAN->m_CurStageStats.m_player[pn], "LifeMeterBattery Percent", true ); this->AddChild( &m_Percent ); } Refresh(); }
void ScreenMapControllers::Refresh() { for( int p=0; p<MAX_GAME_CONTROLLERS; p++ ) { for( int b=0; b<GAMESTATE->GetCurrentGame()->m_iButtonsPerController; b++ ) { for( int s=0; s<NUM_SHOWN_GAME_TO_DEVICE_SLOTS; s++ ) { bool bSelected = p == m_iCurController && b == m_iCurButton && s == m_iCurSlot; GameInput cur_gi( (GameController)p, (GameButton)b ); DeviceInput di; if( INPUTMAPPER->GameToDevice( cur_gi, s, di ) ) m_textMappedTo[p][b][s].SetText( di.toString() ); else m_textMappedTo[p][b][s].SetText( "-----------" ); // highlight the currently selected pad button RageColor color; bool bPulse; if( bSelected ) { if( m_iWaitingForPress ) { color = RageColor(1,0.5,0.5,1); // red bPulse = true; } else { color = RageColor(1,1,1,1); // white bPulse = false; } } else { color = RageColor(0.5,0.5,0.5,1); // gray bPulse = false; } m_textMappedTo[p][b][s].SetDiffuse( color ); if( bPulse ) m_textMappedTo[p][b][s].SetEffectPulse( .5f, .5f, .6f ); else m_textMappedTo[p][b][s].SetEffectNone(); } } } }
void ScreenSetTime::ChangeSelection( int iDirection ) { SetTimeSelection OldSelection = m_Selection; enum_add<SetTimeSelection>( m_Selection, iDirection ); ENUM_CLAMP( m_Selection, SetTimeSelection(0), SetTimeSelection(NUM_SetTimeSelection-1) ); if( iDirection != 0 && m_Selection == OldSelection ) return; m_textValue[OldSelection].StopEffect(); m_textValue[m_Selection].SetEffectDiffuseShift( 1.f, RageColor(0.3f,0.3f,0.3f,1), RageColor(1,1,1,1) ); if( iDirection != 0 ) m_soundChangeSelection.Play(); }
void ScreenSystemLayer::UpdateSkips() { if( !PREFSMAN->m_bTimestamping && !PREFSMAN->m_bLogSkips ) return; /* Use our own timer, so we ignore `/tab. */ const float UpdateTime = SkipTimer.GetDeltaTime(); /* FPS is 0 for a little while after we load a screen; don't report * during this time. Do clear the timer, though, so we don't report * a big "skip" after this period passes. */ if( !DISPLAY->GetFPS() ) return; /* We want to display skips. We expect to get updates of about 1.0/FPS ms. */ const float ExpectedUpdate = 1.0f / DISPLAY->GetFPS(); /* These are thresholds for severity of skips. The smallest * is slightly above expected, to tolerate normal jitter. */ const float Thresholds[] = { ExpectedUpdate * 2.0f, ExpectedUpdate * 4.0f, 0.1f, -1 }; int skip = 0; while( Thresholds[skip] != -1 && UpdateTime > Thresholds[skip] ) skip++; if( skip ) { CString time(SecondsToMMSSMsMs(RageTimer::GetTimeSinceStartFast())); static const RageColor colors[] = { RageColor(0,0,0,0), /* unused */ RageColor(0.2f,0.2f,1,1), /* light blue */ RageColor(1,1,0,1), /* yellow */ RageColor(1,0.2f,0.2f,1) /* light red */ }; if( PREFSMAN->m_bTimestamping ) AddTimestampLine( ssprintf("%s: %.0fms (%.0f)", time.c_str(), 1000*UpdateTime, UpdateTime/ExpectedUpdate), colors[skip] ); if( PREFSMAN->m_bLogSkips ) LOG->Trace( "Frame skip: %.0fms (%.0f)", 1000*UpdateTime, UpdateTime/ExpectedUpdate ); } }
void HoldJudgment::ResetAnimation() { ASSERT( m_sprJudgment.IsLoaded() ); m_sprJudgment->SetDiffuse( RageColor(1,1,1,0) ); m_sprJudgment->SetXY( 0, 0 ); m_sprJudgment->StopTweening(); m_sprJudgment->StopEffect(); }
void BeginnerHelper::DrawPrimitives() { // If not initialized, don't bother with this if( !m_bInitialized ) return; ActorFrame::DrawPrimitives(); m_sFlash.Draw(); bool DrawCelShaded = PREFSMAN->m_bCelShadeModels; // Draw Pad if( SHOW_DANCE_PAD ) { if( DrawCelShaded ) m_pDancePad->DrawCelShaded(); else { DISPLAY->SetLighting( true ); DISPLAY->SetLightDirectional( 0, RageColor(0.5f,0.5f,0.5f,1), RageColor(1,1,1,1), RageColor(0,0,0,1), RageVector3(0, 0, 1) ); m_pDancePad->Draw(); DISPLAY->ClearZBuffer(); // So character doesn't step "into" the dance pad. DISPLAY->SetLightOff( 0 ); DISPLAY->SetLighting( false ); } } // Draw StepCircles for(int scd=0; scd<NUM_PLAYERS; scd++) for(int scde=0; scde<4; scde++) m_sStepCircle[scd][scde].Draw(); // Draw Dancers if( DrawCelShaded ) { FOREACH_PlayerNumber( pn ) if( GAMESTATE->IsHumanPlayer(pn) ) m_pDancer[pn]->DrawCelShaded(); } else {
/* XXX: move to RageTypes.cpp */ RageColor scale( float x, float l1, float h1, const RageColor &a, const RageColor &b ) { return RageColor( SCALE( x, l1, h1, a.r, b.r ), SCALE( x, l1, h1, a.g, b.g ), SCALE( x, l1, h1, a.b, b.b ), SCALE( x, l1, h1, a.a, b.a ) ); }
ActorFrame::ActorFrame() { m_bPropagateCommands = false; m_bDeleteChildren = false; m_bDrawByZPosition = false; m_DrawFunction.SetFromNil(); m_UpdateFunction.SetFromNil(); m_fUpdateRate = 1; m_fFOV = -1; m_fVanishX = SCREEN_CENTER_X; m_fVanishY = SCREEN_CENTER_Y; m_bOverrideLighting = false; m_bLighting = false; m_ambientColor = RageColor(1,1,1,1); m_diffuseColor = RageColor(1,1,1,1); m_specularColor = RageColor(1,1,1,1); m_lightDirection = RageVector3(0,0,1); }