Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/Objects/SSZ/MonarchPlans.c
338 views
1
// ---------------------------------------------------------------------
2
// RSDK Project: Sonic Mania
3
// Object Description: MonarchPlans Object
4
// Object Author: Christian Whitehead/Simon Thomley/Hunter Bridges
5
// Decompiled by: Rubberduckycooly & RMGRich
6
// ---------------------------------------------------------------------
7
8
#include "Game.h"
9
10
#if MANIA_USE_PLUS
11
ObjectMonarchPlans *MonarchPlans;
12
13
void MonarchPlans_Update(void)
14
{
15
RSDK_THIS(MonarchPlans);
16
17
self->rotationY = (self->rotationY + 4) & 0x3FF;
18
19
RSDK.MatrixScaleXYZ(&self->matWorldTemp, self->scale.x, -self->scale.x, self->scale.x);
20
RSDK.MatrixTranslateXYZ(&self->matWorldTemp, self->position.x, self->position.y, 0, 0);
21
RSDK.MatrixRotateXYZ(&self->matWorld, 0, self->rotationY, self->rotationZ);
22
RSDK.MatrixMultiply(&self->matWorld, &self->matWorld, &self->matWorldTemp);
23
24
RSDK.MatrixRotateX(&self->matNormalTemp, 0x1E0);
25
RSDK.MatrixRotateXYZ(&self->matNormal, 0, self->rotationY, self->rotationZ);
26
RSDK.MatrixMultiply(&self->matNormal, &self->matNormal, &self->matNormalTemp);
27
}
28
29
void MonarchPlans_LateUpdate(void) {}
30
31
void MonarchPlans_StaticUpdate(void) {}
32
33
void MonarchPlans_Draw(void)
34
{
35
RSDK_THIS(MonarchPlans);
36
37
RSDK.Prepare3DScene(MonarchPlans->sceneIndex);
38
39
RSDK.AddModelTo3DScene(MonarchPlans->meshIndex, MonarchPlans->sceneIndex, S3D_WIREFRAME, &self->matWorld, &self->matNormal, 0x609090);
40
41
RSDK.Draw3DScene(MonarchPlans->sceneIndex);
42
}
43
44
void MonarchPlans_Create(void *data)
45
{
46
RSDK_THIS(MonarchPlans);
47
48
if (!SceneInfo->inEditor) {
49
self->active = ACTIVE_BOUNDS;
50
self->inkEffect = INK_BLEND;
51
self->visible = true;
52
self->updateRange.x = 0x900000;
53
self->updateRange.y = 0x900000;
54
self->scale.x = 0xA0;
55
self->scale.y = 0xA0;
56
self->drawGroup = Zone->objectDrawGroup[0];
57
}
58
}
59
60
void MonarchPlans_StageLoad(void)
61
{
62
// ???
63
// what the...?
64
// don't even have the slightest of clues as to what this was
65
// why is it in Data/Sprites/Global/ ???
66
MonarchPlans->aniFrames = RSDK.LoadSpriteAnimation("Global/MonarchPlans.bin", SCOPE_STAGE);
67
68
MonarchPlans->meshIndex = RSDK.LoadMesh("SSZ/MonarchPlans.bin", SCOPE_STAGE);
69
MonarchPlans->sceneIndex = RSDK.Create3DScene("View:MonarchPlans", 0x2000, SCOPE_STAGE);
70
71
// ???
72
MonarchPlans->hitbox.left = -24;
73
MonarchPlans->hitbox.top = -24;
74
MonarchPlans->hitbox.right = 24;
75
MonarchPlans->hitbox.bottom = 24;
76
77
RSDK.SetDiffuseColor(MonarchPlans->sceneIndex, 0xA0, 0xA0, 0xA0);
78
RSDK.SetDiffuseIntensity(MonarchPlans->sceneIndex, 8, 8, 8);
79
RSDK.SetSpecularIntensity(MonarchPlans->sceneIndex, 14, 14, 14);
80
}
81
82
#if GAME_INCLUDE_EDITOR
83
void MonarchPlans_EditorDraw(void) {}
84
85
void MonarchPlans_EditorLoad(void) {}
86
#endif
87
88
void MonarchPlans_Serialize(void) {}
89
#endif
90
91