Skip to content

Commit d105871

Browse files
committed
Added the option to InitScroll with alternate tiles
1 parent f90025e commit d105871

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

common/include/Scroll.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ extern UINT8 scroll_bottom_movement_limit;
3232
//void InitScrollLEGACY(UINT16 map_w, UINT16 map_h, unsigned char* map, const UINT8* coll_list, const UINT8* coll_list_down, UINT8 bank, unsigned char* color_map);
3333

3434
#define InitScrollTiles(FIRST_TILE, TILE_DATA)
35-
void ScrollSetTiles(UINT8 first_tile, struct TilesInfo* tile_data);
35+
void ScrollSetTiles(UINT8 first_tile, const struct TilesInfo* tile_data);
3636
void ScrollSetMap(const struct MapInfo* map_data);
3737
void InitScroll(const struct MapInfo* map_data, const UINT8* coll_list, const UINT8* coll_list_down);
38+
void InitScrollWithTiles(const struct MapInfo* map_data, const struct TilesInfo* tiles_info, const UINT8* coll_list, const UINT8* coll_list_down);
3839

3940
void InitWindow(UINT8 x, UINT8 y, struct MapInfo* map);
4041
void ScrollUpdateRow(INT16 x, INT16 y);

common/src/Scroll.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void ScrollSetMapLEGACY(UINT16 map_w, UINT16 map_h, unsigned char* map, UINT8 ba
151151
ScrollSetMap(&data);
152152
}*/
153153

154-
void ScrollSetTiles(UINT8 first_tile, struct TilesInfo* tiles) {
154+
void ScrollSetTiles(UINT8 first_tile, const struct TilesInfo* tiles) {
155155
UINT8 i;
156156
UINT8 n_tiles;
157157
UINT8* palette_entries;
@@ -223,14 +223,22 @@ void ScrollSetMap(const struct MapInfo* map_data) {
223223
}
224224

225225
void InitScroll(const struct MapInfo* map_data, const UINT8* coll_list, const UINT8* coll_list_down) {
226-
UINT8 i;
227-
INT16 y;
226+
228227
struct TilesInfo* tiles_info;
229228

230229
//Init Tiles
231230
PUSH_BANK(map_data->bank)
232231
tiles_info = map_data->data->tiles;
233232
POP_BANK;
233+
234+
InitScrollWithTiles(map_data, tiles_info, coll_list, coll_list_down);
235+
}
236+
237+
void InitScrollWithTiles(const struct MapInfo* map_data, const struct TilesInfo* tiles_info, const UINT8* coll_list, const UINT8* coll_list_down)
238+
{
239+
UINT8 i;
240+
INT16 y;
241+
234242
ScrollSetTiles(0, tiles_info);
235243

236244
ScrollSetMap(map_data);

0 commit comments

Comments
 (0)