disable steamsdk codebase

main
Dominik Madarász 2024-08-07 14:31:07 +02:00
parent abd6bd3c68
commit 6997e7e14f
9 changed files with 1437 additions and 1858 deletions

View File

@ -1830,12 +1830,6 @@ typedef struct skinned_t {
float scale; float scale;
} skinned_t; } skinned_t;
guiskin_t gui_skinned(const char *asefile, float scale); guiskin_t gui_skinned(const char *asefile, float scale);
bool steam_init(unsigned app_id);
void steam_tick();
void steam_trophy(const char *trophy_id, bool redeem);
void steam_screenshot();
void steam_destroy();
int ui_steam();
void* thread( int (*thread_func)(void* user_data), void* user_data ); void* thread( int (*thread_func)(void* user_data), void* user_data );
void thread_destroy( void *thd ); void thread_destroy( void *thd );
int argc(); int argc();

File diff suppressed because it is too large Load Diff

View File

@ -2414,6 +2414,7 @@ typedef struct {
intptr_t SteamClient(); intptr_t SteamClient();
#ifndef STEAM_API
#define STEAM_API(X) \ #define STEAM_API(X) \
X(bool,SteamAPI_Init,()) \ X(bool,SteamAPI_Init,()) \
X(void,SteamAPI_Shutdown,()) \ X(void,SteamAPI_Shutdown,()) \
@ -3113,3 +3114,4 @@ X(void*,SteamInternal_CreateInterface,(const char *ver)) \
X(bool,SteamAPI_IsSteamRunning,()) \ X(bool,SteamAPI_IsSteamRunning,()) \
X(bool,SteamAPI_InitSafe,()) \ X(bool,SteamAPI_InitSafe,()) \
X(void,SteamAPI_RunCallbacks,()) X(void,SteamAPI_RunCallbacks,())
#endif

View File

@ -152,8 +152,6 @@
{{FILE:v4k_sprite.c}} {{FILE:v4k_sprite.c}}
{{FILE:v4k_steam.c}}
{{FILE:v4k_system.c}} {{FILE:v4k_system.c}}
{{FILE:v4k_time.c}} {{FILE:v4k_time.c}}

View File

@ -147,8 +147,6 @@ extern "C" {
{{FILE:v4k_sprite.h}} {{FILE:v4k_sprite.h}}
{{FILE:v4k_gui.h}} {{FILE:v4k_gui.h}}
{{FILE:v4k_steam.h}}
{{FILE:v4k_system.h}} {{FILE:v4k_system.h}}
{{FILE:v4k_time.h}} {{FILE:v4k_time.h}}

View File

@ -225,6 +225,7 @@ static char *ui_filter = 0;
//#define LM_DEBUG_INTERPOLATION //#define LM_DEBUG_INTERPOLATION
{{FILE:3rd_lightmapper.h}} {{FILE:3rd_lightmapper.h}}
#define STEAM_API() //@hack
{{FILE:3rd_sdk_steam.h}} {{FILE:3rd_sdk_steam.h}}
#endif // V4K_3RD #endif // V4K_3RD

View File

@ -1,12 +1,12 @@
/* game framework (3rd libs) /* game framework (3rd libs)
* - rlyeh, public domain * - rlyeh, public domain
*/ */
#ifdef V4K_3RD #ifdef V4K_3RD
#define GLAD_GL_IMPLEMENTATION // glad #define GLAD_GL_IMPLEMENTATION // glad
#endif #endif
#line 1 "3rd_glad.h" #line 1 "3rd_glad.h"
#ifndef __EMSCRIPTEN__ #ifndef __EMSCRIPTEN__
#ifndef _GNU_SOURCE // juicy linux headers #ifndef _GNU_SOURCE // juicy linux headers
@ -11687,8 +11687,8 @@ int gladLoadGL( GLADloadfunc load) {
#endif /* GLAD_GL_IMPLEMENTATION */ #endif /* GLAD_GL_IMPLEMENTATION */
#endif /* __EMSCRIPTEN__ */ #endif /* __EMSCRIPTEN__ */
#line 0 #line 0
#line 1 "3rd_icon_md.h" #line 1 "3rd_icon_md.h"
// Generated by https://github.com/juliettef/IconFontCppHeaders script GenerateIconFontCppHeaders.py for languages C and C++ // Generated by https://github.com/juliettef/IconFontCppHeaders script GenerateIconFontCppHeaders.py for languages C and C++
// from https://github.com/google/material-design-icons/raw/master/font/MaterialIcons-Regular.codepoints // from https://github.com/google/material-design-icons/raw/master/font/MaterialIcons-Regular.codepoints
// for use with https://github.com/google/material-design-icons/blob/master/font/MaterialIcons-Regular.ttf // for use with https://github.com/google/material-design-icons/blob/master/font/MaterialIcons-Regular.ttf
@ -13935,104 +13935,104 @@ int gladLoadGL( GLADloadfunc load) {
#define ICON_MD_ZOOM_OUT "\xee\xa4\x80" // U+e900 #define ICON_MD_ZOOM_OUT "\xee\xa4\x80" // U+e900
#define ICON_MD_ZOOM_OUT_MAP "\xee\x95\xab" // U+e56b #define ICON_MD_ZOOM_OUT_MAP "\xee\x95\xab" // U+e56b
#endif // ICON_MD_H #endif // ICON_MD_H
#line 0 #line 0
#ifdef V4K_3RD #ifdef V4K_3RD
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// 3rd party libs // 3rd party libs
#define ARCHIVE_C // archive.c #define ARCHIVE_C // archive.c
#define BASE64_C // base64.c #define BASE64_C // base64.c
#define COMPRESS_C // compress.c #define COMPRESS_C // compress.c
#define ENET_IMPLEMENTATION // enet #define ENET_IMPLEMENTATION // enet
#define GJK_C // gjk #define GJK_C // gjk
#define _GLFW_IMPLEMENTATION // glfw337 #define _GLFW_IMPLEMENTATION // glfw337
#define GLFW_INCLUDE_NONE // glfw337 #define GLFW_INCLUDE_NONE // glfw337
#define HTTPS_IMPLEMENTATION // https #define HTTPS_IMPLEMENTATION // https
#define JO_MPEG_COMPONENTS 3 // jo_mpeg #define JO_MPEG_COMPONENTS 3 // jo_mpeg
#define JSON5_C // json5 #define JSON5_C // json5
#define LUA_IMPL // lua544 #define LUA_IMPL // lua544
#define LUA_USE_POPEN 1 // for lite editor #define LUA_USE_POPEN 1 // for lite editor
#define MINIAUDIO_IMPLEMENTATION // miniaudio #define MINIAUDIO_IMPLEMENTATION // miniaudio
#define MA_NO_FLAC // miniaudio #define MA_NO_FLAC // miniaudio
#define NK_GLFW_GL3_IMPLEMENTATION // nuklear #define NK_GLFW_GL3_IMPLEMENTATION // nuklear
#define NK_IMPLEMENTATION // nuklear #define NK_IMPLEMENTATION // nuklear
#define NK_INCLUDE_DEFAULT_ALLOCATOR // nuklear #define NK_INCLUDE_DEFAULT_ALLOCATOR // nuklear
#define NK_INCLUDE_DEFAULT_FONT // nuklear #define NK_INCLUDE_DEFAULT_FONT // nuklear
#define NK_INCLUDE_FIXED_TYPES // nuklear #define NK_INCLUDE_FIXED_TYPES // nuklear
#define NK_INCLUDE_FONT_BAKING // nuklear #define NK_INCLUDE_FONT_BAKING // nuklear
#define NK_INCLUDE_STANDARD_IO // nuklear #define NK_INCLUDE_STANDARD_IO // nuklear
#define NK_INCLUDE_STANDARD_VARARGS // nuklear #define NK_INCLUDE_STANDARD_VARARGS // nuklear
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT // nuklear #define NK_INCLUDE_VERTEX_BUFFER_OUTPUT // nuklear
#define NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS 64 // nuklear #define NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS 64 // nuklear
#define NK_KEYSTATE_BASED_INPUT // nuklear #define NK_KEYSTATE_BASED_INPUT // nuklear
#define PL_MPEG_IMPLEMENTATION // pl_mpeg #define PL_MPEG_IMPLEMENTATION // pl_mpeg
#define STB_IMAGE_IMPLEMENTATION // stbi #define STB_IMAGE_IMPLEMENTATION // stbi
#define STB_IMAGE_WRITE_IMPLEMENTATION // stbi_write #define STB_IMAGE_WRITE_IMPLEMENTATION // stbi_write
#define STB_SPRINTF_IMPLEMENTATION // stb_sprintf #define STB_SPRINTF_IMPLEMENTATION // stb_sprintf
#define STB_SPRINTF_NOUNALIGNED // stb_sprintf #define STB_SPRINTF_NOUNALIGNED // stb_sprintf
#define STS_MIXER_IMPLEMENTATION // sts_mixer #define STS_MIXER_IMPLEMENTATION // sts_mixer
#define SIMPLEX_C // simplex #define SIMPLEX_C // simplex
#define SWRAP_IMPLEMENTATION // swrap #define SWRAP_IMPLEMENTATION // swrap
#define SWRAP_STATIC // swrap #define SWRAP_STATIC // swrap
#define THREAD_IMPLEMENTATION // thread #define THREAD_IMPLEMENTATION // thread
#define TFD_IMPLEMENTATION // tinyfiledialogs #define TFD_IMPLEMENTATION // tinyfiledialogs
#define BQ_PLATFORM_IMPLEMENTATION // websocket #define BQ_PLATFORM_IMPLEMENTATION // websocket
#define BQ_WEBSOCKET_IMPLEMENTATION // websocket #define BQ_WEBSOCKET_IMPLEMENTATION // websocket
#define XML_C // xml #define XML_C // xml
#ifdef __APPLE__ #ifdef __APPLE__
#define MA_NO_RUNTIME_LINKING // miniaudio osx #define MA_NO_RUNTIME_LINKING // miniaudio osx
#define _GLFW_COCOA // glfw osx #define _GLFW_COCOA // glfw osx
#elif defined _WIN32 #elif defined _WIN32
#define _GLFW_WIN32 // glfw win32 #define _GLFW_WIN32 // glfw win32
#else #else
#define _GLFW_X11 // glfw linux, also _GLFW_OSMESA or _GLFW_WAYLAND #define _GLFW_X11 // glfw linux, also _GLFW_OSMESA or _GLFW_WAYLAND
#endif #endif
#if defined __TINYC__ && defined _WIN32 #if defined __TINYC__ && defined _WIN32
#define MAPVK_VSC_TO_VK 1 #define MAPVK_VSC_TO_VK 1
#define MAPVK_VK_TO_VSC 0 #define MAPVK_VK_TO_VSC 0
#define IPV6_V6ONLY 27 #define IPV6_V6ONLY 27
#define _WIN32_WINNT_VISTA 0 #define _WIN32_WINNT_VISTA 0
#define _WIN32_WINNT_WINXP 0 #define _WIN32_WINNT_WINXP 0
#define _WIN32_WINNT_WIN7 0 #define _WIN32_WINNT_WIN7 0
#endif #endif
#ifdef __TINYC__ #ifdef __TINYC__
#define STBI_NO_SIMD #define STBI_NO_SIMD
// no uint128_t (3rd_https.h) // no uint128_t (3rd_https.h)
char* strtok_s( char* strtok_s(
char* str, char* str,
const char* delimiters, const char* delimiters,
char** context char** context
); );
#endif #endif
#if defined __clang__ && defined _WIN32 #if defined __clang__ && defined _WIN32
int execv(const char *path, char *const argv[]); int execv(const char *path, char *const argv[]);
#elif (is(tcc) /*|| defined __clang__*/) && defined _WIN32 #elif (is(tcc) /*|| defined __clang__*/) && defined _WIN32
int execv(const char *path, char *const argv[]); int execv(const char *path, char *const argv[]);
errno_t strerror_s( errno_t strerror_s(
char *buffer, char *buffer,
size_t sizeInBytes, size_t sizeInBytes,
int errnum int errnum
); );
typedef int socklen_t; typedef int socklen_t;
#if is(tcc) #if is(tcc)
#define restrict #define restrict
const char *inet_ntop(int af, const void *restrict src, const char *inet_ntop(int af, const void *restrict src,
char *restrict dst, socklen_t size); char *restrict dst, socklen_t size);
int inet_pton(int af, const char *restrict src, void *restrict dst); int inet_pton(int af, const char *restrict src, void *restrict dst);
#endif #endif
errno_t fopen_s( errno_t fopen_s(
FILE** pFile, FILE** pFile,
const char *filename, const char *filename,
const char *mode const char *mode
); );
#endif #endif
//--- //---
#line 1 "3rd_glfw3.h" #line 1 "3rd_glfw3.h"
#ifndef __EMSCRIPTEN__ #ifndef __EMSCRIPTEN__
// forked from https://github.com/SasLuca/glfw-single-header (CC0-1.0 licensed) // forked from https://github.com/SasLuca/glfw-single-header (CC0-1.0 licensed)
@ -53227,10 +53227,10 @@ uint32_t _glfwKeySym2Unicode(unsigned int keysym)
#endif #endif
#endif /* __EMSCRIPTEN__ */ #endif /* __EMSCRIPTEN__ */
#line 0 #line 0
#undef timeGetTime #undef timeGetTime
//--- //---
#line 1 "3rd_swrap.h" #line 1 "3rd_swrap.h"
// https://github.com/BareRose/swrap/blob/master/swrap.h // https://github.com/BareRose/swrap/blob/master/swrap.h
/* /*
@ -53521,9 +53521,9 @@ SWDEF int swrapMultiSelect (int* socks, size_t socks_size, double timeout) {
#endif //SWRAP_IMPLEMENTATION #endif //SWRAP_IMPLEMENTATION
#endif //SWRAP_H #endif //SWRAP_H
#line 0 #line 0
//--- //---
#line 1 "3rd_jo_mp1.h" #line 1 "3rd_jo_mp1.h"
/* public domain Simple, Minimalistic MPEG Layer 1 decoder - http://jonolick.com /* public domain Simple, Minimalistic MPEG Layer 1 decoder - http://jonolick.com
* *
* Revision History: * Revision History:
@ -53931,10 +53931,10 @@ bool jo_read_mp1(const void *input, int inputSize, short **output_, int *outputS
#endif // JO_MP1_HEADER_FILE_ONLY #endif // JO_MP1_HEADER_FILE_ONLY
#line 0 #line 0
#define get_bits stb_vorbis_get_bits #define get_bits stb_vorbis_get_bits
#define error stb_vorbis_error #define error stb_vorbis_error
#line 1 "3rd_stb_vorbis.h" #line 1 "3rd_stb_vorbis.h"
// Ogg Vorbis audio decoder - v1.22 - public domain // Ogg Vorbis audio decoder - v1.22 - public domain
// http://nothings.org/stb_vorbis/ // http://nothings.org/stb_vorbis/
// //
@ -59519,10 +59519,10 @@ 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.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*/ */
#line 0 #line 0
#undef error #undef error
#undef DEBUG #undef DEBUG
#line 1 "3rd_sts_mixer.h" #line 1 "3rd_sts_mixer.h"
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// sts_mixer.h - v0.02 // sts_mixer.h - v0.02
// written 2016 by Sebastian Steinhauer // written 2016 by Sebastian Steinhauer
@ -60058,8 +60058,8 @@ int main(int argc, char *argv[]) {
For more information, please refer to <http://unlicense.org/> For more information, please refer to <http://unlicense.org/>
*/ */
#line 0 #line 0
#line 1 "3rd_miniaudio.h" #line 1 "3rd_miniaudio.h"
/* /*
Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file. Audio playback and capture library. Choice of public domain or MIT-0. See license statements at the end of this file.
miniaudio - v0.11.18 - 2023-08-07 miniaudio - v0.11.18 - 2023-08-07
@ -152597,14 +152597,14 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#line 0 #line 0
//--- //---
#undef L #undef L
#undef C #undef C
#undef R #undef R
#define error l_error #define error l_error
#define panic l_panic #define panic l_panic
#line 1 "3rd_lua.h" #line 1 "3rd_lua.h"
/* /*
minilua.h -- Lua in a single header minilua.h -- Lua in a single header
Project URL: https://github.com/edubart/minilua Project URL: https://github.com/edubart/minilua
@ -181845,12 +181845,12 @@ int main (int argc, char **argv) {
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. SOFTWARE.
*/ */
#line 0 #line 0
#undef cast #undef cast
#undef G #undef G
//--- //---
#define LUAFFI_C #define LUAFFI_C
#line 1 "3rd_luaffi.h" #line 1 "3rd_luaffi.h"
#ifndef LUAFFI_H #ifndef LUAFFI_H
#define LUAFFI_H #define LUAFFI_H
@ -194367,9 +194367,9 @@ int luaopen_ffi(lua_State* L)
#endif #endif
#line 0 #line 0
//--- //---
#line 1 "3rd_stb_image.h" #line 1 "3rd_stb_image.h"
/* stb_image - v2.28 - public domain image loader - http://nothings.org/stb /* stb_image - v2.28 - public domain image loader - http://nothings.org/stb
no warranty implied; use at your own risk no warranty implied; use at your own risk
@ -202357,8 +202357,8 @@ 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.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*/ */
#line 0 #line 0
#line 1 "3rd_stb_image_write.h" #line 1 "3rd_stb_image_write.h"
/* stb_image_write - v1.16 - public domain - http://nothings.org/stb /* stb_image_write - v1.16 - public domain - http://nothings.org/stb
writes out PNG/BMP/TGA/JPEG/HDR images to C stdio - Sean Barrett 2010-2015 writes out PNG/BMP/TGA/JPEG/HDR images to C stdio - Sean Barrett 2010-2015
no warranty implied; use at your own risk no warranty implied; use at your own risk
@ -204083,14 +204083,14 @@ 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.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*/ */
#line 0 #line 0
//--- //---
#undef freelist #undef freelist
#define STBTT_malloc(x,u) ((void)(u),MALLOC(x)) #define STBTT_malloc(x,u) ((void)(u),MALLOC(x))
#define STBTT_free(x,u) ((void)(u),FREE(x)) #define STBTT_free(x,u) ((void)(u),FREE(x))
#define NK_ASSERT ASSERT #define NK_ASSERT ASSERT
#define NK_DTOA(s,n) strcpy(s, va("%f", n)) // override cos built-in nk_dtoa() will freeze while parsing UINT_MAX otherwise #define NK_DTOA(s,n) strcpy(s, va("%f", n)) // override cos built-in nk_dtoa() will freeze while parsing UINT_MAX otherwise
#line 1 "3rd_nuklear.h" #line 1 "3rd_nuklear.h"
/* /*
/// # Nuklear /// # Nuklear
/// ![](https://cloud.githubusercontent.com/assets/8057201/11761525/ae06f0ca-a0c6-11e5-819d-5610b25f6ef4.gif) /// ![](https://cloud.githubusercontent.com/assets/8057201/11761525/ae06f0ca-a0c6-11e5-819d-5610b25f6ef4.gif)
@ -234461,8 +234461,8 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
/// in libraries and brought me to create some of my own. Finally Apoorva Joshi /// in libraries and brought me to create some of my own. Finally Apoorva Joshi
/// for his single header file packer. /// for his single header file packer.
*/ */
#line 0 #line 0
#line 1 "3rd_nuklear_glfw_gl3.h" #line 1 "3rd_nuklear_glfw_gl3.h"
/* /*
* Nuklear - 1.32.0 - public domain * Nuklear - 1.32.0 - public domain
@ -235015,9 +235015,9 @@ void nk_glfw3_shutdown(struct nk_glfw* glfw)
#endif #endif
#endif #endif
#line 0 #line 0
static char *ui_filter = 0; static char *ui_filter = 0;
#line 1 "3rd_nuklear_filebrowser.h" #line 1 "3rd_nuklear_filebrowser.h"
// file browser for nuklear, based on https://github.com/vurtun/nuklear/blob/master/example/file_browser.c (public domain) // file browser for nuklear, based on https://github.com/vurtun/nuklear/blob/master/example/file_browser.c (public domain)
// - rlyeh, public domain // - rlyeh, public domain
// //
@ -235501,16 +235501,16 @@ static struct nk_image icon_load_rect(unsigned id, unsigned w, unsigned h, unsig
} }
nk_end(); nk_end();
*/ */
#line 0 #line 0
//--- //---
#ifdef ENABLE_ASSIMP #ifdef ENABLE_ASSIMP
//{{FILE/*:*/3rd_assimp.h}} //{{FILE/*:*/3rd_assimp.h}}
//#include "3rd_assimp/cimport.h" //#include "3rd_assimp/cimport.h"
//#include "3rd_assimp/scene.h" //#include "3rd_assimp/scene.h"
//#include "3rd_assimp/postprocess.h" //#include "3rd_assimp/postprocess.h"
//#pragma comment(lib, "3rd/3rd_assimp/x64/assimp") //#pragma comment(lib, "3rd/3rd_assimp/x64/assimp")
#endif #endif
#line 1 "3rd_json5.h" #line 1 "3rd_json5.h"
// JSON5 + SJSON parser module // JSON5 + SJSON parser module
// //
// License: // License:
@ -235951,8 +235951,8 @@ int main() {
#endif #endif
#endif // JSON5_C #endif // JSON5_C
#line 0 #line 0
#line 1 "3rd_gjk.h" #line 1 "3rd_gjk.h"
// GJK distance algorithm. original code by @vurtun and @randygaul, public domain. // GJK distance algorithm. original code by @vurtun and @randygaul, public domain.
// [src] https://gist.github.com/vurtun/29727217c269a2fbf4c0ed9a1d11cb40 // [src] https://gist.github.com/vurtun/29727217c269a2fbf4c0ed9a1d11cb40
// - rlyeh, public domain. // - rlyeh, public domain.
@ -236560,8 +236560,8 @@ gjk_result gjk_quad(float a_radius, float b_radius) {
} }
#endif #endif
#line 0 #line 0
#line 1 "3rd_compress.h" #line 1 "3rd_compress.h"
// compress.c de/compressors into a single-file header // compress.c de/compressors into a single-file header
// - rlyeh, public domain // - rlyeh, public domain
// //
@ -247401,8 +247401,8 @@ unsigned file_decode(FILE* in, FILE* out, FILE *logfile) { // multi decoder
} }
#endif // COMPRESS_C #endif // COMPRESS_C
#line 0 #line 0
#line 1 "3rd_archive.h" #line 1 "3rd_archive.h"
// archive.c pak/zip/tar/dir archivers // archive.c pak/zip/tar/dir archivers
// - rlyeh, public domain // - rlyeh, public domain
@ -249027,11 +249027,11 @@ int main( int argc, char **argv ) {
#define main main__ #define main main__
#endif //DIR_DEMO #endif //DIR_DEMO
#endif //DIR_C #endif //DIR_C
#line 0 #line 0
#if is(win32) #if is(win32)
#include <mmsystem.h> // timeapi.h #include <mmsystem.h> // timeapi.h
#endif #endif
#line 1 "3rd_thread.h" #line 1 "3rd_thread.h"
/* /*
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Licensing information can be found at the end of the file. Licensing information can be found at the end of the file.
@ -250760,8 +250760,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*/ */
#line 0 #line 0
#line 1 "3rd_plmpeg.h" #line 1 "3rd_plmpeg.h"
/* /*
PL_MPEG - MPEG1 Video decoder, MP2 Audio decoder, MPEG-PS demuxer PL_MPEG - MPEG1 Video decoder, MP2 Audio decoder, MPEG-PS demuxer
@ -255026,8 +255026,8 @@ void plm_audio_matrix_transform(int s[32][3], int ss, float *d, int dp) {
#endif // PL_MPEG_IMPLEMENTATION #endif // PL_MPEG_IMPLEMENTATION
#line 0 #line 0
#line 1 "3rd_jo_mpeg.h" #line 1 "3rd_jo_mpeg.h"
/* public domain Simple, Minimalistic, No Allocations MPEG writer - http://jonolick.com /* public domain Simple, Minimalistic, No Allocations MPEG writer - http://jonolick.com
* *
* Latest revisions: * Latest revisions:
@ -255292,10 +255292,10 @@ void jo_write_mpeg(FILE *fp, const unsigned char *bgrx, int width, int height, i
fwrite("\x00\x00\x01\xb7", 4, 1, fp); // End of Sequence fwrite("\x00\x00\x01\xb7", 4, 1, fp); // End of Sequence
} }
#endif #endif
#line 0 #line 0
//#define _RTL_RUN_ONCE _RTL_RUN_ONCE2 // __MINGW64__ //#define _RTL_RUN_ONCE _RTL_RUN_ONCE2 // __MINGW64__
#undef I #undef I
#line 1 "3rd_https.h" #line 1 "3rd_https.h"
/* /*
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Licensing information can be found at the end of the file. Licensing information can be found at the end of the file.
@ -302275,10 +302275,10 @@ int main() {
https_release(h); https_release(h);
} }
#endif #endif
#line 0 #line 0
#undef F2 #undef F2
#undef F3 #undef F3
#line 1 "3rd_enet.h" #line 1 "3rd_enet.h"
/** /**
* include/enet.h - a Single-Header auto-generated variant of enet.h library. * include/enet.h - a Single-Header auto-generated variant of enet.h library.
* *
@ -308389,9 +308389,9 @@ extern "C" {
#endif // ENET_IMPLEMENTATION #endif // ENET_IMPLEMENTATION
#endif // ENET_INCLUDE_H #endif // ENET_INCLUDE_H
#line 0 #line 0
#define tls_init tls_init2 #define tls_init tls_init2
#line 1 "3rd_bq_websocket.h" #line 1 "3rd_bq_websocket.h"
/* /*
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
This software is available under 2 licenses -- choose whichever you prefer. This software is available under 2 licenses -- choose whichever you prefer.
@ -314753,8 +314753,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#endif // BQ_PLATFORM_IMPLEMENTATION #endif // BQ_PLATFORM_IMPLEMENTATION
#line 0 #line 0
#line 1 "3rd_simplex.h" #line 1 "3rd_simplex.h"
/** 1D, 2D, 3D and 4D float Perlin Simplex noise */ /** 1D, 2D, 3D and 4D float Perlin Simplex noise */
/** Original code, stefan gustavson (PD). */ /** Original code, stefan gustavson (PD). */
@ -315236,8 +315236,8 @@ float snoise4(float x, float y, float z, float w) {
#undef G4 #undef G4
#endif #endif
#line 0 #line 0
#line 1 "3rd_tfd.h" #line 1 "3rd_tfd.h"
/* If you are using a C++ compiler to compile tinyfiledialogs.c (maybe renamed with an extension ".cpp") /* If you are using a C++ compiler to compile tinyfiledialogs.c (maybe renamed with an extension ".cpp")
then comment out << extern "C" >> bellow in this header file) */ then comment out << extern "C" >> bellow in this header file) */
@ -323296,8 +323296,8 @@ tinyfd_messageBox("The selected hexcolor is",
#endif #endif
#endif // TFD_IMPLEMENTATION #endif // TFD_IMPLEMENTATION
#line 0 #line 0
#line 1 "3rd_stb_sprintf.h" #line 1 "3rd_stb_sprintf.h"
// stb_sprintf - v1.10 - public domain snprintf() implementation // stb_sprintf - v1.10 - public domain snprintf() implementation
// originally by Jeff Roberts / RAD Game Tools, 2015/10/20 // originally by Jeff Roberts / RAD Game Tools, 2015/10/20
// http://github.com/nothings/stb // http://github.com/nothings/stb
@ -325204,9 +325204,9 @@ 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.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*/ */
#line 0 #line 0
#define g g2 #define g g2
#line 1 "3rd_xml.h" #line 1 "3rd_xml.h"
// original xml.h/xml.c files by tor andersson, public domain // original xml.h/xml.c files by tor andersson, public domain
#ifndef xml_h #ifndef xml_h
@ -325735,9 +325735,9 @@ struct xml *xml_parse(char *s, int preserve_white, char **errorp)
} }
#endif #endif
#line 0 #line 0
#undef g #undef g
#line 1 "3rd_polychop.h" #line 1 "3rd_polychop.h"
/* Progressive Mesh type Polygon Reduction Algorithm /* Progressive Mesh type Polygon Reduction Algorithm
* *
* 1998: Original version by Stan Melax (c) 1998 * 1998: Original version by Stan Melax (c) 1998
@ -326147,18 +326147,18 @@ API void ProgressiveMesh(int vert_n, int vert_stride, const float *v, int tri_n,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#line 0 #line 0
#define expr expr2 // 3rd_lua.h #define expr expr2 // 3rd_lua.h
#define EVAL_EXTEND_CONSTANTS \ #define EVAL_EXTEND_CONSTANTS \
for( int vk = input_enum(id), *once = &vk; once; once = 0) \ for( int vk = input_enum(id), *once = &vk; once; once = 0) \
if( vk >= 0 ) push(ev, vk); if( vk >= 0 ) push(ev, vk);
#define EVAL_EXTEND_FUNCTIONS \ #define EVAL_EXTEND_FUNCTIONS \
/**/ if(!strcmp(id, "input") && nargs ==1) push(ev, input(pop(ev))); \ /**/ if(!strcmp(id, "input") && nargs ==1) push(ev, input(pop(ev))); \
else if(!strcmp(id, "down") && nargs ==1) push(ev, input_down(pop(ev))); \ else if(!strcmp(id, "down") && nargs ==1) push(ev, input_down(pop(ev))); \
else if(!strcmp(id, "held") && nargs ==1) push(ev, input_held(pop(ev))); \ else if(!strcmp(id, "held") && nargs ==1) push(ev, input_held(pop(ev))); \
else if(!strcmp(id, "up") && nargs ==1) push(ev, input_up(pop(ev))); \ else if(!strcmp(id, "up") && nargs ==1) push(ev, input_up(pop(ev))); \
else if(!strcmp(id, "idle") && nargs ==1) push(ev, input_idle(pop(ev))); else if(!strcmp(id, "idle") && nargs ==1) push(ev, input_idle(pop(ev)));
#line 1 "3rd_eval.h" #line 1 "3rd_eval.h"
/* A mathematical expression evaluator. /* A mathematical expression evaluator.
* It uses a recursive descent parser internally. * It uses a recursive descent parser internally.
* Author: Werner Stoop * Author: Werner Stoop
@ -326667,8 +326667,8 @@ int main() {
assert(~puts("Ok") ); assert(~puts("Ok") );
} }
#endif #endif
#line 0 #line 0
#line 1 "3rd_luadebugger.h" #line 1 "3rd_luadebugger.h"
/* /*
Copyright (c) 2023 Scott Lembcke and Howling Moon Software Copyright (c) 2023 Scott Lembcke and Howling Moon Software
@ -328147,8 +328147,8 @@ int dbg_pcall(lua_State *lua, int nargs, int nresults, int msgh){
return err; return err;
} }
#line 0 #line 0
#line 1 "3rd_base64.h" #line 1 "3rd_base64.h"
// base64 de/encoder. Based on code by Jon Mayo - November 13, 2003 (PUBLIC DOMAIN). // base64 de/encoder. Based on code by Jon Mayo - November 13, 2003 (PUBLIC DOMAIN).
// - rlyeh, public domain // - rlyeh, public domain
@ -328289,10 +328289,10 @@ array(char) base64_decode(const char *inp, unsigned inlen) { // array_free() aft
} }
#endif // array_resize #endif // array_resize
#endif // BASE64_C #endif // BASE64_C
#line 0 #line 0
#if ENABLE_RPMALLOC #if ENABLE_RPMALLOC
#line 1 "3rd_rpmalloc.h" #line 1 "3rd_rpmalloc.h"
/* rpmalloc.h - Memory allocator - Public Domain - 2016 Mattias Jansson /* rpmalloc.h - Memory allocator - Public Domain - 2016 Mattias Jansson
* *
* This library provides a cross-platform lock free thread caching malloc implementation in C11. * This library provides a cross-platform lock free thread caching malloc implementation in C11.
@ -328666,8 +328666,8 @@ rpmalloc_get_heap_for_ptr(void* ptr);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#line 0 #line 0
#line 1 "3rd_rpmalloc.c" #line 1 "3rd_rpmalloc.c"
/* rpmalloc.c - Memory allocator - Public Domain - 2016-2020 Mattias Jansson /* rpmalloc.c - Memory allocator - Public Domain - 2016-2020 Mattias Jansson
* *
* This library provides a cross-platform lock free thread caching malloc implementation in C11. * This library provides a cross-platform lock free thread caching malloc implementation in C11.
@ -332297,29 +332297,29 @@ void
rpmalloc_linker_reference(void) { rpmalloc_linker_reference(void) {
(void)sizeof(_rpmalloc_initialized); (void)sizeof(_rpmalloc_initialized);
} }
#line 0 #line 0
//{{FILE: 3rd_rpmalloci.c}} //{{FILE: 3rd_rpmalloci.c}}
#define SYS_MEM_INIT() rpmalloc_initialize() #define SYS_MEM_INIT() rpmalloc_initialize()
#define SYS_MEM_REALLOC rprealloc #define SYS_MEM_REALLOC rprealloc
#define SYS_MEM_SIZE rpmalloc_usable_size #define SYS_MEM_SIZE rpmalloc_usable_size
#endif #endif
//#define SQLITE_OMIT_LOAD_EXTENSION //#define SQLITE_OMIT_LOAD_EXTENSION
//#define SQLITE_CORE 1 //#define SQLITE_CORE 1
//#define SQLITE_DEBUG 1 //#define SQLITE_DEBUG 1
//#define Token SQToken //#define Token SQToken
//#define Table SQTable //#define Table SQTable
//#define rehash sqlite3__rehash //#define rehash sqlite3__rehash
//#undef NB //#undef NB
//{ {FILE:3rd_sqlite3.c}} //{ {FILE:3rd_sqlite3.c}}
//#undef Token //#undef Token
//#undef Table //#undef Table
//#undef rehash //#undef rehash
//#undef NB //#undef NB
//#undef threadid //#undef threadid
// editor // editor
#line 1 "3rd_icon_mdi.h" #line 1 "3rd_icon_mdi.h"
// Generated by https://github.com/juliettef/IconFontCppHeaders script GenerateIconFontCppHeaders.py for languages C and C++ // Generated by https://github.com/juliettef/IconFontCppHeaders script GenerateIconFontCppHeaders.py for languages C and C++
// from https://raw.githubusercontent.com/Templarian/MaterialDesign-Webfont/master/css/materialdesignicons.css // from https://raw.githubusercontent.com/Templarian/MaterialDesign-Webfont/master/css/materialdesignicons.css
// for use with https://github.com/Templarian/MaterialDesign-Webfont/raw/master/fonts/materialdesignicons-webfont.ttf // for use with https://github.com/Templarian/MaterialDesign-Webfont/raw/master/fonts/materialdesignicons-webfont.ttf
@ -339698,11 +339698,11 @@ rpmalloc_linker_reference(void) {
#define ICON_MDI_ZODIAC_TAURUS "\xf3\xb0\xaa\x87" // U+F0A87 #define ICON_MDI_ZODIAC_TAURUS "\xf3\xb0\xaa\x87" // U+F0A87
#define ICON_MDI_ZODIAC_VIRGO "\xf3\xb0\xaa\x88" // U+F0A88 #define ICON_MDI_ZODIAC_VIRGO "\xf3\xb0\xaa\x88" // U+F0A88
#define ICON_MDI_BLANK "\xef\x9a\x8c" // U+F68C #define ICON_MDI_BLANK "\xef\x9a\x8c" // U+F68C
#line 0 #line 0
// editor_script // editor_script
#define GLEQ_IMPLEMENTATION #define GLEQ_IMPLEMENTATION
#define GlyphSet GlyphSet_ // linux #define GlyphSet GlyphSet_ // linux
#line 1 "3rd_lite_sys_gleq.h" #line 1 "3rd_lite_sys_gleq.h"
/* /*
* GLEQ - A basic event queue for GLFW 3 * GLEQ - A basic event queue for GLFW 3
* Copyright © Camilla Löwy <elmindreda@glfw.org> * Copyright © Camilla Löwy <elmindreda@glfw.org>
@ -340127,8 +340127,8 @@ GLEQDEF void gleqFreeEvent(GLEQevent* event)
#endif /* GLEQ_IMPLEMENTATION */ #endif /* GLEQ_IMPLEMENTATION */
#endif /* GLEQ_HEADER_FILE */ #endif /* GLEQ_HEADER_FILE */
#line 0 #line 0
#line 1 "3rd_lite_sys.h" #line 1 "3rd_lite_sys.h"
// lite editor, platform details // lite editor, platform details
// - rlyeh, public domain // - rlyeh, public domain
@ -340404,8 +340404,8 @@ bottom:;
return rc; return rc;
} }
#line 0 #line 0
#line 1 "3rd_lite.h" #line 1 "3rd_lite.h"
// Copyright (c) 2020 rxi // Copyright (c) 2020 rxi
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy of // Permission is hereby granted, free of charge, to any person obtaining a copy of
@ -341559,11 +341559,11 @@ void lt_tick(struct lua_State *L) {
"end)" "end)"
); );
} }
#line 0 #line 0
#define LIGHTMAPPER_IMPLEMENTATION #define LIGHTMAPPER_IMPLEMENTATION
//#define LM_DEBUG_INTERPOLATION //#define LM_DEBUG_INTERPOLATION
#line 1 "3rd_lightmapper.h" #line 1 "3rd_lightmapper.h"
/*********************************************************** /***********************************************************
* A single header file OpenGL lightmapping library * * A single header file OpenGL lightmapping library *
* https://github.com/ands/lightmapper * * https://github.com/ands/lightmapper *
@ -343345,9 +343345,10 @@ lm_bool lmImageSaveTGAf(const char *filename, const float *image, int w, int h,
} }
#endif // LIGHTMAPPER_IMPLEMENTATION #endif // LIGHTMAPPER_IMPLEMENTATION
#line 0 #line 0
#line 1 "3rd_sdk_steam.h" #define STEAM_API() //@hack
#line 1 "3rd_sdk_steam.h"
/***************************************************************/ /***************************************************************/
/* */ /* */
/* Only after agreeing to Valves non-disclosure and/or license */ /* Only after agreeing to Valves non-disclosure and/or license */
@ -345764,6 +345765,7 @@ typedef struct {
intptr_t SteamClient(); intptr_t SteamClient();
#ifndef STEAM_API
#define STEAM_API(X) \ #define STEAM_API(X) \
X(bool,SteamAPI_Init,()) \ X(bool,SteamAPI_Init,()) \
X(void,SteamAPI_Shutdown,()) \ X(void,SteamAPI_Shutdown,()) \
@ -346463,6 +346465,7 @@ X(void*,SteamInternal_CreateInterface,(const char *ver)) \
X(bool,SteamAPI_IsSteamRunning,()) \ X(bool,SteamAPI_IsSteamRunning,()) \
X(bool,SteamAPI_InitSafe,()) \ X(bool,SteamAPI_InitSafe,()) \
X(void,SteamAPI_RunCallbacks,()) X(void,SteamAPI_RunCallbacks,())
#line 0 #endif
#line 0
#endif // V4K_3RD
#endif // V4K_3RD

View File

@ -1,116 +1,116 @@
/* game framework. /* game framework.
* - rlyeh, public domain * - rlyeh, public domain
* *
* ## V4K License * ## V4K License
* *
* This software is available under 3 licenses. Choose whichever you prefer. * This software is available under 3 licenses. Choose whichever you prefer.
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* ALTERNATIVE A - Public Domain (https://unlicense.org/) * ALTERNATIVE A - Public Domain (https://unlicense.org/)
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* This is free and unencumbered software released into the public domain. * This is free and unencumbered software released into the public domain.
* *
* Anyone is free to copy, modify, publish, use, compile, sell, or distribute this * Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
* software, either in source code form or as a compiled binary, for any purpose, * software, either in source code form or as a compiled binary, for any purpose,
* commercial or non-commercial, and by any means. * commercial or non-commercial, and by any means.
* *
* In jurisdictions that recognize copyright laws, the author or authors of this * In jurisdictions that recognize copyright laws, the author or authors of this
* software dedicate any and all copyright interest in the software to the public * software dedicate any and all copyright interest in the software to the public
* domain. We make this dedication for the benefit of the public at large and to * domain. We make this dedication for the benefit of the public at large and to
* the detriment of our heirs and successors. We intend this dedication to be an * the detriment of our heirs and successors. We intend this dedication to be an
* overt act of relinquishment in perpetuity of all present and future rights to * overt act of relinquishment in perpetuity of all present and future rights to
* this software under copyright law. * this software under copyright law.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * 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.
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* ALTERNATIVE B - 0-BSD License (https://opensource.org/licenses/FPL-1.0.0) * ALTERNATIVE B - 0-BSD License (https://opensource.org/licenses/FPL-1.0.0)
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted. * purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* ALTERNATIVE C - MIT-0 (No Attribution clause) * ALTERNATIVE C - MIT-0 (No Attribution clause)
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this * Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software * software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify, * without restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so. * permit persons to whom the Software is furnished to do so.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * HOLDERS 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 WITH THE * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* ## License: Contributed Code ------------------------------------------------ * ## License: Contributed Code ------------------------------------------------
* *
* Dear Contributor, * Dear Contributor,
* *
* In order to ensure this project remains completely free and unencumbered by * In order to ensure this project remains completely free and unencumbered by
* anyone's copyright monopoly, it is advisable that you dedicate your code-base * anyone's copyright monopoly, it is advisable that you dedicate your code-base
* contributions to the three licensing terms above. This removes any possible * contributions to the three licensing terms above. This removes any possible
* ambiguity as to what terms somebody might have thought they were contributing * ambiguity as to what terms somebody might have thought they were contributing
* under, in case of a future dispute. These concerns are not unique to public * under, in case of a future dispute. These concerns are not unique to public
* domain software. Most large, established open-source projects have a * domain software. Most large, established open-source projects have a
* Contributor License Agreement (CLA) process, of varying degrees of formality. * Contributor License Agreement (CLA) process, of varying degrees of formality.
* *
* Please add yourself to the list below before contributing. * Please add yourself to the list below before contributing.
* Thanks. * Thanks.
* *
* -- * --
* *
* "I dedicate any and all copyright interest in this software to the three * "I dedicate any and all copyright interest in this software to the three
* licensing terms listed above. I make this dedication for the benefit of the * licensing terms listed above. I make this dedication for the benefit of the
* public at large and to the detriment of my heirs and successors. I intend * public at large and to the detriment of my heirs and successors. I intend
* this dedication to be an overt act of relinquishment in perpetuity of all * this dedication to be an overt act of relinquishment in perpetuity of all
* present and future rights to this software under copyright law." * present and future rights to this software under copyright law."
* *
* Author (name) I agree (YES/NO) Files/Features (optional) * Author (name) I agree (YES/NO) Files/Features (optional)
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* @r-lyeh YES Initial codebase * @r-lyeh YES Initial codebase
* @zak@v4.games YES N/A * @zak@v4.games YES N/A
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
*/ */
#ifndef V4K_H #ifndef V4K_H
#include "v4k.h" #include "v4k.h"
#endif #endif
#if is(win32) // hack to boost exit time. there are no critical systems that need to shutdown properly on Windows, #if is(win32) // hack to boost exit time. there are no critical systems that need to shutdown properly on Windows,
#define atexit(...) // however Linux needs proper atexit() to deinitialize 3rd_miniaudio.h; likely OSX as well. #define atexit(...) // however Linux needs proper atexit() to deinitialize 3rd_miniaudio.h; likely OSX as well.
#endif #endif
#ifndef V4K_3RD #ifndef V4K_3RD
#define V4K_3RD #define V4K_3RD
#include "v4k" #include "v4k"
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// C files // C files
#line 1 "v4k_begin.c" #line 1 "v4k_begin.c"
#define do_threadlock(mutexptr) \ #define do_threadlock(mutexptr) \
for( int init_ = !!(mutexptr) || (thread_mutex_init( (mutexptr) = CALLOC(1, sizeof(thread_mutex_t)) ), 1); init_; init_ = 0) \ for( int init_ = !!(mutexptr) || (thread_mutex_init( (mutexptr) = CALLOC(1, sizeof(thread_mutex_t)) ), 1); init_; init_ = 0) \
for( int lock_ = (thread_mutex_lock( mutexptr ), 1); lock_; lock_ = (thread_mutex_unlock( mutexptr ), 0) ) for( int lock_ = (thread_mutex_lock( mutexptr ), 1); lock_; lock_ = (thread_mutex_unlock( mutexptr ), 0) )
#define AS_NKCOLOR(color) \ #define AS_NKCOLOR(color) \
((struct nk_color){ ((color>>0))&255,((color>>8))&255,((color>>16))&255,((color>>24))&255 }) ((struct nk_color){ ((color>>0))&255,((color>>8))&255,((color>>16))&255,((color>>24))&255 })
#line 0 #line 0
#line 1 "v4k_ds.c" #line 1 "v4k_ds.c"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// sort/less // sort/less
@ -498,9 +498,9 @@ void (set_free)(set* m) {
set zero = {0}; set zero = {0};
*m = zero; *m = zero;
} }
#line 0 #line 0
#line 1 "v4k_string.c" #line 1 "v4k_string.c"
#include <stdarg.h> #include <stdarg.h>
#ifndef STACK_ALLOC_SIZE #ifndef STACK_ALLOC_SIZE
@ -1084,9 +1084,9 @@ int main() {
assert(~puts("Ok")); assert(~puts("Ok"));
} }
*/ */
#line 0 #line 0
#line 1 "v4k_compat.c" #line 1 "v4k_compat.c"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// compat (unix & stdio.h) // compat (unix & stdio.h)
@ -1203,9 +1203,9 @@ const char *pathfile_from_handle(FILE *fp) {
void v4k_init(); void v4k_init();
static void v4k_pre_init(); static void v4k_pre_init();
static void v4k_post_init(float); static void v4k_post_init(float);
#line 0 #line 0
#line 1 "v4k_ui.c" #line 1 "v4k_ui.c"
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
// ui extensions first // ui extensions first
@ -4094,10 +4094,10 @@ int ui_demo(int do_windows) {
} }
return 0; return 0;
} }
#line 0 #line 0
#line 1 "v4k_audio.c" #line 1 "v4k_audio.c"
// @fixme: really shutdown audio & related threads before quitting. ma_dr_wav crashes. // @fixme: really shutdown audio & related threads before quitting. ma_dr_wav crashes.
@ -4713,9 +4713,9 @@ int ui_audio() {
return changed; return changed;
} }
#line 0 #line 0
#line 1 "v4k_collide.c" #line 1 "v4k_collide.c"
/* poly */ /* poly */
poly poly_alloc(int cnt) { poly poly_alloc(int cnt) {
poly p = {0}; poly p = {0};
@ -6141,9 +6141,9 @@ void collide_demo() { // debug draw collisions // @fixme: fix leaks: poly_free()
ddraw_line(gjk.p0, gjk.p1); ddraw_line(gjk.p0, gjk.p1);
} }
} }
#line 0 #line 0
#line 1 "v4k_cook.c" #line 1 "v4k_cook.c"
// data pipeline // data pipeline
// - rlyeh, public domain. // - rlyeh, public domain.
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@ -7007,9 +7007,9 @@ bool have_tools() {
static bool found; do_once found = file_exist(COOK_INI); static bool found; do_once found = file_exist(COOK_INI);
return ifdef(retail, false, found); return ifdef(retail, false, found);
} }
#line 0 #line 0
#line 1 "v4k_data.c" #line 1 "v4k_data.c"
static array(json5) roots; static array(json5) roots;
static array(char*) sources; static array(char*) sources;
@ -7236,9 +7236,9 @@ bool data_tests() {
return true; return true;
} }
#line 0 #line 0
#line 1 "v4k_extend.c" #line 1 "v4k_extend.c"
// dll ------------------------------------------------------------------------ // dll ------------------------------------------------------------------------
/* deprecated /* deprecated
@ -7543,9 +7543,9 @@ bool script_pop() {
L = array_count(Ls) && (array_pop(Ls), array_count(Ls)) ? *array_back(Ls) : NULL; L = array_count(Ls) && (array_pop(Ls), array_count(Ls)) ? *array_back(Ls) : NULL;
return !!array_count(Ls); return !!array_count(Ls);
} }
#line 0 #line 0
#line 1 "v4k_file.c" #line 1 "v4k_file.c"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// file // file
@ -8699,9 +8699,9 @@ bool ini_write(const char *filename, const char *section, const char *key, const
return file_append(filename, s, strlen(s)); return file_append(filename, s, strlen(s));
} }
#line 0 #line 0
#line 1 "v4k_font.c" #line 1 "v4k_font.c"
// font framework. original code by Vassvik (UNLICENSED) // font framework. original code by Vassvik (UNLICENSED)
// - rlyeh, public domain. // - rlyeh, public domain.
// //
@ -11231,9 +11231,9 @@ void *font_colorize(const char *text, const char *comma_types, const char *comma
return col; return col;
} }
#line 0 #line 0
#line 1 "v4k_gui.c" #line 1 "v4k_gui.c"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// game ui (utils) // game ui (utils)
@ -11718,9 +11718,9 @@ guiskin_t gui_skinned(const char *asefile, float scale) {
skin.free = skinned_free; skin.free = skinned_free;
return skin; return skin;
} }
#line 0 #line 0
#line 1 "v4k_input.c" #line 1 "v4k_input.c"
// input framework // input framework
// - rlyeh, public domain // - rlyeh, public domain
// //
@ -12483,9 +12483,9 @@ int ui_gamepads() {
return 0; return 0;
} }
#line 0 #line 0
#line 1 "v4k_math.c" #line 1 "v4k_math.c"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// math framework: rand, ease, vec2, vec3, vec4, quat, mat2, mat33, mat34, mat4 // math framework: rand, ease, vec2, vec3, vec4, quat, mat2, mat33, mat34, mat4
// - rlyeh, public domain // - rlyeh, public domain
@ -13375,9 +13375,9 @@ AUTORUN {
STRUCT( vec3, float, y ); STRUCT( vec3, float, y );
STRUCT( vec3, float, z, "Up" ); STRUCT( vec3, float, z, "Up" );
} }
#line 0 #line 0
#line 1 "v4k_memory.c" #line 1 "v4k_memory.c"
size_t dlmalloc_usable_size(void*); // __ANDROID_API__ size_t dlmalloc_usable_size(void*); // __ANDROID_API__
#if is(bsd) || is(osx) // bsd or osx #if is(bsd) || is(osx) // bsd or osx
@ -13479,9 +13479,9 @@ void* forget( void *ptr ) {
} }
return ptr; return ptr;
} }
#line 0 #line 0
#line 1 "v4k_network.c" #line 1 "v4k_network.c"
#if is(tcc) && is(win32) // @fixme: https lib is broken with tcc. replaced with InternetReadFile() api for now #if is(tcc) && is(win32) // @fixme: https lib is broken with tcc. replaced with InternetReadFile() api for now
@ -13776,9 +13776,9 @@ static void network_init() {
tcp_init(); tcp_init();
} }
} }
#line 0 #line 0
#line 1 "v4k_track.c" #line 1 "v4k_track.c"
static __thread int track__sock = -1; static __thread int track__sock = -1;
//~ Lifecycle methods //~ Lifecycle methods
@ -13913,9 +13913,9 @@ int track_event_props(char const *event_id, char const *user_id, const track_pro
#undef TRACK__APPEND_SAFE #undef TRACK__APPEND_SAFE
#undef TRACK__APPEND_SAFE_EX #undef TRACK__APPEND_SAFE_EX
#line 0 #line 0
#line 1 "v4k_netsync.c" #line 1 "v4k_netsync.c"
typedef void* (*rpc_function)(); typedef void* (*rpc_function)();
typedef struct rpc_call { typedef struct rpc_call {
@ -14601,9 +14601,9 @@ void network_rpc_send(unsigned id, const char *cmdline) {
*(uint32_t*)&msg[4] = id; *(uint32_t*)&msg[4] = id;
server_broadcast_bin(msg, sz); server_broadcast_bin(msg, sz);
} }
#line 0 #line 0
#line 1 "v4k_pack.c" #line 1 "v4k_pack.c"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// semantic versioning in a single byte (octal) // semantic versioning in a single byte (octal)
// - rlyeh, public domain. // - rlyeh, public domain.
@ -16974,9 +16974,9 @@ AUTORUN {
puts(""); puts("");
} }
#endif #endif
#line 0 #line 0
#line 1 "v4k_reflect.c" #line 1 "v4k_reflect.c"
// C reflection: enums, functions, structs, members and anotations. // C reflection: enums, functions, structs, members and anotations.
// - rlyeh, public domain // - rlyeh, public domain
// //
@ -17168,9 +17168,9 @@ AUTOTEST {
//reflect_dump("*"); //reflect_dump("*");
} }
#line 0 #line 0
#line 1 "v4k_render.c" #line 1 "v4k_render.c"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// opengl // opengl
@ -21727,9 +21727,9 @@ void lightmap_bake(lightmap_t *lm, int bounces, void (*drawscene)(lightmap_t *lm
} }
} }
#line 0 #line 0
#line 1 "v4k_renderdd.c" #line 1 "v4k_renderdd.c"
static const char *dd_vs = "//" FILELINE "\n" static const char *dd_vs = "//" FILELINE "\n"
"in vec3 att_position;\n" "in vec3 att_position;\n"
"uniform mat4 u_MVP;\n" "uniform mat4 u_MVP;\n"
@ -22693,9 +22693,9 @@ int gizmo(vec3 *pos, vec3 *rot, vec3 *sca) {
return modified; return modified;
} }
#line 0 #line 0
#line 1 "v4k_scene.c" #line 1 "v4k_scene.c"
// //
// @todo: remove explicit GL code from here // @todo: remove explicit GL code from here
@ -23270,9 +23270,9 @@ void scene_render(int flags) {
glBindVertexArray(0); glBindVertexArray(0);
} }
} }
#line 0 #line 0
#line 1 "v4k_sprite.c" #line 1 "v4k_sprite.c"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// sprites // sprites
@ -24804,206 +24804,9 @@ AUTORUN {
STRUCT(sprite_t, unsigned, play); STRUCT(sprite_t, unsigned, play);
EXTEND_T(sprite, ctor,edit,draw,tick); EXTEND_T(sprite, ctor,edit,draw,tick);
} }
#line 0 #line 0
#line 1 "v4k_steam.c"
// ----------------------------------------------------------------------------
// steam framework
// - rlyeh, public domain
//
// hints:
// - steam must be running in background
// - steamworks dll must be close to executable (may be "steam_api64.dll", "libsteam_api.dylib" or "libsteam_api.so")
// - family mode should be off (achievements not displayed otherwise)
//
// [src] https://steamdb.info/app/480/
// [src] https://steamdb.info/app/480/stats/
// [src] https://partner.steamgames.com/doc/
// [src] dumpbin /exports steam_api64.dll
#ifndef STEAM_APPID #line 1 "v4k_system.c"
#define STEAM_APPID 480
#endif
#ifndef STEAM_DLL
#define STEAM_DLL ifdef(win32, "steam_api64.dll", "libsteam_api" ifdef(osx, ".dylib", ".so"))
#endif
#define STEAM_API_DECL(ret,name,args) API ret (*name) args;
#define STEAM_API_DEFN(ret,name,args) ret (*name) args;
#define STEAM_API_LOAD(ret,name,args) name = dll(STEAM_DLL, #name); if(!name) PRINTF("Cannot load `" STEAM_DLL "@%s`\n", #name);
STEAM_API(STEAM_API_DECL);
STEAM_API(STEAM_API_DEFN);
struct steam_t {
intptr_t iclient;
intptr_t iapps;
intptr_t ifriends;
intptr_t ihtmlsurface;
intptr_t imatchmaking;
intptr_t imatchmakingservers;
intptr_t inetworking;
intptr_t iremoteplay;
intptr_t iremotestorage;
intptr_t iscreenshots;
intptr_t iuser;
intptr_t iuserstats;
intptr_t iutils;
uint64_t steamid;
int num_friends;
bool running, overlay;
bool logged, behindnat;
char status[256], username[256], language[32];
} steam = {0};
static
void steam_message_cb(int severity, const char *message) {
/**/ if( severity == 0 ) printf("%s", message);
else if( severity == 1 ) printf("Warning: %s", message);
else printf("Unknown severity %d: %s", severity, message);
}
bool steam_init(unsigned app_id) {
struct steam_t z = {0};
steam = z;
app_id = app_id ? app_id : STEAM_APPID;
// Steam installed?
#if is(win32)
HKEY hSteamProcess;
if( RegOpenKeyExA(HKEY_CURRENT_USER,"Software\\Valve\\Steam\\ActiveProcess", 0, KEY_READ, &hSteamProcess) ) {
return !strcpy(steam.status, "Err: steam not installed");
}
RegCloseKey(hSteamProcess);
#endif
// dll present?
if( !file_exist(STEAM_DLL) ) {
return !strcpy(steam.status, "Err: " STEAM_DLL " not found");
}
// Load symbols
STEAM_API(STEAM_API_LOAD);
if( !SteamAPI_Init ) SteamAPI_Init = SteamAPI_InitSafe;
// Initialize
char *app_id_str = va("%d", app_id);
//if( !file_exist("steam_appid.txt") ) file_write("steam_appid.txt", app_id_str, strlen(app_id_str));
#if is(win32)
if( !getenv("SteamAppId") ) SetEnvironmentVariableA("SteamAppId", app_id_str);
#endif
int started = SteamAPI_Init && SteamAPI_Init();
if( !started ) {
return !strcpy(steam.status, "Err: steam not running");
}
if( SteamAPI_RestartAppIfNecessary(app_id) )
exit(0); // restarting app thru Steam client if needed
// Create interfaces
steam.iclient = (intptr_t)SteamInternal_CreateInterface("SteamClient020");
if( !steam.iclient ) {
return !strcpy(steam.status, "Err: incompatible dll");
}
HSteamPipe hpipe = SteamAPI_ISteamClient_CreateSteamPipe(steam.iclient);
HSteamUser huser = SteamAPI_ISteamClient_ConnectToGlobalUser(steam.iclient, hpipe);
steam.iapps = (intptr_t)SteamAPI_ISteamClient_GetISteamApps(steam.iclient, huser, hpipe, "STEAMAPPS_INTERFACE_VERSION008");
steam.ifriends = (intptr_t)SteamAPI_ISteamClient_GetISteamFriends(steam.iclient, huser, hpipe, "SteamFriends017"); // 015
steam.ihtmlsurface = (intptr_t)SteamAPI_ISteamClient_GetISteamHTMLSurface(steam.iclient, huser, hpipe, "STEAMHTMLSURFACE_INTERFACE_VERSION_005");
steam.imatchmaking = (intptr_t)SteamAPI_ISteamClient_GetISteamMatchmaking(steam.iclient, huser, hpipe, "SteamMatchMaking009");
steam.imatchmakingservers = (intptr_t)SteamAPI_ISteamClient_GetISteamMatchmakingServers(steam.iclient, huser, hpipe, "SteamMatchMakingServers002");
steam.inetworking = (intptr_t)SteamAPI_ISteamClient_GetISteamNetworking(steam.iclient, huser, hpipe, "SteamNetworking006");
//steam.iremoteplay = (intptr_t)SteamAPI_ISteamClient_GetISteamRemotePlay(steam.iclient, huser, hpipe, "STEAMREMOTEPLAY_INTERFACE_VERSION001");
steam.iremotestorage = (intptr_t)SteamAPI_ISteamClient_GetISteamRemoteStorage(steam.iclient, huser, hpipe, "STEAMREMOTESTORAGE_INTERFACE_VERSION014");
steam.iscreenshots = (intptr_t)SteamAPI_ISteamClient_GetISteamScreenshots(steam.iclient, huser, hpipe, "STEAMSCREENSHOTS_INTERFACE_VERSION003");
steam.iuser = (intptr_t)SteamAPI_ISteamClient_GetISteamUser(steam.iclient, huser, hpipe, "SteamUser021"); // 019
steam.iuserstats = (intptr_t)SteamAPI_ISteamClient_GetISteamUserStats(steam.iclient, huser, hpipe, "STEAMUSERSTATS_INTERFACE_VERSION012");
steam.iutils = (intptr_t)SteamAPI_ISteamClient_GetISteamUtils(steam.iclient, hpipe, "SteamUtils010");
SteamAPI_ISteamClient_SetWarningMessageHook(steam.iclient, steam_message_cb);
// Retrieve some vars
steam.running = SteamAPI_IsSteamRunning();
steam.steamid = SteamAPI_ISteamUser_GetSteamID(steam.iuser);
steam.logged = SteamAPI_ISteamUser_BLoggedOn(steam.iuser);
steam.behindnat = SteamAPI_ISteamUser_BIsBehindNAT(steam.iuser);
steam.num_friends = SteamAPI_ISteamFriends_GetFriendCount(steam.ifriends, k_EFriendFlagAll);
strncpy(steam.username, SteamAPI_ISteamFriends_GetPersonaName(steam.ifriends), sizeof(steam.username));
strncpy(steam.language, SteamAPI_ISteamUtils_GetSteamUILanguage(steam.iutils), sizeof(steam.language)); // SteamAPI_ISteamApps_GetCurrentGameLanguage(steam.iapps)
if(steam.logged)
SteamAPI_ISteamUserStats_RequestCurrentStats(steam.iuserstats);
ASSERT(steam.iapps);
ASSERT(steam.ifriends);
ASSERT(steam.ihtmlsurface);
ASSERT(steam.imatchmaking);
ASSERT(steam.imatchmakingservers);
ASSERT(steam.inetworking);
// ASSERT(steam.iremoteplay);
ASSERT(steam.iremotestorage);
ASSERT(steam.iscreenshots);
ASSERT(steam.iuser);
ASSERT(steam.iuserstats);
ASSERT(steam.iutils);
strcpy(steam.status, "Ok");
return true;
}
void steam_tick() {
if( steam.iclient ) {
SteamAPI_RunCallbacks();
steam.overlay = SteamAPI_ISteamUtils_IsOverlayEnabled(steam.iutils);
}
}
void steam_trophy(const char *trophy_id, bool redeem) {
if( steam.iclient && steam.logged ) {
if( redeem )
SteamAPI_ISteamUserStats_SetAchievement(steam.iuserstats, trophy_id);
else
SteamAPI_ISteamUserStats_ClearAchievement(steam.iuserstats, trophy_id);
SteamAPI_ISteamUserStats_StoreStats(steam.iuserstats);
}
}
void steam_screenshot() {
if( steam.iclient ) {
SteamAPI_ISteamScreenshots_TriggerScreenshot(steam.iscreenshots);
}
}
void steam_destroy() {
if( steam.iclient ) {
steam.iclient = 0;
SteamAPI_Shutdown();
}
}
int ui_steam() {
ui_disable();
ui_label2("Status", steam.status);
ui_label2("Username", steam.username);
ui_label2("Language", steam.language);
ui_label2("Friends", va("%d", steam.num_friends));
ui_label2("SteamID", va("%llu", steam.steamid));
ui_bool("Overlay?", &steam.overlay);
ui_enable();
return 0;
}
#line 0
#line 1 "v4k_system.c"
#if (is(tcc) && is(linux)) || (is(gcc) && !is(mingw)) // || is(clang) #if (is(tcc) && is(linux)) || (is(gcc) && !is(mingw)) // || is(clang)
int __argc; char **__argv; int __argc; char **__argv;
#if !is(ems) #if !is(ems)
@ -25977,9 +25780,9 @@ int (test)(const char *file, int line, const char *expr, bool result) {
test_oks += result, test_errors += !result; test_oks += result, test_errors += !result;
return (result || (tty_color(RED), fprintf(stderr, "(Test `%s` failed %s:%d)\n", expr, file, line), tty_color(0), 0) ); return (result || (tty_color(RED), fprintf(stderr, "(Test `%s` failed %s:%d)\n", expr, file, line), tty_color(0), 0) );
} }
#line 0 #line 0
#line 1 "v4k_time.c" #line 1 "v4k_time.c"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// time // time
@ -26620,9 +26423,9 @@ void curve_destroy(curve_t *c) {
array_free(c->points); array_free(c->points);
array_free(c->indices); array_free(c->indices);
} }
#line 0 #line 0
#line 1 "v4k_profile.c" #line 1 "v4k_profile.c"
#if ENABLE_PROFILER #if ENABLE_PROFILER
profiler_t profiler; profiler_t profiler;
int profiler_enabled = 1; int profiler_enabled = 1;
@ -26678,9 +26481,9 @@ void (ui_profiler)() {
} }
} }
#endif #endif
#line 0 #line 0
#line 1 "v4k_video.c" #line 1 "v4k_video.c"
// tip: convert video to x265/mp4. note: higher crf to increase compression (default crf is 28) // tip: convert video to x265/mp4. note: higher crf to increase compression (default crf is 28)
// ffmpeg -i {{infile}} -c:v libx265 -crf 24 -c:a copy {{outfile}} // ffmpeg -i {{infile}} -c:v libx265 -crf 24 -c:a copy {{outfile}}
@ -26910,9 +26713,9 @@ void record_frame() {
} }
} }
} }
#line 0 #line 0
#line 1 "v4k_window.c" #line 1 "v4k_window.c"
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// capture tests // capture tests
static static
@ -28038,9 +27841,9 @@ double window_scale() { // ok? @testme
#endif #endif
return maxi(xscale, yscale); return maxi(xscale, yscale);
} }
#line 0 #line 0
#line 1 "v4k_obj.c" #line 1 "v4k_obj.c"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// factory of handle ids, based on code by randy gaul (PD/Zlib licensed) // factory of handle ids, based on code by randy gaul (PD/Zlib licensed)
// - rlyeh, public domain // - rlyeh, public domain
@ -29050,9 +28853,9 @@ void *obj_make(const char *str) {
return ptr; // returns partial construction as well. @todo: just return `ret` for a more strict built/failed policy return ptr; // returns partial construction as well. @todo: just return `ret` for a more strict built/failed policy
} }
#line 0 #line 0
#line 1 "v4k_ai.c" #line 1 "v4k_ai.c"
// AI framework // AI framework
// - rlyeh, public domain. // - rlyeh, public domain.
// //
@ -29888,9 +29691,9 @@ int ui_bt(bt_t *b) {
} }
return 0; return 0;
} }
#line 0 #line 0
#line 1 "v4k_editor0.c" #line 1 "v4k_editor0.c"
// editing: // editing:
// nope > functions: add/rem property // nope > functions: add/rem property
@ -30281,9 +30084,9 @@ int ui_engine() {
return 0; return 0;
} }
#line 0 #line 0
#line 1 "v4k_main.c" #line 1 "v4k_main.c"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static void v4k_pre_init() { static void v4k_pre_init() {
@ -30382,10 +30185,10 @@ void v4k_init() {
atexit(v4k_quit); atexit(v4k_quit);
} }
} }
#line 0 #line 0
// editor is last in place, so it can use all internals from above headers // editor is last in place, so it can use all internals from above headers
#line 1 "v4k_editor.c" #line 1 "v4k_editor.c"
// ## Editor long-term plan // ## Editor long-term plan
// - editor = tree of nodes. levels and objects are nodes, and their widgets are also nodes // - editor = tree of nodes. levels and objects are nodes, and their widgets are also nodes
// - you can perform actions on nodes, with or without descendants, top-bottom or bottom-top // - you can perform actions on nodes, with or without descendants, top-bottom or bottom-top
@ -31199,8 +31002,8 @@ void editor_gizmos(int dim) {
ddraw_ontop_pop(); ddraw_ontop_pop();
if(dim == 2) ddraw_pop_2d(); if(dim == 2) ddraw_pop_2d();
} }
#line 0 #line 0
#line 1 "v4k_editor_scene.h" #line 1 "v4k_editor_scene.h"
#define SCENE_ICON ICON_MDI_FILE_TREE #define SCENE_ICON ICON_MDI_FILE_TREE
#define SCENE_TITLE "Scene " SCENE_ICON #define SCENE_TITLE "Scene " SCENE_ICON
@ -31381,8 +31184,8 @@ int editor_scene(int window_mode) {
AUTORUN { AUTORUN {
array_push(editor.subeditors, editor_scene); array_push(editor.subeditors, editor_scene);
} }
#line 0 #line 0
#line 1 "v4k_editor_browser.h" #line 1 "v4k_editor_browser.h"
#define BROWSER_ICON ICON_MD_FOLDER_SPECIAL #define BROWSER_ICON ICON_MD_FOLDER_SPECIAL
#define BROWSER_TITLE "Browser " BROWSER_ICON #define BROWSER_TITLE "Browser " BROWSER_ICON
@ -31404,8 +31207,8 @@ int editor_browser(int window_mode) {
AUTORUN { AUTORUN {
array_push(editor.subeditors, editor_browser); array_push(editor.subeditors, editor_browser);
} }
#line 0 #line 0
#line 1 "v4k_editor_timeline.h" #line 1 "v4k_editor_timeline.h"
#define TIMELINE_ICON ICON_MDI_CHART_TIMELINE #define TIMELINE_ICON ICON_MDI_CHART_TIMELINE
#define TIMELINE_TITLE "Timeline " TIMELINE_ICON #define TIMELINE_TITLE "Timeline " TIMELINE_ICON
@ -31578,8 +31381,8 @@ int editor_timeline(int window_mode) {
AUTORUN { AUTORUN {
array_push(editor.subeditors, editor_timeline); array_push(editor.subeditors, editor_timeline);
} }
#line 0 #line 0
#line 1 "v4k_editor_console.h" #line 1 "v4k_editor_console.h"
#define CONSOLE_ICON ICON_MDI_CONSOLE #define CONSOLE_ICON ICON_MDI_CONSOLE
#define CONSOLE_TITLE "Console " CONSOLE_ICON #define CONSOLE_TITLE "Console " CONSOLE_ICON
@ -31636,8 +31439,8 @@ int editor_console(int window_mode) {
AUTORUN { AUTORUN {
array_push(editor.subeditors, editor_console); array_push(editor.subeditors, editor_console);
} }
#line 0 #line 0
#line 1 "v4k_editor_nodes.h" #line 1 "v4k_editor_nodes.h"
#define NODES_ICON ICON_MDI_GRAPH #define NODES_ICON ICON_MDI_GRAPH
#define NODES_TITLE "Nodes " NODES_ICON #define NODES_TITLE "Nodes " NODES_ICON
@ -32519,8 +32322,8 @@ int editor_nodes(int window_mode) {
AUTORUN { AUTORUN {
array_push(editor.subeditors, editor_nodes); array_push(editor.subeditors, editor_nodes);
} }
#line 0 #line 0
#line 1 "v4k_editor_script.h" #line 1 "v4k_editor_script.h"
int ui_texture_fit(texture_t t, struct nk_rect bounds) { int ui_texture_fit(texture_t t, struct nk_rect bounds) {
// allocate complete window space // allocate complete window space
@ -32600,9 +32403,9 @@ int editor_scripted(int window_mode) {
AUTORUN { AUTORUN {
array_push(editor.subeditors, editor_scripted); array_push(editor.subeditors, editor_scripted);
} }
#line 0 #line 0
#line 1 "v4k_end.c" #line 1 "v4k_end.c"
// Enable more performant GPUs on laptops. Does this work into a dll? // Enable more performant GPUs on laptops. Does this work into a dll?
// int NvOptimusEnablement = 1; // int NvOptimusEnablement = 1;
// int AmdPowerXpressRequestHighPerformance = 1; // int AmdPowerXpressRequestHighPerformance = 1;
@ -32639,4 +32442,4 @@ ifdef(retail, AUTORUN {
if (!freopen(null_stream, "a", stdout)) PANIC("cannot recreate standard streams"); if (!freopen(null_stream, "a", stdout)) PANIC("cannot recreate standard streams");
if (!freopen(null_stream, "a", stderr)) PANIC("cannot recreate standard streams"); if (!freopen(null_stream, "a", stderr)) PANIC("cannot recreate standard streams");
} ) } )
#line 0 #line 0

View File

@ -1,101 +1,101 @@
/* game framework. /* game framework.
* - rlyeh, public domain * - rlyeh, public domain
* *
* ## V4K License * ## V4K License
* *
* This software is available under 3 licenses. Choose whichever you prefer. * This software is available under 3 licenses. Choose whichever you prefer.
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* ALTERNATIVE A - Public Domain (https://unlicense.org/) * ALTERNATIVE A - Public Domain (https://unlicense.org/)
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* This is free and unencumbered software released into the public domain. * This is free and unencumbered software released into the public domain.
* *
* Anyone is free to copy, modify, publish, use, compile, sell, or distribute this * Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
* software, either in source code form or as a compiled binary, for any purpose, * software, either in source code form or as a compiled binary, for any purpose,
* commercial or non-commercial, and by any means. * commercial or non-commercial, and by any means.
* *
* In jurisdictions that recognize copyright laws, the author or authors of this * In jurisdictions that recognize copyright laws, the author or authors of this
* software dedicate any and all copyright interest in the software to the public * software dedicate any and all copyright interest in the software to the public
* domain. We make this dedication for the benefit of the public at large and to * domain. We make this dedication for the benefit of the public at large and to
* the detriment of our heirs and successors. We intend this dedication to be an * the detriment of our heirs and successors. We intend this dedication to be an
* overt act of relinquishment in perpetuity of all present and future rights to * overt act of relinquishment in perpetuity of all present and future rights to
* this software under copyright law. * this software under copyright law.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN * 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.
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* ALTERNATIVE B - 0-BSD License (https://opensource.org/licenses/FPL-1.0.0) * ALTERNATIVE B - 0-BSD License (https://opensource.org/licenses/FPL-1.0.0)
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted. * purpose with or without fee is hereby granted.
* *
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* ALTERNATIVE C - MIT-0 (No Attribution clause) * ALTERNATIVE C - MIT-0 (No Attribution clause)
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* Permission is hereby granted, free of charge, to any person obtaining a copy of this * Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software * software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify, * without restriction, including without limitation the rights to use, copy, modify,
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so. * permit persons to whom the Software is furnished to do so.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION * HOLDERS 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 WITH THE * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* *
* ## License: Contributed Code ------------------------------------------------ * ## License: Contributed Code ------------------------------------------------
* *
* Dear Contributor, * Dear Contributor,
* *
* In order to ensure this project remains completely free and unencumbered by * In order to ensure this project remains completely free and unencumbered by
* anyone's copyright monopoly, it is advisable that you dedicate your code-base * anyone's copyright monopoly, it is advisable that you dedicate your code-base
* contributions to the three licensing terms above. This removes any possible * contributions to the three licensing terms above. This removes any possible
* ambiguity as to what terms somebody might have thought they were contributing * ambiguity as to what terms somebody might have thought they were contributing
* under, in case of a future dispute. These concerns are not unique to public * under, in case of a future dispute. These concerns are not unique to public
* domain software. Most large, established open-source projects have a * domain software. Most large, established open-source projects have a
* Contributor License Agreement (CLA) process, of varying degrees of formality. * Contributor License Agreement (CLA) process, of varying degrees of formality.
* *
* Please add yourself to the list below before contributing. * Please add yourself to the list below before contributing.
* Thanks. * Thanks.
* *
* -- * --
* *
* "I dedicate any and all copyright interest in this software to the three * "I dedicate any and all copyright interest in this software to the three
* licensing terms listed above. I make this dedication for the benefit of the * licensing terms listed above. I make this dedication for the benefit of the
* public at large and to the detriment of my heirs and successors. I intend * public at large and to the detriment of my heirs and successors. I intend
* this dedication to be an overt act of relinquishment in perpetuity of all * this dedication to be an overt act of relinquishment in perpetuity of all
* present and future rights to this software under copyright law." * present and future rights to this software under copyright law."
* *
* Author (name) I agree (YES/NO) Files/Features (optional) * Author (name) I agree (YES/NO) Files/Features (optional)
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
* @r-lyeh YES Initial codebase * @r-lyeh YES Initial codebase
* @zak@v4.games YES N/A * @zak@v4.games YES N/A
* ------------------------------------------------------------------------------ * ------------------------------------------------------------------------------
*/ */
#ifndef V4K_H #ifndef V4K_H
#define V4K_H #define V4K_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Headers // Headers
#line 1 "v4k_config.h" #line 1 "v4k_config.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// config directives // config directives
@ -511,9 +511,9 @@ typedef char bool; ///-
#pragma comment(lib, "m") #pragma comment(lib, "m")
#pragma comment(lib, "pthread") #pragma comment(lib, "pthread")
#endif #endif
#line 0 #line 0
#line 1 "v4k_ds.h" #line 1 "v4k_ds.h"
// data structures and utils: array, set, map, hash, sort. // data structures and utils: array, set, map, hash, sort.
// - rlyeh, public domain // - rlyeh, public domain
@ -950,9 +950,9 @@ API int (map_count)(map *m);
API void (map_gc)(map *m); // only if using MAP_DONT_ERASE API void (map_gc)(map *m); // only if using MAP_DONT_ERASE
API bool (map_sort)(map* m); API bool (map_sort)(map* m);
API void (map_clear)(map* m); API void (map_clear)(map* m);
#line 0 #line 0
#line 1 "v4k_math.h" #line 1 "v4k_math.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// math framework: rand, ease, vec2, vec3, vec4, quat, mat2, mat33, mat34, mat4 // math framework: rand, ease, vec2, vec3, vec4, quat, mat2, mat33, mat34, mat4
// - rlyeh, public domain // - rlyeh, public domain
@ -1232,9 +1232,9 @@ API void printq( quat q );
API void print33( float *m ); API void print33( float *m );
API void print34( float *m ); API void print34( float *m );
API void print44( float *m ); API void print44( float *m );
#line 0 #line 0
#line 1 "v4k_obj.h" #line 1 "v4k_obj.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// factory of handle ids // factory of handle ids
@ -1599,10 +1599,10 @@ typedef enum OBJTYPE_BUILTINS {
OBJTYPE_vec2i = 9, OBJTYPE_vec2i = 9,
OBJTYPE_vec3i = 10, OBJTYPE_vec3i = 10,
} OBJTYPE_BUILTINS; } OBJTYPE_BUILTINS;
#line 0 #line 0
#line 1 "v4k_ai.h" #line 1 "v4k_ai.h"
// AI framework // AI framework
// - rlyeh, public domain. // - rlyeh, public domain.
// //
@ -1685,9 +1685,9 @@ API void swarm_update_acceleration_only(swarm_t *self); // acc
API void swarm_update_acceleration_and_velocity_only(swarm_t *self, float delta); // acc,vel API void swarm_update_acceleration_and_velocity_only(swarm_t *self, float delta); // acc,vel
API int ui_swarm(swarm_t *self); API int ui_swarm(swarm_t *self);
#line 0 #line 0
#line 1 "v4k_audio.h" #line 1 "v4k_audio.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// audio framework // audio framework
// - rlyeh, public domain // - rlyeh, public domain
@ -1748,9 +1748,9 @@ enum AUDIO_FLAGS {
}; };
API int audio_queue( const void *samples, int num_samples, int flags ); API int audio_queue( const void *samples, int num_samples, int flags );
#line 0 #line 0
#line 1 "v4k_collide.h" #line 1 "v4k_collide.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// original code by @vurtun (PD) and @barerose (CC0). // original code by @vurtun (PD) and @barerose (CC0).
// [src] https://gist.github.com/vurtun/95f088e4889da2474ad1ce82d7911fee // [src] https://gist.github.com/vurtun/95f088e4889da2474ad1ce82d7911fee
@ -1909,9 +1909,9 @@ API poly pyramid(vec3 from, vec3 to, float size); // poly_free() required
API poly diamond(vec3 from, vec3 to, float size); // poly_free() required API poly diamond(vec3 from, vec3 to, float size); // poly_free() required
API void collide_demo(); // debug draw collisions API void collide_demo(); // debug draw collisions
#line 0 #line 0
#line 1 "v4k_cook.h" #line 1 "v4k_cook.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// asset pipeline framework // asset pipeline framework
// - rlyeh, public domain. // - rlyeh, public domain.
@ -1945,9 +1945,9 @@ API int cook_progress(); // [0..100]
// utils // utils
API bool have_tools(); API bool have_tools();
#line 0 #line 0
#line 1 "v4k_data.h" #line 1 "v4k_data.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// data framework (json5, xml, compression) @todo:kvdb // data framework (json5, xml, compression) @todo:kvdb
// - rlyeh, public domain // - rlyeh, public domain
@ -1984,9 +1984,9 @@ API array(char) xml_blob(char *key);
API void xml_pop(); API void xml_pop();
API bool data_tests(); API bool data_tests();
#line 0 #line 0
#line 1 "v4k_extend.h" #line 1 "v4k_extend.h"
// dll ------------------------------------------------------------------------ // dll ------------------------------------------------------------------------
/// !!! `filename` must contain extension /// !!! `filename` must contain extension
@ -2021,9 +2021,9 @@ API void script_call(const char *lua_function);
API bool script_tests(); API bool script_tests();
API bool script_pop(); API bool script_pop();
#line 0 #line 0
#line 1 "v4k_file.h" #line 1 "v4k_file.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// files, cache and virtual filesystem (registered directories and/or compressed zip archives). // files, cache and virtual filesystem (registered directories and/or compressed zip archives).
// - rlyeh, public domain. // - rlyeh, public domain.
@ -2122,9 +2122,9 @@ API ini_t ini_from_mem(const char *data);
API void ini_destroy(ini_t); API void ini_destroy(ini_t);
API bool ini_write(const char *filename, const char *section, const char *key, const char *value); API bool ini_write(const char *filename, const char *section, const char *key, const char *value);
#line 0 #line 0
#line 1 "v4k_font.h" #line 1 "v4k_font.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// font framework // font framework
// - rlyeh, public domain // - rlyeh, public domain
@ -2227,9 +2227,9 @@ API vec2 font_highlight(const char *text, const void *colors);
// ui // ui
API void ui_font(); API void ui_font();
#line 0 #line 0
#line 1 "v4k_input.h" #line 1 "v4k_input.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// input framework // input framework
// - rlyeh, public domain // - rlyeh, public domain
@ -2354,9 +2354,9 @@ enum INPUT_ALIASES {
KEY_ALT = KEY_LALT, KEY_ALT = KEY_LALT,
KEY_CTRL = KEY_LCTRL, KEY_CTRL = KEY_LCTRL,
}; };
#line 0 #line 0
#line 1 "v4k_memory.h" #line 1 "v4k_memory.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// memory framework // memory framework
// - rlyeh, public domain // - rlyeh, public domain
@ -2394,9 +2394,9 @@ API void* forget( void *ptr );
static FORCE_INLINE void *(REALLOC_)(void *p, size_t n) { return n ? WATCH(xrealloc(p,n),n) : xrealloc(FORGET(p),0); } ///- static FORCE_INLINE void *(REALLOC_)(void *p, size_t n) { return n ? WATCH(xrealloc(p,n),n) : xrealloc(FORGET(p),0); } ///-
static FORCE_INLINE void *(CALLOC_)(size_t m, size_t n) { return n *= m, memset(REALLOC(0,n),0,n); } ///- static FORCE_INLINE void *(CALLOC_)(size_t m, size_t n) { return n *= m, memset(REALLOC(0,n),0,n); } ///-
static FORCE_INLINE char *(STRDUP_)(const char *s) { size_t n = strlen(s)+1; return ((char*)memcpy(REALLOC(0,n), s, n)); } ///- static FORCE_INLINE char *(STRDUP_)(const char *s) { size_t n = strlen(s)+1; return ((char*)memcpy(REALLOC(0,n), s, n)); } ///-
#line 0 #line 0
#line 1 "v4k_network.h" #line 1 "v4k_network.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// network framework // network framework
// - rlyeh, public domain // - rlyeh, public domain
@ -2446,9 +2446,9 @@ API int tcp_close(int);
API int tcp_debug(int); // toggle traffic monitoring on/off for given socket API int tcp_debug(int); // toggle traffic monitoring on/off for given socket
//API int tcp_printf(int, const char *fmt, ...); // printf message in remote end //API int tcp_printf(int, const char *fmt, ...); // printf message in remote end
//API int tcp_crypt(int,uint64_t); // set shared secret //API int tcp_crypt(int,uint64_t); // set shared secret
#line 0 #line 0
#line 1 "v4k_track.h" #line 1 "v4k_track.h"
#ifndef TRACK_SEND_BUFSIZE #ifndef TRACK_SEND_BUFSIZE
#define TRACK_SEND_BUFSIZE 576 #define TRACK_SEND_BUFSIZE 576
#endif #endif
@ -2507,9 +2507,9 @@ typedef struct track_prop {
/// user_id: Identifier for the user. /// user_id: Identifier for the user.
/// props: Array of key-value pairs. Terminates when key is set to NULL. /// props: Array of key-value pairs. Terminates when key is set to NULL.
API int track_event_props(char const *event_id, char const *user_id, const track_prop *props); API int track_event_props(char const *event_id, char const *user_id, const track_prop *props);
#line 0 #line 0
#line 1 "v4k_netsync.h" #line 1 "v4k_netsync.h"
// high-level, socket-less networking api. inspired by Quake, MPI and RenderBuckets theories. // high-level, socket-less networking api. inspired by Quake, MPI and RenderBuckets theories.
// - rlyeh, public domain // - rlyeh, public domain
// //
@ -2593,9 +2593,9 @@ API int64_t client_join(const char *ip, int port);
#define LOCALHOST_IPV4 "127.0.0.1" #define LOCALHOST_IPV4 "127.0.0.1"
#define LOCALHOST_IPV6 "::1" #define LOCALHOST_IPV6 "::1"
#line 0 #line 0
#line 1 "v4k_pack.h" #line 1 "v4k_pack.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// compression api // compression api
@ -2985,9 +2985,9 @@ API int saveb(unsigned char *buf, const char *format, ...);
API int loadf(FILE *file, const char *format, ...); API int loadf(FILE *file, const char *format, ...);
API int loadb(const unsigned char *buf, const char *format, ...); API int loadb(const unsigned char *buf, const char *format, ...);
#line 0 #line 0
#line 1 "v4k_profile.h" #line 1 "v4k_profile.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// profiler & stats (@fixme: threadsafe) // profiler & stats (@fixme: threadsafe)
@ -3017,9 +3017,9 @@ typedef map(char *, struct profile_t) profiler_t; ///-
extern API profiler_t profiler; ///- extern API profiler_t profiler; ///-
extern API int profiler_enabled; ///- extern API int profiler_enabled; ///-
#endif #endif
#line 0 #line 0
#line 1 "v4k_reflect.h" #line 1 "v4k_reflect.h"
// C reflection: enums, functions, structs, members and anotations. // C reflection: enums, functions, structs, members and anotations.
// - rlyeh, public domain // - rlyeh, public domain
// //
@ -3084,9 +3084,9 @@ API void function_inscribe(const char *F,void *func,const char *in
API const char* symbol_naked(const char *s); API const char* symbol_naked(const char *s);
API int ui_reflect(const char *mask); // *, model* or NULL API int ui_reflect(const char *mask); // *, model* or NULL
#line 0 #line 0
#line 1 "v4k_render.h" #line 1 "v4k_render.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// naive rendering framework // naive rendering framework
// - rlyeh, public domain // - rlyeh, public domain
@ -3858,9 +3858,9 @@ API int ui_fxs();
API void* screenshot(int components); // 3 RGB, 4 RGBA, -3 BGR, -4 BGRA API void* screenshot(int components); // 3 RGB, 4 RGBA, -3 BGR, -4 BGRA
API void* screenshot_async(int components); // 3 RGB, 4 RGBA, -3 BGR, -4 BGRA API void* screenshot_async(int components); // 3 RGB, 4 RGBA, -3 BGR, -4 BGRA
#line 0 #line 0
#line 1 "v4k_renderdd.h" #line 1 "v4k_renderdd.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// debugdraw framework // debugdraw framework
// - rlyeh, public domain. // - rlyeh, public domain.
@ -3932,9 +3932,9 @@ API void ddraw_flush_projview(mat44 proj, mat44 view);
API int gizmo(vec3 *pos, vec3 *rot, vec3 *sca); API int gizmo(vec3 *pos, vec3 *rot, vec3 *sca);
API bool gizmo_active(); API bool gizmo_active();
API bool gizmo_hover(); API bool gizmo_hover();
#line 0 #line 0
#line 1 "v4k_scene.h" #line 1 "v4k_scene.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// scene framework // scene framework
// - rlyeh, public domain // - rlyeh, public domain
@ -4078,9 +4078,9 @@ API object_t* scene_index(unsigned index);
API light_t* scene_spawn_light(); API light_t* scene_spawn_light();
API unsigned scene_count_light(); API unsigned scene_count_light();
API light_t* scene_index_light(unsigned index); API light_t* scene_index_light(unsigned index);
#line 0 #line 0
#line 1 "v4k_string.h" #line 1 "v4k_string.h"
// string framework // string framework
// - rlyeh, public domain // - rlyeh, public domain
@ -4192,9 +4192,9 @@ API char* kit_translate2( const char *id, const char *langcode_iso639_1 ); // pe
API void kit_locale( const char *langcode_iso639_1 ); // set current locale: enUS, ptBR, esES, ... API void kit_locale( const char *langcode_iso639_1 ); // set current locale: enUS, ptBR, esES, ...
API char* kit_translate( const char *id ); // perform a translation, given current locale API char* kit_translate( const char *id ); // perform a translation, given current locale
#line 0 #line 0
#line 1 "v4k_sprite.h" #line 1 "v4k_sprite.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// sprites // sprites
@ -4356,8 +4356,8 @@ API void sprite_edit(sprite_t *s);
API sprite_t*sprite_new(const char *ase, int bindings[6]); API sprite_t*sprite_new(const char *ase, int bindings[6]);
API void sprite_del(sprite_t *s); API void sprite_del(sprite_t *s);
API void sprite_setanim(sprite_t *s, unsigned name); API void sprite_setanim(sprite_t *s, unsigned name);
#line 0 #line 0
#line 1 "v4k_gui.h" #line 1 "v4k_gui.h"
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// game ui // game ui
@ -4423,22 +4423,9 @@ typedef struct skinned_t {
// - "_press" // - "_press"
// //
API guiskin_t gui_skinned(const char *asefile, float scale); API guiskin_t gui_skinned(const char *asefile, float scale);
#line 0 #line 0
#line 1 "v4k_steam.h"
// ----------------------------------------------------------------------------
// steam framework
API bool steam_init(unsigned app_id); #line 1 "v4k_system.h"
API void steam_tick();
API void steam_trophy(const char *trophy_id, bool redeem);
API void steam_screenshot();
API void steam_destroy();
API int ui_steam();
#line 0
#line 1 "v4k_system.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// system framework utils // system framework utils
// - rlyeh, public domain. // - rlyeh, public domain.
@ -4524,9 +4511,9 @@ API int (test)(const char *file, int line, const char *expr, bool result);
#undef test #undef test
#define test(expr) 0 #define test(expr) 0
#endif #endif
#line 0 #line 0
#line 1 "v4k_time.h" #line 1 "v4k_time.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// time framework utils // time framework utils
@ -4685,9 +4672,9 @@ API void curve_add(curve_t *c, vec3 p);
API void curve_end(curve_t *c, int num_points); API void curve_end(curve_t *c, int num_points);
API vec3 curve_eval(curve_t *c, float dt, unsigned *color); API vec3 curve_eval(curve_t *c, float dt, unsigned *color);
API void curve_destroy(curve_t *c); API void curve_destroy(curve_t *c);
#line 0 #line 0
#line 1 "v4k_ui.h" #line 1 "v4k_ui.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// immediate ui framework // immediate ui framework
// - rlyeh, public domain // - rlyeh, public domain
@ -4779,9 +4766,9 @@ API int ui_active(); // ui_is_active()?
API int ui_demo(int do_windows); API int ui_demo(int do_windows);
API void *ui_handle(); API void *ui_handle();
#line 0 #line 0
#line 1 "v4k_video.h" #line 1 "v4k_video.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// video decoder (mpeg) // video decoder (mpeg)
// - rlyeh, public domain // - rlyeh, public domain
@ -4822,9 +4809,9 @@ API void video_destroy( video_t *v );
API bool record_start(const char *outfile_mp4); API bool record_start(const char *outfile_mp4);
API bool record_active(); API bool record_active();
API void record_stop(void); API void record_stop(void);
#line 0 #line 0
#line 1 "v4k_window.h" #line 1 "v4k_window.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// window framework // window framework
// - rlyeh, public domain // - rlyeh, public domain
@ -4927,11 +4914,11 @@ API void window_cursor_shape(unsigned shape);
API const char *window_clipboard(); API const char *window_clipboard();
API void window_setclipboard(const char *text); API void window_setclipboard(const char *text);
#line 0 #line 0
// ---- // ----
#line 1 "v4k_editor.h" #line 1 "v4k_editor.h"
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// in-game editor // in-game editor
// - rlyeh, public domain. // - rlyeh, public domain.
@ -5046,31 +5033,31 @@ API char** engine_gets(const char *key);
API int engine_send(const char *cmd, const char *optional_value); API int engine_send(const char *cmd, const char *optional_value);
API int ui_engine(); API int ui_engine();
#line 0 #line 0
// ---- // ----
#if is(cpp) #if is(cpp)
} // extern "C" } // extern "C"
#endif #endif
// expose glfw/glad apis // expose glfw/glad apis
#if is(ems) #if is(ems)
#include <GL/glew.h> #include <GL/glew.h>
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#include <emscripten.h> #include <emscripten.h>
#include <emscripten/html5.h> #include <emscripten/html5.h>
#define gladLoadGL(func) (glewExperimental = true, glewInit() == GLEW_OK) ///- #define gladLoadGL(func) (glewExperimental = true, glewInit() == GLEW_OK) ///-
#else #else
#if is(win32) /*&& is(tcc)*/ // && ENABLE_DLL #if is(win32) /*&& is(tcc)*/ // && ENABLE_DLL
#ifdef GLAD_API_CALL #ifdef GLAD_API_CALL
#undef GLAD_API_CALL #undef GLAD_API_CALL
#endif #endif
#define GLAD_API_CALL extern API ///- #define GLAD_API_CALL extern API ///-
#endif #endif
#ifndef GLAD_GL_H_ #ifndef GLAD_GL_H_
#include "v4k" #include "v4k"
#endif #endif
#endif #endif
#endif // V4K_H #endif // V4K_H