summaryrefslogtreecommitdiff
path: root/include/beanstalkSubtask.h
blob: 3a91465e9e891b40a55c356a4c6d401bd537d327 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef BEANSTALKSUBTASK_H
#define BEANSTALKSUBTASK_H

#include "global.h"
#include "map.h"

/*
tiles 0x4000 and above create an entry here
*/
#define MAX_SPECIAL_TILES 0x100
typedef struct {
    u16 tilePosAndLayer; // (layer << 12) | position
    u16 tileIndex;
} SpecialTileEntry;
extern SpecialTileEntry gTilesForSpecialTiles[MAX_SPECIAL_TILES];

typedef struct {
    u16 collision;
    u16 tileIndex;
} struct_080B44D0;

void LoadMapData(MapDataDefinition* dataDefinition);

/**
 * Renders a tileMap with 16x16 tiles into a subTileMap with 8x8 tiles.
 *
 * Takes into account the special tile indicess >= 0x4000 using GetTileSetIndexForSpecialTile.
 */
void RenderMapLayerToSubTileMap(u16* tileMap, MapLayer* mapLayer);

extern void sub_0801AFE4(void);
extern void SetBGDefaults(void);

typedef struct {
    s16 tileIndex;
    s16 tilePosOffset;
} TileData;

/**
 * @brief Sets multiple tiles at once
 *
 * @param tileData [u16 tileIndex, s16 positionOffset], ends with 0xffff
 * @param basePosition the position the offsets in tileData are based on
 * @param layer the tile layer
 */
extern void SetMultipleTiles(const TileData* tileData, u32 basePosition, u32 layer);

typedef struct {
    u8 unk_0;
    u8 unk_1;
    u8 unk_2[2];
    u16 unk_4;
    u8 filler[12];
    struct Entity_* unk_14;
    u8 unk_18;
    u8 unk_19;
    u8 unk_1a;
    u8 unk_1b;
} struct_02018EB0;

extern struct_02018EB0 gUnk_02018EB0;

#endif // BEANSTALKSUBTASK_H