2021-10-31 15:12:30 +01:00
|
|
|
#include <gint/display.h>
|
|
|
|
#include <gint/keyboard.h>
|
|
|
|
|
|
|
|
#include "display.h"
|
|
|
|
|
|
|
|
|
|
|
|
void title_screen(void)
|
|
|
|
{
|
|
|
|
extern const bopti_image_t img_title;
|
|
|
|
dclear(C_WHITE);
|
|
|
|
|
|
|
|
dimage(0, 0, &img_title);
|
|
|
|
dupdate();
|
|
|
|
getkey();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-11-04 18:08:43 +01:00
|
|
|
void display_large_map(struct calccity *calccity, struct camera *camera, struct map *map)
|
2021-10-31 15:12:30 +01:00
|
|
|
{
|
|
|
|
extern const bopti_image_t img_large_tileset;
|
|
|
|
extern const bopti_image_t img_large_water;
|
|
|
|
|
|
|
|
dclear(C_WHITE);
|
2021-11-04 18:08:43 +01:00
|
|
|
|
|
|
|
for (int y = 0; y < 4; y++)
|
2021-10-31 15:12:30 +01:00
|
|
|
{
|
2021-11-04 18:08:43 +01:00
|
|
|
for (int x = 0; x < 8; x ++)
|
2021-10-31 15:12:30 +01:00
|
|
|
{
|
2021-11-04 18:08:43 +01:00
|
|
|
int cam_x = x + camera->x, cam_y = y + camera->y;
|
2021-10-31 15:12:30 +01:00
|
|
|
// Water
|
2021-11-04 18:08:43 +01:00
|
|
|
if (cam_y > 49 || cam_x > 49 || map->data[cam_y][cam_x] == 139)
|
|
|
|
dsubimage(3 + x * 15, y * 15, &img_large_water, 15 * calccity->blinker, 0, 15 * (calccity->blinker + 1), 15, DIMAGE_NONE);
|
2021-10-31 15:12:30 +01:00
|
|
|
else
|
|
|
|
{
|
2021-11-04 18:08:43 +01:00
|
|
|
unsigned tile_id = map->data[cam_y][cam_x];
|
|
|
|
unsigned int tile_x = 15 * (tile_id % 10);
|
|
|
|
unsigned int tile_y = 15 * (tile_id / 10);
|
2021-10-31 15:12:30 +01:00
|
|
|
|
2021-11-04 18:08:43 +01:00
|
|
|
dsubimage(3 + x * 15, y * 15, &img_large_tileset, tile_x, tile_y, 15, 15, DIMAGE_NONE);
|
2021-10-31 15:12:30 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-11-04 18:08:43 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void display_around(struct calccity *calccity, struct camera *camera)
|
|
|
|
{
|
|
|
|
extern const bopti_image_t img_fn_keys;
|
|
|
|
|
|
|
|
// Functions keys
|
|
|
|
dimage(3, 57, &img_fn_keys);
|
|
|
|
|
|
|
|
// Frame around screen
|
|
|
|
dline(3, 0, 123, 0, C_BLACK);
|
|
|
|
dline(3, 56, 123, 56, C_BLACK);
|
|
|
|
dline(3, 0, 3, 56, C_BLACK);
|
|
|
|
dline(123, 0, 123, 56, C_BLACK);
|
|
|
|
|
|
|
|
// Date in the top-left corner
|
|
|
|
dprint_opt(4, 1, C_BLACK, C_WHITE, DTEXT_LEFT, DTEXT_TOP, "%d-%d", calccity->month, calccity->year);
|
|
|
|
|
|
|
|
// Cursor
|
|
|
|
drect_border(8 * camera->cursor_x + 3, 8 * camera->cursor_y, 8 * camera->cursor_x + 11, 8 * camera->cursor_y + 8, C_WHITE, 1, C_BLACK);
|
|
|
|
dline(8 * camera->cursor_x + 6, 8 * camera->cursor_y + 4, 8 * camera->cursor_x + 8, 8 * camera->cursor_y + 4, C_BLACK);
|
|
|
|
dline(8 * camera->cursor_x + 7, 8 * camera->cursor_y + 3, 8 * camera->cursor_x + 7, 8 * camera->cursor_y + 5, C_BLACK);
|
|
|
|
|
|
|
|
|
2021-10-31 15:12:30 +01:00
|
|
|
dupdate();
|
|
|
|
}
|
2021-11-04 18:08:43 +01:00
|
|
|
|