summaryrefslogtreecommitdiff
path: root/src/manager/manager20.c
blob: f7ca8a0b9b60d642dd78abb3f822b59ad6211a4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "global.h"
#include "manager.h"
#include "flags.h"
#include "entity.h"
#include "room.h"
#include "functions.h"

typedef struct {
    Manager manager;
    u8 unk_20[0x12];
    u16 unk_32;
    u8 unk_34[2];
    u8 unk_36;
    u8 unk_37;
    u16 unk_38;
    u16 unk_3a;
    u16 unk_3c;
    u16 unk_3e;
} Manager20;

void sub_0805B7A0(Manager20* this) {
    Entity* tmp = CreateObject(this->manager.unk_0e, this->manager.unk_0a, this->manager.unk_0b);
    if (!tmp)
        return;
    tmp->field_0x86.HWORD = this->unk_3e;
    if (CheckFlags(this->unk_3e)) {
        tmp->x.HALF.HI = this->unk_36 | (this->unk_37 & 0xF) << 8; // r1
        tmp->y.HALF.HI = this->unk_3c & 0xFFF;
        tmp->collisionLayer = this->unk_3c >> 0xC;
    } else {
        tmp->x.HALF.HI = this->unk_38;
        tmp->y.HALF.HI = this->unk_3a;
        tmp->collisionLayer = this->unk_37 >> 4;
    }
    tmp->x.HALF.HI += gRoomControls.roomOriginX;
    tmp->y.HALF.HI += gRoomControls.roomOriginY;
    DeleteManager((Manager*)this);
}