diff options
| author | octorock <79596758+octorock@users.noreply.github.com> | 2022-07-23 12:43:43 +0200 |
|---|---|---|
| committer | octorock <79596758+octorock@users.noreply.github.com> | 2022-07-25 22:45:55 +0200 |
| commit | 852effa474c159398014da736ade6f0fea454de7 (patch) | |
| tree | 97da22c4758ca4156dc9fb7ac123c7a3b0a9e9f5 /src/object/elementsBackground.c | |
| parent | ccba86d292a0e4c8a0e07325ac4fb25e5a58dc89 (diff) | |
Rename objects
Diffstat (limited to 'src/object/elementsBackground.c')
| -rw-r--r-- | src/object/elementsBackground.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/object/elementsBackground.c b/src/object/elementsBackground.c new file mode 100644 index 00000000..e02bba1b --- /dev/null +++ b/src/object/elementsBackground.c @@ -0,0 +1,60 @@ +/** + * @file elementsBackground.c + * @ingroup Objects + * + * @brief Elements Background object + */ +#define NENT_DEPRECATED +#include "entity.h" +#include "functions.h" +#include "screen.h" + +void ElementsBackground_Init(Entity*); +void ElementsBackground_Action1(Entity*); +void sub_080A04E8(); + +void ElementsBackground(Entity* this) { + static void (*const ElementsBackground_Actions[])(Entity*) = { + ElementsBackground_Init, + ElementsBackground_Action1, + }; + + ElementsBackground_Actions[this->action]((Entity*)this); +} + +void ElementsBackground_Init(Entity* this) { + this->action = 1; + this->frameIndex = 4; + this->timer = 0; + this->spriteRendering.b3 = 3; + this->spritePriority.b0 = 7; + this->z.WORD = 0; + this->spriteRendering.alphaBlend = 1; + sub_080A04E8(); +} + +void ElementsBackground_Action1(Entity* this) { + sub_080A04E8(); +} + +void sub_080A04E8(Entity* this) { + int iVar2; + u32 uVar3; + + iVar2 = (this->parent->z.HALF.HI < 0 ? -this->parent->z.HALF.HI : this->parent->z.HALF.HI) + 0x100; + SetAffineInfo(this, iVar2, iVar2, 0); + iVar2 = ((0x1c0 - iVar2) * 10) / iVar2; + if (this->parent->type == 0x41) { + uVar3 = iVar2 * 2; + if (0xc < uVar3) { + uVar3 = 0xc; + } + iVar2 = (0x10 - iVar2) * 0x100; + iVar2 |= uVar3; + iVar2 &= 0xffff; + } else { + iVar2 |= (0x10 - iVar2) * 0x100; + iVar2 &= 0xffff; + } + gScreen.controls.alphaBlend = iVar2; +} |
