Path: blob/main/Scripts/Title/CWLogo.txt
1319 views
//----------------Sonic CD CW Logo Script---------------------//1//--------Scripted by Christian Whitehead 'The Taxman'--------//2//-------Unpacked By Rubberduckycooly's Script Unpacker-------//34// Aliases5#alias Object.Value0 : Object.Timer6#alias Object.Value1 : Object.RectAlpha7#alias Object.Value2 : Object.BGScale8#alias Object.Value3 : Object.Unused910// States11#alias 0 : CWLOGO_SETUP12#alias 1 : CWLOGO_BGSCALE_INCREASE_113#alias 2 : CWLOGO_BGSCALE_INCREASE_214#alias 3 : CWLOGO_LOGO_FADEIN15#alias 4 : CWLOGO_BGSCALE_DECREASE16#alias 5 : CWLOGO_LOGO_FADEOUT1718// Callbacks & Engine States19#alias 7 : CALLBACK_EXIT_SELECTED2021// Ink Effects22#alias 2 : INK_ALPHA2324// Engine & Callbacks25#alias 5 : ENGINE_ENTER_HIRESMODE26#alias 6 : ENGINE_EXIT_HIRESMODE272829sub ObjectMain30switch Object.State31case CWLOGO_SETUP32Object.Rotation = 033Object.BGScale = 034Object.State++35break3637case CWLOGO_BGSCALE_INCREASE_138if Object.BGScale < 204839if Object.BGScale < 204840Object.BGScale += 6441else42Object.BGScale += 12843end if44else45Object.RectAlpha = 25646Object.State++47end if4849Object.Rotation += 850Object.Rotation &= 51151break5253case CWLOGO_BGSCALE_INCREASE_254if Object.BGScale < 409655if Object.BGScale < 204856Object.BGScale += 6457else58Object.BGScale += 12859end if60Object.Rotation += 861Object.Rotation &= 51162end if6364if Object.RectAlpha > 065Object.RectAlpha -= 866else67Object.State++68end if69break7071case CWLOGO_LOGO_FADEIN72if Object.Timer < 14473Object.Timer++74else75Object.Timer = 07677// It's unknown exactly what this does, it's never referenced anywhere else78// And it was only added on an update too, certainly quite strange...79Object.Unused = 08081Object.State++82end if83break8485case CWLOGO_BGSCALE_DECREASE86if Object.BGScale > 087if Object.BGScale < 204888Object.BGScale -= 6489else90Object.BGScale -= 12891end if9293Object.Rotation -= 894if Object.Rotation < 095Object.Rotation += 51296end if97end if9899if Object.RectAlpha < 256100Object.RectAlpha += 10101else102Object.State++103Object.RectAlpha = 256104end if105break106107case CWLOGO_LOGO_FADEOUT108if Object.BGScale > 0109if Object.BGScale < 2048110Object.BGScale -= 64111else112Object.BGScale -= 128113end if114115Object.Rotation -= 8116if Object.Rotation < 0117Object.Rotation += 512118end if119else120if Object.Timer == 16121ResetObjectEntity(Object.EntityNo, TypeName[Sonic], 0, Object.XPos, Object.YPos)122123Object.InkEffect = INK_ALPHA124Object.Alpha = 0125Object.Timer = 0126#platform: Use_Standalone127Engine.State = ENGINE_EXIT_HIRESMODE128Object.RectAlpha = 256129#endplatform130else131Object.Timer++132end if133end if134break135136end switch137138// Windows Phone 7, certainly quite the anomaly139if Engine.PlatformID == RETRO_WP7140if KeyPress[0].ButtonB == true141EngineCallback(CALLBACK_EXIT_SELECTED)142end if143end if144145end sub146147148sub ObjectDraw149// First, draw the solid color background150DrawRect(0, 0, Screen.XSize, Screen.YSize, 0, 0, 96, 255)151152// Then, draw the 8 Point Star pattern153Object.Scale = Object.BGScale154DrawSpriteFX(1, FX_ROTOZOOM, Object.XPos, Object.YPos)155Object.Rotation += 64156DrawSpriteFX(1, FX_ROTOZOOM, Object.XPos, Object.YPos)157Object.Rotation -= 64158159// Logo Fade In/Out160switch Object.State161case CWLOGO_BGSCALE_INCREASE_2162case CWLOGO_LOGO_FADEIN163case CWLOGO_BGSCALE_DECREASE164165// Draw the CW Logo at its own Scale166Object.Scale = 192167168DrawSpriteFX(0, FX_SCALE, Object.XPos, Object.YPos)169170// And then draw its own little background171TempValue0 = Screen.CenterX172TempValue0 -= 96173TempValue1 = Screen.CenterY174TempValue1 -= 48175DrawRect(TempValue0, TempValue1, 192, 96, 255, 149, 18, Object.RectAlpha)176break177178end switch179180end sub181182183sub ObjectStartup184185LoadSpriteSheet("Title/CWLogo.gif")186187// 0 - Christian Whitehead Logo188SpriteFrame(-255, -117, 510, 235, 1, 1)189190// 1 - Background191SpriteFrame(-32, -32, 64, 64, 1, 1)192193end sub194195196// ========================197// Editor Subs198// ========================199200sub RSDKDraw201DrawSprite(0)202end sub203204205sub RSDKLoad206LoadSpriteSheet("Global/Display.gif")207SpriteFrame(-16, -16, 32, 32, 1, 143) // #0 - "Script" Icon208209// (The actual CW Logo sprite is meant for Hi-res mode, which isn't available in the editor)210211SetVariableAlias(ALIAS_VAR_PROPVAL, "unused")212end sub213214215