Split stb_image into h/c

This commit is contained in:
John Alanbrook 2022-02-07 14:50:34 +00:00
parent 87df6921e8
commit b82ea3d670
7 changed files with 7363 additions and 7371 deletions

View file

@ -79,7 +79,7 @@ includeflag != $(call prefix,$(edirs) $(eddirs) $(pindirs) $(bsdirs),-I)
COMPINCLUDE = $(edirs) $(eddirs) $(pindirs) $(bsdirs) COMPINCLUDE = $(edirs) $(eddirs) $(pindirs) $(bsdirs)
#COMPILER_FLAGS specifies the additional compilation options we're using #COMPILER_FLAGS specifies the additional compilation options we're using
WARNING_FLAGS = -Wall -Wextra -Wwrite-strings -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Wno-incompatible-function-pointer-types -Wno-gnu-statement-expression -Wno-complex-component-init -pedantic WARNING_FLAGS = #-Wall -Wextra -Wwrite-strings -Wno-unused-parameter -Wno-unused-function -Wno-missing-braces -Wno-incompatible-function-pointer-types -Wno-gnu-statement-expression -Wno-complex-component-init -pedantic
COMPILER_FLAGS = $(includeflag) -g -O0 $(WARNING_FLAGS) -DGLEW_STATIC -D_GLFW_X11 -D_POSIX_C_SOURCE=1993809L -c -MMD -MP $< -o $@ COMPILER_FLAGS = $(includeflag) -g -O0 $(WARNING_FLAGS) -DGLEW_STATIC -D_GLFW_X11 -D_POSIX_C_SOURCE=1993809L -c -MMD -MP $< -o $@
LIBPATH = -L./bin LIBPATH = -L./bin

View file

@ -27,6 +27,7 @@ extern "C" {
#include "vec.h" #include "vec.h"
#include "debug.h" #include "debug.h"
#include "script.h" #include "script.h"
} }
#include <stb_ds.h> #include <stb_ds.h>
#define ASSET_TEXT_BUF 1024*1024 /* 1 MB buffer for editing text files */ #define ASSET_TEXT_BUF 1024*1024 /* 1 MB buffer for editing text files */
@ -58,10 +59,14 @@ const char *allowed_extensions[] = { "jpg", "png", "gltf", "glsl" };
static const char *editor_filename = "editor.ini"; static const char *editor_filename = "editor.ini";
static ImGuiIO *io = NULL; static ImGuiIO *io = NULL;
static struct {
struct asset {
char *key; char *key;
struct fileasset *value; struct fileasset *value;
} *assets = NULL; };
static struct asset *assets = NULL;
static char asset_search_buffer[100] = { 0 }; static char asset_search_buffer[100] = { 0 };
struct fileasset *selected_asset; struct fileasset *selected_asset;
@ -827,7 +832,7 @@ void editor_selectasset(struct fileasset *asset)
void editor_selectasset_str(char *path) void editor_selectasset_str(char *path)
{ {
struct fileasset *asset = shget(assets, path); struct fileasset *asset = (struct fileasset*)shget(assets, path);
if (asset) if (asset)
editor_selectasset(asset); editor_selectasset(asset);

View file

@ -1,18 +1,12 @@
#include "engine.h" #include "engine.h"
#define CGLTF_IMPLEMENTATION
#define GL_GLEXT_PROTOTYPES
#define STB_DS_IMPLEMENTATION #define STB_DS_IMPLEMENTATION
#define STB_IMAGE_IMPLEMENTATION #include <stb_ds.h>
#ifdef EDITOR #ifdef EDITOR
#include "editor.h" #include "editor.h"
#endif #endif
#include <stb_ds.h>
#include <stb_image.h>
#include <pl_mpeg.h>
#include "render.h" #include "render.h"
#include "openglrender.h" #include "openglrender.h"

View file

@ -174,7 +174,7 @@ void toggleprefab(struct mGameObject *go)
} }
} }
void component_update(struct component *c) void sdDCC Q(struct component *c)
{ {
if (c->update) if (c->update)
c->update(c->data, c->go); c->update(c->data, c->go);

View file

@ -1892,4 +1892,4 @@ AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*/ */

File diff suppressed because it is too large Load diff

7351
source/engine/thirdparty/stb/stb_image.c vendored Executable file

File diff suppressed because it is too large Load diff