Path: blob/master/SonicMania/Objects/CPZ/CPZShutter.c
338 views
// ---------------------------------------------------------------------1// RSDK Project: Sonic Mania2// Object Description: CPZShutter Object3// Object Author: Christian Whitehead/Simon Thomley/Hunter Bridges4// Decompiled by: Rubberduckycooly & RMGRich5// ---------------------------------------------------------------------67#include "Game.h"89ObjectCPZShutter *CPZShutter;1011void CPZShutter_Update(void)12{13RSDK_THIS(CPZShutter);1415StateMachine_Run(self->state);16}1718void CPZShutter_LateUpdate(void) {}1920void CPZShutter_StaticUpdate(void) {}2122void CPZShutter_Draw(void)23{24RSDK_THIS(CPZShutter);2526RSDK.DrawSprite(&self->animator, NULL, false);27}2829void CPZShutter_Create(void *data)30{31RSDK_THIS(CPZShutter);3233if (!SceneInfo->inEditor) {34self->visible = true;35self->active = ACTIVE_BOUNDS;36self->drawGroup = Zone->objectDrawGroup[1] - 2;37self->updateRange.x = 0x800000;38self->updateRange.y = 0x800000;39RSDK.SetSpriteAnimation(CPZShutter->aniFrames, 0, &self->animator, true, 0);40}41}4243void CPZShutter_StageLoad(void) { CPZShutter->aniFrames = RSDK.LoadSpriteAnimation("CPZ/Shutter.bin", SCOPE_STAGE); }4445void CPZShutter_State_Open(void)46{47RSDK_THIS(CPZShutter);4849self->position.y -= 0x20000;50if (++self->timer == 24) {51self->timer = 0;52self->state = StateMachine_None;53}54}5556void CPZShutter_State_Close(void)57{58RSDK_THIS(CPZShutter);5960self->position.y += 0x20000;61if (++self->timer == 24) {62self->timer = 0;63self->active = ACTIVE_BOUNDS;64self->state = StateMachine_None;65}66}6768#if GAME_INCLUDE_EDITOR69void CPZShutter_EditorDraw(void)70{71RSDK_THIS(CPZShutter);7273RSDK.SetSpriteAnimation(CPZShutter->aniFrames, 0, &self->animator, true, 0);7475CPZShutter_Draw();76}7778void CPZShutter_EditorLoad(void) { CPZShutter->aniFrames = RSDK.LoadSpriteAnimation("CPZ/Shutter.bin", SCOPE_STAGE); }79#endif8081void CPZShutter_Serialize(void) {}828384