Skip to content

Commit

Permalink
Adding the flags that make this work on my other crazy project
Browse files Browse the repository at this point in the history
  • Loading branch information
robrohan committed Jan 1, 2025
1 parent bb03c30 commit 2676aab
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/wefx.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ enumerations we will be using throughout this implementation file.
*/
#include "wefx.h"
/*
Additionally, we include our _wasm.h_ file which will allow us to _EXPORT_ functions and
variables to Javascript.
*/
#include "wasm.h"

typedef unsigned int color;
/*
Make variables for our double buffered screen, and export the _screen_ variable so Javascript
Expand All @@ -32,8 +24,8 @@ We also defined some global variables for foreground and background colour, as w
global width (_w_) and height (_h_) variable.
*/
static color fg_color = 0;
static color bg_color = 0;
static unsigned int fg_color = 0;
static unsigned int bg_color = 0;
static int w = 0;
static int h = 0;
static int psize = 1;
Expand Down Expand Up @@ -81,8 +73,8 @@ static int rgb_to_int(unsigned int red, unsigned int green, unsigned int blue)
red = MIN(red, 255);
green = MIN(green, 255);
blue = MIN(blue, 255);
int color = (0xFF << 24) + (blue << 16) + (green << 8) + (red);
return color;
int clr = (0xFF << 24) + (blue << 16) + (green << 8) + (red);
return clr;
}
/*
Expand Down
17 changes: 17 additions & 0 deletions src/wefx.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,25 @@
#ifndef WEFX__H
#define WEFX__H

#ifndef WEFX_NO_MATH
#include "math.h"
#endif

#ifndef WEFX_NO_WALLOC
#include "walloc.h"
#else
#include <stdlib.h>
#endif

#ifndef WEFX_NO_EXPORT
#include "wasm.h"
#else
#define EXPORT
#endif

#ifndef MIN
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#endif

// Open a new graphics window.
int wefx_open(unsigned int width, unsigned int height, const char *title);
Expand Down

0 comments on commit 2676aab

Please sign in to comment.