main
Dominik Madarász 2024-01-01 22:06:20 +01:00
parent 433d741838
commit 9e31348378
3 changed files with 10 additions and 2 deletions

View File

@ -5,7 +5,7 @@
main() {
steam_init(0); // steam_appid: 0 to use SpaceWar vanilla project from Valve
window_create(0.75, 0);
while( window_swap() ) {

View File

@ -24041,7 +24041,8 @@ bool steam_init(unsigned app_id) {
return !strcpy(steam.status, "Err: steam not running");
}
SteamAPI_RestartAppIfNecessary(app_id);
if( SteamAPI_RestartAppIfNecessary(app_id) )
exit(0); // restarting app thru Steam client if needed
// Create interfaces
steam.iclient = (intptr_t)SteamInternal_CreateInterface("SteamClient020");

View File

@ -299,7 +299,10 @@ extern "C" {
#define ASSERT(expr, ...) do { int fool_msvc[] = {0,}; if(!(expr)) { fool_msvc[0]++; alert(va("!Expression failed: " #expr " " FILELINE "\n" __VA_ARGS__)), breakpoint(); } } while(0)
#define ASSERT_ONCE(expr, ...) do { int fool_msvc[] = {0,}; if(!(expr)) { fool_msvc[0]++; static int seen = 0; if(!seen) seen = 1, alert(va("!Expression failed: " #expr " " FILELINE "\n" __VA_ARGS__)), breakpoint(); } } while(0)
#endif
#ifndef STATIC_ASSERT
#define STATIC_ASSERT(EXPR) typedef struct { unsigned macro(static_assert_on_L) : !!(EXPR); } unique(static_assert_on_L)
#endif
#define FILELINE __FILE__ ":" STRINGIZE(__LINE__)
#define STRINGIZE(x) STRINGIZ3(x)
@ -1286,8 +1289,10 @@ API bool id_valid(uintptr_t id);
array(struct obj*) objchildren; \
};
#ifndef OBJ
#define OBJ \
OBJHEADER
#endif
// ----------------------------------------------------------------------------
// syntax sugars
@ -1324,8 +1329,10 @@ API bool id_valid(uintptr_t id);
#define OBJCOMPONENTS_ALL_FLAGGED 0x5555555555555555ULL
#define COMPONENTS_ONLY(x) ((x) & ~OBJCOMPONENTS_ALL_FLAGGED)
#ifndef ENTITY
#define ENTITY \
struct { OBJHEADER union { struct { uintptr_t objenabled:OBJCOMPONENTS_MAX, objflagged:OBJCOMPONENTS_MAX; }; uintptr_t cflags; }; void *c[OBJCOMPONENTS_MAX]; };
#endif
#define TYPEDEF_ENTITY(NAME,N,...) \
typedef struct NAME { ENTITY \