80 lines
1.6 KiB
C
80 lines
1.6 KiB
C
#include <game_private.h>
|
|
#include <building.h>
|
|
#include <container.h>
|
|
#include <font.h>
|
|
#include <gfx.h>
|
|
#include <gui/bar.h>
|
|
#include <gui/button.h>
|
|
#include <gui/line_edit.h>
|
|
#include <gui/rounded_rect.h>
|
|
#include <gui/checkbox.h>
|
|
#include <terrain.h>
|
|
#include <unit.h>
|
|
#include <stdbool.h>
|
|
|
|
static const struct container c[] =
|
|
{
|
|
{
|
|
.path = "sidewalk",
|
|
.type = CONTAINER_TYPE_SPRITE,
|
|
.data.sprite = &terrain_sprites[SIDEWALK]
|
|
},
|
|
{
|
|
.path = "roof1",
|
|
.type = CONTAINER_TYPE_SPRITE,
|
|
.data.sprite = &terrain_sprites[ROOF1]
|
|
},
|
|
{
|
|
.path = "roof2",
|
|
.type = CONTAINER_TYPE_SPRITE,
|
|
.data.sprite = &terrain_sprites[ROOF2]
|
|
},
|
|
{
|
|
.path = "cursor",
|
|
.type = CONTAINER_TYPE_SPRITE,
|
|
.data.sprite = &cursor_sprite
|
|
},
|
|
{
|
|
.path = "btn_left",
|
|
.type = CONTAINER_TYPE_SPRITE,
|
|
.data.sprite = &gui_button_sprites[GUI_BUTTON_LEFT]
|
|
},
|
|
{
|
|
.path = "btn_mid",
|
|
.type = CONTAINER_TYPE_SPRITE,
|
|
.data.sprite = &gui_button_sprites[GUI_BUTTON_MID]
|
|
},
|
|
{
|
|
.path = "btn_right",
|
|
.type = CONTAINER_TYPE_SPRITE,
|
|
.data.sprite = &gui_button_sprites[GUI_BUTTON_RIGHT]
|
|
},
|
|
};
|
|
|
|
static bool init;
|
|
|
|
void game_free(void)
|
|
{
|
|
if (init)
|
|
{
|
|
container_free(c, sizeof c / sizeof *c);
|
|
init = false;
|
|
}
|
|
}
|
|
|
|
int game_resinit(void)
|
|
{
|
|
if (!init)
|
|
{
|
|
if (container_load("jancity.cnt", c, sizeof c / sizeof *c))
|
|
{
|
|
perror("container_load");
|
|
return -1;
|
|
}
|
|
|
|
init = true;
|
|
}
|
|
|
|
return 0;
|
|
}
|