2021-11-30 21:29:18 -06:00
|
|
|
#ifndef EDITOR_H
|
|
|
|
#define EDITOR_H
|
|
|
|
|
2022-01-21 11:26:22 -06:00
|
|
|
#include <config.h>
|
2021-11-30 21:29:18 -06:00
|
|
|
#include <stdbool.h>
|
|
|
|
#include "resources.h"
|
|
|
|
|
|
|
|
|
|
|
|
struct mCamera;
|
|
|
|
|
|
|
|
#define ASSET_TYPE_NULL 0
|
|
|
|
#define ASSET_TYPE_IMAGE 1
|
|
|
|
#define ASSET_TYPE_TEXT 2
|
|
|
|
|
|
|
|
struct fileasset {
|
|
|
|
char *filename;
|
|
|
|
short extension_len;
|
|
|
|
short filename_len;
|
|
|
|
bool searched;
|
|
|
|
short type;
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct editorVars {
|
2022-07-06 17:17:06 -05:00
|
|
|
bool showStats;
|
|
|
|
bool showHierarchy;
|
|
|
|
bool showLighting;
|
|
|
|
bool showGameSettings;
|
|
|
|
bool showViewmode;
|
|
|
|
bool showDebugMenu;
|
|
|
|
bool showAssetMenu;
|
|
|
|
bool showREPL;
|
|
|
|
bool showExport;
|
|
|
|
bool showLevel;
|
2021-11-30 21:29:18 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
struct gameproject {
|
|
|
|
char name[127];
|
|
|
|
char path[MAXPATH];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Texture;
|
2022-02-06 10:14:57 -06:00
|
|
|
struct mSDLWindow;
|
2021-11-30 21:29:18 -06:00
|
|
|
|
|
|
|
void pickGameObject(int pickID);
|
|
|
|
int is_allowed_extension(const char *ext);
|
|
|
|
|
2022-01-19 16:43:21 -06:00
|
|
|
void editor_init(struct mSDLWindow *window);
|
2022-02-06 10:14:57 -06:00
|
|
|
void editor_input();
|
2021-11-30 21:29:18 -06:00
|
|
|
void editor_render();
|
|
|
|
int editor_wantkeyboard();
|
|
|
|
void editor_save();
|
|
|
|
void editor_makenewobject();
|
|
|
|
|
|
|
|
void editor_project_gui();
|
|
|
|
|
|
|
|
void editor_init_project(struct gameproject *gp);
|
|
|
|
void editor_save_projects();
|
|
|
|
void editor_load_projects();
|
|
|
|
void editor_proj_select_gui();
|
|
|
|
void editor_import_project(char *path);
|
|
|
|
void editor_make_project(char *path);
|
|
|
|
|
|
|
|
void editor_selectasset(struct fileasset *asset);
|
|
|
|
void editor_selectasset_str(char *path);
|
|
|
|
void editor_asset_gui(struct fileasset *asset);
|
|
|
|
void editor_asset_tex_gui(struct Texture *tex);
|
|
|
|
void editor_asset_text_gui(char *text);
|
|
|
|
|
|
|
|
void editor_level_btn(char *level);
|
|
|
|
void editor_prefab_btn(char *prefab);
|
|
|
|
|
|
|
|
void game_start();
|
|
|
|
void game_resume();
|
|
|
|
void game_stop();
|
|
|
|
void game_pause();
|
|
|
|
|
|
|
|
void get_levels();
|
|
|
|
|
2022-02-06 10:14:57 -06:00
|
|
|
struct mLight;
|
|
|
|
struct mPointLight;
|
|
|
|
struct mSpotLight;
|
|
|
|
struct mStaticActor;
|
|
|
|
struct mTransform;
|
|
|
|
struct mGameObject;
|
|
|
|
struct mSprite;
|
|
|
|
struct phys2d_circle;
|
|
|
|
struct phys2d_segment;
|
|
|
|
struct phys2d_box;
|
|
|
|
struct phys2d_edge;
|
|
|
|
struct phys2d_shape;
|
|
|
|
struct phys2d_poly;
|
|
|
|
struct flipper;
|
|
|
|
|
2021-11-30 21:29:18 -06:00
|
|
|
///////// Object GUIs
|
|
|
|
void light_gui(struct mLight *light);
|
|
|
|
void pointlight_gui(struct mPointLight *light);
|
|
|
|
void spotlight_gui(struct mSpotLight *spot);
|
|
|
|
void staticactor_gui(struct mStaticActor *sa);
|
|
|
|
void trans_drawgui(struct mTransform *T);
|
|
|
|
void object_gui(struct mGameObject *go);
|
|
|
|
void sprite_gui(struct mSprite *sprite);
|
|
|
|
void circle_gui(struct phys2d_circle *circle);
|
|
|
|
void segment_gui(struct phys2d_segment *seg);
|
|
|
|
void box_gui(struct phys2d_box *box);
|
|
|
|
void poly_gui(struct phys2d_poly *poly);
|
|
|
|
void edge_gui(struct phys2d_edge *edge);
|
|
|
|
void shape_gui(struct phys2d_shape *shape);
|
|
|
|
void pinball_flipper_gui(struct flipper *flip);
|
|
|
|
|
|
|
|
int obj_gui_hierarchy(struct mGameObject *selected);
|
|
|
|
|
|
|
|
#endif
|