mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-08 06:06:43 +01:00
don't use empty initializers (it's a GNU extension)
This commit is contained in:
parent
2b1248ce14
commit
bf4aa069a4
6 changed files with 13 additions and 13 deletions
|
@ -73,7 +73,7 @@ SYMBOL_EXPORT void LoadSpritesheets(struct Game* game, struct Character* charact
|
||||||
struct Spritesheet* tmp = character->spritesheets;
|
struct Spritesheet* tmp = character->spritesheets;
|
||||||
while (tmp) {
|
while (tmp) {
|
||||||
if (!tmp->bitmap) {
|
if (!tmp->bitmap) {
|
||||||
char filename[255] = {};
|
char filename[255] = {0};
|
||||||
snprintf(filename, 255, "sprites/%s/%s.png", character->name, tmp->name);
|
snprintf(filename, 255, "sprites/%s/%s.png", character->name, tmp->name);
|
||||||
tmp->bitmap = al_load_bitmap(GetDataFilePath(game, filename));
|
tmp->bitmap = al_load_bitmap(GetDataFilePath(game, filename));
|
||||||
tmp->width = al_get_bitmap_width(tmp->bitmap);
|
tmp->width = al_get_bitmap_width(tmp->bitmap);
|
||||||
|
@ -105,7 +105,7 @@ SYMBOL_EXPORT void RegisterSpritesheet(struct Game* game, struct Character* char
|
||||||
s = s->next;
|
s = s->next;
|
||||||
}
|
}
|
||||||
PrintConsole(game, "Registering %s spritesheet: %s", character->name, name);
|
PrintConsole(game, "Registering %s spritesheet: %s", character->name, name);
|
||||||
char filename[255] = {};
|
char filename[255] = {0};
|
||||||
snprintf(filename, 255, "sprites/%s/%s.ini", character->name, name);
|
snprintf(filename, 255, "sprites/%s/%s.ini", character->name, name);
|
||||||
ALLEGRO_CONFIG* config = al_load_config_file(GetDataFilePath(game, filename));
|
ALLEGRO_CONFIG* config = al_load_config_file(GetDataFilePath(game, filename));
|
||||||
s = malloc(sizeof(struct Spritesheet));
|
s = malloc(sizeof(struct Spritesheet));
|
||||||
|
|
|
@ -23,6 +23,8 @@
|
||||||
#ifndef LIBSUPERDERPY_EMSCRIPTEN_H
|
#ifndef LIBSUPERDERPY_EMSCRIPTEN_H
|
||||||
#define LIBSUPERDERPY_EMSCRIPTEN_H
|
#define LIBSUPERDERPY_EMSCRIPTEN_H
|
||||||
|
|
||||||
|
#include <allegro5/allegro_audio.h>
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ALLEGRO_SAMPLE* sample;
|
ALLEGRO_SAMPLE* sample;
|
||||||
ALLEGRO_SAMPLE_INSTANCE* instance;
|
ALLEGRO_SAMPLE_INSTANCE* instance;
|
||||||
|
|
|
@ -119,7 +119,7 @@ SYMBOL_INTERNAL void DrawConsole(struct Game* game) {
|
||||||
cur++;
|
cur++;
|
||||||
}
|
}
|
||||||
|
|
||||||
char sfps[6] = {};
|
char sfps[6] = {0};
|
||||||
snprintf(sfps, 6, "%.0f", game->_priv.fps_count.fps);
|
snprintf(sfps, 6, "%.0f", game->_priv.fps_count.fps);
|
||||||
DrawTextWithShadow(game->_priv.font_console, al_map_rgb(255, 255, 255), clipX + clipWidth, clipY, ALLEGRO_ALIGN_RIGHT, sfps);
|
DrawTextWithShadow(game->_priv.font_console, al_map_rgb(255, 255, 255), clipX + clipWidth, clipY, ALLEGRO_ALIGN_RIGHT, sfps);
|
||||||
|
|
||||||
|
|
|
@ -260,11 +260,13 @@ SYMBOL_EXPORT int libsuperderpy_run(struct Game* game) {
|
||||||
al_flip_display();
|
al_flip_display();
|
||||||
al_start_timer(game->_priv.timer);
|
al_start_timer(game->_priv.timer);
|
||||||
|
|
||||||
struct Gamestate* tmp = game->_priv.gamestates;
|
{
|
||||||
while (tmp) {
|
struct Gamestate* tmp = game->_priv.gamestates;
|
||||||
// don't show loading screen on init if requested
|
while (tmp) {
|
||||||
tmp->showLoading = game->show_loading_on_launch;
|
// don't show loading screen on init if requested
|
||||||
tmp = tmp->next;
|
tmp->showLoading = game->show_loading_on_launch;
|
||||||
|
tmp = tmp->next;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
game->_priv.loading.gamestate = AllocateGamestate(game, "loading");
|
game->_priv.loading.gamestate = AllocateGamestate(game, "loading");
|
||||||
|
|
|
@ -307,10 +307,6 @@ SYMBOL_EXPORT struct TM_Action* TM_AddQueuedBackgroundAction(struct Timeline* ti
|
||||||
}
|
}
|
||||||
|
|
||||||
SYMBOL_EXPORT void TM_AddDelay(struct Timeline* timeline, int delay) {
|
SYMBOL_EXPORT void TM_AddDelay(struct Timeline* timeline, int delay) {
|
||||||
/*int *tmp;
|
|
||||||
tmp = malloc(sizeof(int));
|
|
||||||
*tmp = delay;
|
|
||||||
TM_AddAction(NULL, TM_AddToArgs(NULL, tmp));*/
|
|
||||||
struct TM_Action* tmp = TM_AddAction(timeline, NULL, NULL, "TM_Delay");
|
struct TM_Action* tmp = TM_AddAction(timeline, NULL, NULL, "TM_Delay");
|
||||||
PrintConsole(timeline->game, "Timeline Manager[%s]: queue: adding delay %d ms (%d)", timeline->name, delay, tmp->id);
|
PrintConsole(timeline->game, "Timeline Manager[%s]: queue: adding delay %d ms (%d)", timeline->name, delay, tmp->id);
|
||||||
tmp->delay = delay;
|
tmp->delay = delay;
|
||||||
|
|
|
@ -184,7 +184,7 @@ SYMBOL_EXPORT ALLEGRO_BITMAP* LoadScaledBitmap(struct Game* game, char* filename
|
||||||
}
|
}
|
||||||
|
|
||||||
SYMBOL_EXPORT void FatalError(struct Game* game, bool exit, char* format, ...) {
|
SYMBOL_EXPORT void FatalError(struct Game* game, bool exit, char* format, ...) {
|
||||||
char text[1024] = {};
|
char text[1024] = {0};
|
||||||
PrintConsole(game, "Fatal Error, displaying Blue Screen of Derp...");
|
PrintConsole(game, "Fatal Error, displaying Blue Screen of Derp...");
|
||||||
va_list vl;
|
va_list vl;
|
||||||
va_start(vl, format);
|
va_start(vl, format);
|
||||||
|
|
Loading…
Reference in a new issue