S7 header config & prototyping support
This commit is contained in:
parent
740077fae3
commit
1521593269
|
@ -13,7 +13,14 @@
|
||||||
#define MSAA_SAMPLES 2
|
#define MSAA_SAMPLES 2
|
||||||
|
|
||||||
|
|
||||||
|
/* S7 Scheme defines */
|
||||||
|
#define INITIAL_HEAP_SIZE 4096
|
||||||
|
#define INITIAL_STACK_SIZE 4096
|
||||||
|
#define DEFAULT_BIGNUM_PRECISION 128
|
||||||
|
#define WITH_PURE_S7 1
|
||||||
|
#define WITH_SYSTEM_EXTRAS 0
|
||||||
|
#define WITH_C_LOADER 0
|
||||||
|
#define WITH_NUMBER_SEPARATOR 1
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -10,9 +10,13 @@
|
||||||
#define STBI_FAILURE_USERMSG
|
#define STBI_FAILURE_USERMSG
|
||||||
#include "stb_image.h"
|
#include "stb_image.h"
|
||||||
|
|
||||||
|
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||||
|
#include "stb_image_write.h"
|
||||||
|
|
||||||
#define PL_MPEG_IMPLEMENTATION
|
#define PL_MPEG_IMPLEMENTATION
|
||||||
#include <pl_mpeg.h>
|
#include <pl_mpeg.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef EDITOR
|
#ifdef EDITOR
|
||||||
#include "editor.h"
|
#include "editor.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
|
|
||||||
#include "stb_truetype.h"
|
#include "stb_truetype.h"
|
||||||
#include "stb_rect_pack.h"
|
#include "stb_rect_pack.h"
|
||||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
|
||||||
#include "stb_image_write.h"
|
#include "stb_image_write.h"
|
||||||
|
|
||||||
static uint32_t VBO = 0;
|
static uint32_t VBO = 0;
|
||||||
|
|
|
@ -33,6 +33,14 @@ int id_from_gameobject(struct gameobject *go) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gameobject_apply(struct gameobject *go)
|
||||||
|
{
|
||||||
|
cpBodySetType(go->body, go->bodytype);
|
||||||
|
|
||||||
|
if (go->bodytype == CP_BODY_TYPE_DYNAMIC)
|
||||||
|
cpBodySetMass(go->body, go->mass);
|
||||||
|
}
|
||||||
|
|
||||||
static void gameobject_setpickcolor(struct gameobject *go)
|
static void gameobject_setpickcolor(struct gameobject *go)
|
||||||
{
|
{
|
||||||
float r = ((go->editor.id & 0x000000FF) >> 0) / 255.f;
|
float r = ((go->editor.id & 0x000000FF) >> 0) / 255.f;
|
||||||
|
@ -144,6 +152,8 @@ void gameobject_init(struct gameobject *go, FILE * fprefab)
|
||||||
cpBodySetType(go->body, go->bodytype);
|
cpBodySetType(go->body, go->bodytype);
|
||||||
cpBodySetUserData(go->body, go);
|
cpBodySetUserData(go->body, go);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int comp_n;
|
int comp_n;
|
||||||
fread(&comp_n, sizeof(int), 1, fprefab);
|
fread(&comp_n, sizeof(int), 1, fprefab);
|
||||||
arrfree(go->components);
|
arrfree(go->components);
|
||||||
|
|
|
@ -43,6 +43,7 @@ struct gameobject {
|
||||||
extern struct gameobject *gameobjects;
|
extern struct gameobject *gameobjects;
|
||||||
|
|
||||||
int MakeGameobject();
|
int MakeGameobject();
|
||||||
|
void gameobject_apply(struct gameobject *go);
|
||||||
void init_gameobjects();
|
void init_gameobjects();
|
||||||
void gameobject_delete(int id);
|
void gameobject_delete(int id);
|
||||||
void clear_gameobjects();
|
void clear_gameobjects();
|
||||||
|
|
|
@ -251,6 +251,10 @@ s7_pointer s7_sys_cmd(s7_scheme *sc, s7_pointer args) {
|
||||||
case 8:
|
case 8:
|
||||||
return s7_make_integer(sc, frame_fps());
|
return s7_make_integer(sc, frame_fps());
|
||||||
|
|
||||||
|
case 9: /* Clear the level out */
|
||||||
|
new_level();
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return args;
|
return args;
|
||||||
|
@ -496,6 +500,10 @@ s7_pointer s7_make_gameobject(s7_scheme *sc, s7_pointer args) {
|
||||||
go->f = s7_real(s7_cadddr(args));
|
go->f = s7_real(s7_cadddr(args));
|
||||||
go->e = s7_real(s7_list_ref(sc, args, 4));
|
go->e = s7_real(s7_list_ref(sc, args, 4));
|
||||||
|
|
||||||
|
YughInfo("static %d, dynamic %d, kinematic %d", CP_BODY_TYPE_STATIC, CP_BODY_TYPE_DYNAMIC, CP_BODY_TYPE_KINEMATIC);
|
||||||
|
|
||||||
|
gameobject_apply(go);
|
||||||
|
|
||||||
return s7_make_integer(sc, g);
|
return s7_make_integer(sc, g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,13 +62,7 @@
|
||||||
* ---------------- compile time switches ----------------
|
* ---------------- compile time switches ----------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined __has_include
|
#include "config.h"
|
||||||
# if __has_include ("mus-config.h")
|
|
||||||
# include "mus-config.h"
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
#include "mus-config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Your config file goes here, or just replace that #include line with the defines you need.
|
* Your config file goes here, or just replace that #include line with the defines you need.
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#include "yugine.h"
|
||||||
|
|
||||||
#include "render.h"
|
#include "render.h"
|
||||||
#include "camera.h"
|
#include "camera.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
@ -11,7 +13,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
#include "yugine.h"
|
|
||||||
#include "2dphysics.h"
|
#include "2dphysics.h"
|
||||||
|
|
||||||
#if ED
|
#if ED
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
(define (load_level s) (gen_cmd 0 s))
|
(define (load_level s) (gen_cmd 0 s))
|
||||||
(define (load_prefab s) (gen_cmd 1 s))
|
(define (load_prefab s) (gen_cmd 1 s))
|
||||||
(define (newobject) (sys_cmd 7))
|
(define (newobject) (sys_cmd 7))
|
||||||
|
(define (clear_level) (sys_cmd 9))
|
||||||
(define (fps) (sys_cmd 8))
|
(define (fps) (sys_cmd 8))
|
||||||
(define (quit) (sys_cmd 0))
|
(define (quit) (sys_cmd 0))
|
||||||
(define (exit) (quit))
|
(define (exit) (quit))
|
||||||
|
|
Loading…
Reference in a new issue