Skip to content

Commit

Permalink
Added icon to client window
Browse files Browse the repository at this point in the history
  • Loading branch information
iWas-Coder committed Apr 22, 2024
1 parent 5c71ede commit ec58a06
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
Binary file added assets/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/www/static/img/favicon.png
Binary file not shown.
1 change: 1 addition & 0 deletions docs/www/static/img/favicon.png
1 change: 1 addition & 0 deletions include/sk_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ typedef struct {
typedef struct sk_state {
u8 is_online;
sk_config config;
Image win_icon;
sk_scene curr_scene;
Music menu_music;
union {
Expand Down
10 changes: 7 additions & 3 deletions src/sk_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,26 @@ sk_state sk_state_create_offline(void) {
sk_config config = sk_config_create();
sk_config_load("config.lua", &config);
sk_renderer_create(&config);
return (sk_state) {
sk_state s = {
.is_online = 0,
.config = config,
.win_icon = LoadImage("assets/icon.png"),
.curr_scene = sk_scene_create(SK_SCENE_KIND_INTRO),
.menu_music = LoadMusicStream(TextFormat(MUSIC_PATH_PLACEHOLDER, "menu")),
.map = sk_map_create(SK_MAP_CAMPING),
.player = sk_player_create(0, 0, SK_PLAYER_KIND_AGENT69, &config)
};
SetWindowIcon(s.win_icon);
return s;
}

void sk_state_destroy_offline(sk_state *s) {
sk_map_destroy(&s->map);
sk_player_destroy(&s->player);
sk_map_destroy(&s->map);
UnloadMusicStream(s->menu_music);
sk_renderer_destroy();
UnloadImage(s->win_icon);
sk_config_destroy(&s->config);
sk_renderer_destroy();
}

sk_state sk_state_create_online(u8 lobby_id) {
Expand Down

0 comments on commit ec58a06

Please sign in to comment.