Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/BSS/BSS_Horizon.c
338 views
1
// ---------------------------------------------------------------------
2
// RSDK Project: Sonic Mania
3
// Object Description: BSS_Horizon Object
4
// Object Author: Christian Whitehead/Simon Thomley/Hunter Bridges
5
// Decompiled by: Rubberduckycooly & RMGRich
6
// ---------------------------------------------------------------------
7
8
#include "Game.h"
9
10
ObjectBSS_Horizon *BSS_Horizon;
11
12
void BSS_Horizon_Update(void) {}
13
14
void BSS_Horizon_LateUpdate(void) {}
15
16
void BSS_Horizon_StaticUpdate(void) {}
17
18
void BSS_Horizon_Draw(void)
19
{
20
RSDK_THIS(BSS_Horizon);
21
22
Vector2 drawPos;
23
drawPos.x = TO_FIXED(ScreenInfo->center.x);
24
drawPos.y = 0;
25
26
// Draw Sky Horizon (Left)
27
self->horizonAnimator.frameID = 0;
28
self->alpha = BSS_Palette->skyAlpha;
29
self->direction = FLIP_NONE;
30
RSDK.DrawSprite(&self->horizonAnimator, &drawPos, true);
31
32
// Draw Sky Horizon (Right)
33
self->direction = FLIP_X;
34
RSDK.DrawSprite(&self->horizonAnimator, &drawPos, true);
35
36
// Draw Globe Horizon (Left)
37
self->horizonAnimator.frameID = 1;
38
self->alpha = BSS_Palette->globeAlpha;
39
self->direction = FLIP_NONE;
40
RSDK.DrawSprite(&self->horizonAnimator, &drawPos, true);
41
42
// Draw Globe Horizon (Right)
43
self->direction = FLIP_X;
44
RSDK.DrawSprite(&self->horizonAnimator, &drawPos, true);
45
}
46
47
void BSS_Horizon_Create(void *data)
48
{
49
RSDK_THIS(BSS_Horizon);
50
51
if (!SceneInfo->inEditor) {
52
self->active = ACTIVE_NORMAL;
53
self->inkEffect = INK_ADD;
54
self->visible = true;
55
self->drawGroup = 2;
56
self->drawFX = FX_FLIP;
57
58
RSDK.SetSpriteAnimation(BSS_Horizon->aniFrames, 0, &self->horizonAnimator, true, 0);
59
}
60
}
61
62
void BSS_Horizon_StageLoad(void)
63
{
64
BSS_Horizon->aniFrames = RSDK.LoadSpriteAnimation("SpecialBS/Horizon.bin", SCOPE_STAGE);
65
66
RSDK.ResetEntitySlot(SLOT_BSS_HORIZON, BSS_Horizon->classID, NULL);
67
}
68
69
#if GAME_INCLUDE_EDITOR
70
void BSS_Horizon_EditorDraw(void) {}
71
72
void BSS_Horizon_EditorLoad(void) {}
73
#endif
74
75
void BSS_Horizon_Serialize(void) {}
76
77