diff --git a/src/drawing.c b/src/drawing.c index f2e244a..f65f87b 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -53,13 +53,13 @@ void noStroke() void strokeWeight(double weight) { lineWidth = weight; } -char* rgba(double r, double g, double b, double a) { +const char* rgba(double r, double g, double b, double a) { static char buf[1024]; snprintf(buf, sizeof(buf) - 1, "%f %f %f %f", r, g, b, a); return buf; } -char* rgb(double r, double g, double b) +const char* rgb(double r, double g, double b) { return rgba(r, g, b, 1); } void rect(double x, double y, double width, double height) { @@ -195,6 +195,7 @@ static void unloadFont(HeliFontInstance *fi) { } Font createFont(const char *path) { + if (!heliInitialized) return NULL; Font f = calloc(1, sizeof(*f)); f->instance = (HeliFontInstance*)heliStringmapGet(&fontCache, path); if (!f->instance) { diff --git a/src/drawing.h b/src/drawing.h index 8eb30dc..7d1acdb 100644 --- a/src/drawing.h +++ b/src/drawing.h @@ -27,8 +27,8 @@ void noFill(); void stroke(const char *color); void noStroke(); void strokeWeight(double weight); -char* rgb(double r, double g, double b); -char* rgba(double r, double g, double b, double a); +const char* rgb(double r, double g, double b); +const char* rgba(double r, double g, double b, double a); void rect(double x, double y, double width, double height); void ellipse(double x, double y, double width, double height); void arc(double x, double y, double w, double h, double start, double stop); diff --git a/src/world.c b/src/world.c index 8f50864..c241a25 100644 --- a/src/world.c +++ b/src/world.c @@ -37,7 +37,7 @@ static int height = 400; static int resizable; static char title[1000]; static int titleSize = (int)(sizeof(title)/sizeof(*title)); -static double frameRate = 30; +static double frameRate = 24; static int cameraEnabled; static double cameraX; diff --git a/src/world.h b/src/world.h index f9bd4f1..a912a38 100644 --- a/src/world.h +++ b/src/world.h @@ -42,9 +42,9 @@ double mouseY(); int mouseIsOver(Sprite sprite); int mousePressedOver(Sprite sprite); +void messageBox(const char *message); void askText(const char *question, char *answer, int maxAnswerSize); void askTextEx(const char *question, char *answer, int maxAnswerSize, int multiline, int password); -void messageBox(const char *message); int worldGetSpriteCount(); Sprite worldGetSprite(int i);