mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-08-22 15:11:52 -04:00
de9c5d5101
* Impl SpawnParams * Added json submodule * Update json * Update * Works * Remove comment * Works refactor * Snowman and thwomp working * Impl hot air balloon * More progress * All OObjects are done * cleanup * Refactor 2Dpath to normal path * Update nlohmann json & fix compile * Rest of actors * MORE CHANGES * Finish actors * Done PR, some fix to collision viewer * Impl falling rocks * Add const * wip editor refactor * Property work * continue * Overridable editor properties * Actor saving/loading works now * Fix light alignment * Clarification * Impl penguin * params impl signs * properties impl falling rock * More property impls * impl air balloon * Add spawnParams to OObject Translate * Snowman translate better * impl hedgehog properly * properties impl trophy * thwomp progress * Finish impl properties * Fix compile * Fix cursor collisions * Move registered actors * Rename pathPoint XYZ to xyz * Fix editor pause bug * Clean up * Review comments * Remove SpawnParams struct from actor classes * Rename * Player Label First Iteration * Work now * Working 3d text * Fix boo bug * Finish AText actor * Fix spawnparams compile * Register AText * Finish Text Actor * Fix thwomp interpolation * Fix compile * Fix crab and hedgehog * Fix loading flagpole * Fix Hot Air Balloon * Turn zbuffer on for AText * Update --------- Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
66 lines
1.6 KiB
C++
66 lines
1.6 KiB
C++
#include "WarioSign.h"
|
|
|
|
#include <libultra/gbi.h>
|
|
#include <assets/wario_stadium_data.h>
|
|
|
|
extern "C" {
|
|
#include "common_structs.h"
|
|
#include "math_util.h"
|
|
#include "main.h"
|
|
#include "actor_types.h"
|
|
#include "code_800029B0.h"
|
|
#include "collision.h"
|
|
}
|
|
|
|
AWarioSign::AWarioSign(const SpawnParams& params) : AActor(params) {
|
|
Type = ACTOR_WARIO_SIGN;
|
|
Name = "Wario Sign";
|
|
ResourceName = "mk:wario_sign";
|
|
Model = d_course_wario_stadium_dl_sign;
|
|
|
|
Speed = params.Speed.value_or(182);
|
|
|
|
FVector pos = params.Location.value_or(FVector(0, 0, 0));
|
|
Pos[0] = pos.x * gCourseDirection;
|
|
Pos[1] = pos.y;
|
|
Pos[2] = pos.z;
|
|
|
|
IRotator rot = params.Rotation.value_or(IRotator(0, 0, 0));
|
|
Rot[0] = rot.pitch;
|
|
Rot[1] = rot.yaw;
|
|
Rot[2] = rot.roll;
|
|
|
|
Scale = params.Scale.value_or(FVector(1.0f, 1.0f, 1.0f));
|
|
|
|
func_802AAAAC(&Unk30);
|
|
Flags = -0x8000;
|
|
}
|
|
|
|
bool AWarioSign::IsMod() {
|
|
return true;
|
|
}
|
|
|
|
void AWarioSign::Tick() {
|
|
Rot[1] += Speed;
|
|
}
|
|
|
|
void AWarioSign::Draw(Camera *camera) {
|
|
Mat4 sp38;
|
|
f32 unk =
|
|
is_within_render_distance(camera->pos, Pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 16000000.0f);
|
|
|
|
if (CVarGetInteger("gNoCulling", 0) == 1) {
|
|
unk = MAX(unk, 0.0f);
|
|
}
|
|
if (!(unk < 0.0f)) {
|
|
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
|
|
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
|
|
|
|
mtxf_pos_rotation_xyz(sp38, Pos, Rot);
|
|
if (render_set_position(sp38, 0) != 0) {
|
|
|
|
gSPDisplayList(gDisplayListHead++, (Gfx*)d_course_wario_stadium_dl_sign);
|
|
}
|
|
}
|
|
}
|