Files
isaac-port/generated-src/sprite.cpp
T

157 lines
3.1 KiB
C++

#include "classes.h"
// 004073d0
void Sprite::SetColor(ColorMod *color)
{
float fVar1;
float fVar2;
float fVar3;
if (&this->_color != color) {
fVar1 = color->_tint[1];
fVar2 = color->_tint[2];
fVar3 = color->_tint[3];
(this->_color)._tint[0] = color->_tint[0];
(this->_color)._tint[1] = fVar1;
(this->_color)._tint[2] = fVar2;
(this->_color)._tint[3] = fVar3;
fVar1 = color->_colorize[1];
fVar2 = color->_colorize[2];
fVar3 = color->_colorize[3];
(this->_color)._colorize[0] = color->_colorize[0];
(this->_color)._colorize[1] = fVar1;
(this->_color)._colorize[2] = fVar2;
(this->_color)._colorize[3] = fVar3;
*GHIDRA_CAST<uint64_t *>((this->_color)._offset) = *GHIDRA_CAST<uint64_t *>(color->_offset);
(this->_color)._offset[2] = color->_offset[2];
}
return;
}
// 00407420
uint8_t Sprite::FlipX()
{
return this->_flipX;
}
// 00407430
uint8_t Sprite::FlipY()
{
return this->_flipY;
}
// 0040a360
void Sprite::Play(std_string *animName, uint8_t isForce)
{
if (0xf < animName->_capacity) {
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
}
ANM2::Play(GHIDRA_CAST<ANM2 *>(this),GHIDRA_CAST<uint8_t *>(animName),isForce);
return;
}
// 0040a720
void Sprite::SetFrame_1(int frame)
{
if ((this->_animState)._animData != (void *)0x0) {
AnimationState::SetFrameFloat(&this->_animState,(float)frame);
}
return;
}
// 0040a920
void Sprite::PlayOverlay(uint8_t *param_1, uint8_t param_2)
{
ANM2 *in_ECX;
if (0xf < *GHIDRA_CAST<uint32_t *>((param_1 + 0x14))) {
param_1 = *GHIDRA_CAST<uint8_t **>(param_1);
}
ANM2::PlayOverlay(in_ECX,param_1,param_2);
return;
}
// 0040abb0
void Sprite::SetOverlayFrame(std_string *animName, int frame)
{
uint8_t isAnimationSet;
if (0xf < animName->_capacity) {
animName = *GHIDRA_CAST<std_string **>(animName->_buf);
}
isAnimationSet = ANM2::SetOverlayAnimation(GHIDRA_CAST<ANM2 *>(this),GHIDRA_CAST<uint8_t *>(animName),1);
if ((isAnimationSet != 0) && ((this->_overlayAnimState)._animData != (void *)0x0)) {
AnimationState::SetFrameFloat(&this->_overlayAnimState,(float)frame);
}
return;
}
// 0040b200
LayerState * Sprite::GetLayer(uint8_t *layerName)
{
LayerState *layer;
layer = ANM2::GetLayer(GHIDRA_CAST<ANM2 *>(this),layerName);
return layer;
}
// 0040bff0
void Sprite::LoadGraphics()
{
ANM2::LoadGraphics(GHIDRA_CAST<ANM2 *>(this),(uint8_t)this);
return;
}
// 00417200
Vector * Sprite::Scale()
{
return &this->_scale;
}
// 00417210
long double Sprite::Rotation()
{
return (long double)this->_rotation;
}
// 00420160
uint8_t Sprite::IsLoaded()
{
return this->_loaded;
}
// 00420170
void Sprite::SetScale(Vector *scale)
{
(this->_scale).x = scale->x;
(this->_scale).y = scale->y;
return;
}
// 0043ee80
void Sprite::SetRotation(float rotation)
{
this->_rotation = rotation;
return;
}
// 00440e40
int Sprite::GetLayerCount()
{
return this->_layerCount;
}
// 00456340
void Sprite::set_offset(Vector *offset)
{
(this->_offset).x = offset->x;
(this->_offset).y = offset->y;
return;
}
// 00456360
long double Sprite::PlaybackSpeed()
{
return (long double)this->_playbackSpeed;
}