void InitOpponent( void ) { MRect littleRect = {0, 0, 64, 64}, bigRect = {0, 0, 64, 64*(kOppFrames*3) }; SDL_Rect sdlRect; double index, value; opponentDrawSurface = SDLU_InitSurface( SDLU_MRectToSDLRect( &littleRect, &sdlRect ), 16 ); opponentSurface = SDLU_InitSurface( SDLU_MRectToSDLRect( &bigRect, &sdlRect ), 16 ); bigRect.bottom *= kGlows + 1; opponentMaskSurface = SDLU_InitSurface( SDLU_MRectToSDLRect( &bigRect, &sdlRect ), 1 ); opponentWindowZRect.top = opponentWindowZRect.left = 0; opponentWindowZRect.bottom = opponentWindowZRect.right = 64; opponentWindowRect = opponentWindowZRect; CenterRectOnScreen( &opponentWindowRect, 0.5, 0.5 ); opponentMood = 0; for( index=0; index<kGlowArraySize; index++ ) { value = sin( index*pi/kGlowArraySize ); value *= value; heavyGlowArray[(int)index] = (int)(value * 24.0); glowArray [(int)index] = (int)(value * 16.0); lightGlowArray[(int)index] = (int)(value * 12.0); } }
void SDLU_ChangeSurfaceDepth( SDL_Surface** surface, int depth ) { SDL_Surface* newSurface; newSurface = SDLU_InitSurface( &surface[0]->clip_rect, depth ); SDLU_BlitSurface( *surface, &surface[0]->clip_rect, newSurface, &newSurface->clip_rect ); SDL_FreeSurface( *surface ); *surface = newSurface; }
void InitTutorial( void ) { // Balloon font balloonFont = GetFont( picBalloonFont ); // Balloon backbuffer if( balloonSurface == NULL ) { SDL_Rect surfaceRect = { 0, 0, backdropSurface->w, backdropSurface->h }; balloonSurface = SDLU_InitSurface( &surfaceRect, 16 ); } // Set up auto pattern autoPattern = tutorialPattern; tutorialTime = 0; }