add support for fwk/v4k plugins

main
Dominik Madarász 2024-02-11 15:34:47 +01:00
parent f23b2b6e08
commit 86cbafa06c
6 changed files with 39 additions and 11 deletions

View File

@ -606,14 +606,34 @@ if "%1"=="addons[" (
shift
) else (
set "addon_names=%1 %addon_names%"
set "addon_includes=-Idepot\deps\%1 %addon_includes%"
if exist "depot\deps\%1\%1.cpp" (
set "addons=depot\deps\%1\%1.cpp %addons%"
) else (
set "addons=depot\deps\%1\%1.c %addons%"
rem depot folder
if exist "depot\deps\%1" (
set "addon_includes=-Idepot\deps\%1 %addon_includes%"
if exist "depot\deps\%1\%1.cpp" (
set "addons=depot\deps\%1\%1.cpp %addons%"
) else (
set "addons=depot\deps\%1\%1.c %addons%"
)
if exist "depot\deps\%1\include" (
set "addon_includes=-Idepot\deps\%1\include %addon_includes%"
)
)
if exist "depot\deps\%1\include" (
set "addon_includes=-Idepot\deps\%1\include %addon_includes%"
if exist "plugins\%1" (
set "addon_includes=-Iplugins\%1 %addon_includes%"
if exist "plugins\%1\%1.cpp" (
set "addons=plugins\%1\%1.cpp %addons%"
) else (
set "addons=plugins\%1\%1.c %addons%"
)
if exist "plugins\%1\plugin.cpp" (
set "addons=plugins\%1\plugin.cpp %addons%"
) else (
set "addons=plugins\%1\plugin.c %addons%"
)
if exist "plugins\%1\include" (
set "addon_includes=-Iplugins\%1\include %addon_includes%"
)
)
shift && goto parse_addons
)

View File

@ -681,9 +681,9 @@ typedef struct font_metrics_t {
void font_goto(float x, float y);
vec2 font_print(const char *text);
vec2 font_clip(const char *text, vec4 rect);
const char* font_wrap(const char *text, float max_width);
vec2 font_rect(const char *text);
font_metrics_t font_metrics(const char *text);
const char* font_wrap(const char *text, float max_width);
void* font_colorize(const char *text, const char *comma_types, const char *comma_keywords);
vec2 font_highlight(const char *text, const void *colors);
void ui_font();

2
engine/fwk.h 100644
View File

@ -0,0 +1,2 @@
// compatibility header for fwk plugins
#include "v4k.h"

View File

@ -16147,10 +16147,12 @@ API vec2 font_xy();
API void font_goto(float x, float y);
API vec2 font_print(const char *text);
API vec2 font_clip(const char *text, vec4 rect);
API const char* font_wrap(const char *text, float max_width);
API vec2 font_rect(const char *text);
API font_metrics_t font_metrics(const char *text);
// utilities
API const char* font_wrap(const char *text, float max_width);
// syntax highlighting
API void* font_colorize(const char *text, const char *comma_types, const char *comma_keywords); // comma separated tokens. expensive, please cache result.
API vec2 font_highlight(const char *text, const void *colors);

View File

@ -90,10 +90,12 @@ API vec2 font_xy();
API void font_goto(float x, float y);
API vec2 font_print(const char *text);
API vec2 font_clip(const char *text, vec4 rect);
API const char* font_wrap(const char *text, float max_width);
API vec2 font_rect(const char *text);
API font_metrics_t font_metrics(const char *text);
// utilities
API const char* font_wrap(const char *text, float max_width);
// syntax highlighting
API void* font_colorize(const char *text, const char *comma_types, const char *comma_keywords); // comma separated tokens. expensive, please cache result.
API vec2 font_highlight(const char *text, const void *colors);

View File

@ -2214,10 +2214,12 @@ API vec2 font_xy();
API void font_goto(float x, float y);
API vec2 font_print(const char *text);
API vec2 font_clip(const char *text, vec4 rect);
API const char* font_wrap(const char *text, float max_width);
API vec2 font_rect(const char *text);
API font_metrics_t font_metrics(const char *text);
// utilities
API const char* font_wrap(const char *text, float max_width);
// syntax highlighting
API void* font_colorize(const char *text, const char *comma_types, const char *comma_keywords); // comma separated tokens. expensive, please cache result.
API vec2 font_highlight(const char *text, const void *colors);