Compare commits

..

12 Commits

Author SHA1 Message Date
mid
b7c0b0780c And it all ended with a real bug to fix; how poetic
All checks were successful
k4 Build Test / do_the_build (push) Successful in 43s
2026-01-22 22:44:30 +02:00
mid
46bd5e8d5e this better be all
All checks were successful
k4 Build Test / do_the_build (push) Successful in 44s
2026-01-22 21:59:50 +02:00
mid
d614e2ced4 just use /dev/urandom
All checks were successful
k4 Build Test / do_the_build (push) Successful in 46s
2026-01-22 21:18:29 +02:00
mid
57fffeb0a3 update 12-win32 to 14-win32
All checks were successful
k4 Build Test / do_the_build (push) Successful in 34s
2026-01-21 22:52:32 +02:00
mid
def545450d add freetype and libz
Some checks failed
k4 Build Test / do_the_build (push) Failing after 24s
2026-01-21 22:49:02 +02:00
mid
9b7ecb3ae7 update k3 commit
Some checks failed
k4 Build Test / do_the_build (push) Failing after 24s
2026-01-21 22:27:45 +02:00
mid
9c2e4ffae1 can't be bothered
Some checks failed
k4 Build Test / do_the_build (push) Failing after 12s
2026-01-21 22:25:24 +02:00
mid
3e14195bf7 What about this, dumbfuck
Some checks failed
k4 Build Test / do_the_build (push) Failing after 5s
2026-01-21 22:22:54 +02:00
mid
055ff4f5ce fixes for build
Some checks failed
k4 Build Test / do_the_build (push) Failing after 4s
2026-01-21 22:20:15 +02:00
mid
4d0e043f4c use latest k3 commit
Some checks failed
k4 Build Test / do_the_build (push) Failing after 5s
2026-01-21 20:54:20 +02:00
mid
3da728c768 Try automated build on Debian 9
Some checks failed
k4 Build Test / do_the_build (push) Failing after 8s
2026-01-21 20:46:43 +02:00
mid
8857b93f90 Updated changelog 2026-01-18 13:52:01 +02:00
6 changed files with 23 additions and 10 deletions

View File

@@ -14,9 +14,9 @@ jobs:
with:
submodules: 'true'
- run: mkdir build build/k3 build/k3/compr bin bin/assets
- run: CC="i686-w64-mingw32-gcc" CFLAGS="-I/usr/i686-w64-mingw32/include -I/usr/i686-w64-mingw32/include/lua5.3 -L/usr/i686-w64-mingw32/lib -Wno-error" make -B
- run: CC="i686-linux-gnu-gcc" CFLAGS="-I/usr/i686-linux-gnu/include -I/usr/i686-linux-gnu/include/lua5.3 -L/usr/i686-linux-gnu/lib -Wno-error -include /home/git/force_link_glibc_2.20.h" make -B
- run: cp /usr/lib/gcc/i686-w64-mingw32/12-win32/libgcc_s_dw2-1.dll /usr/lib/gcc/i686-w64-mingw32/12-win32/libstdc++-6.dll /usr/i686-w64-mingw32/lib/libportaudio-2.dll /usr/i686-w64-mingw32/lib/libwinpthread-1.dll /usr/lib/gcc/i686-w64-mingw32/12-win32/libgomp-1.dll bin/
- run: LIBS="-lfreetype -l:libz.a" CC="i686-w64-mingw32-gcc" CFLAGS="-I/usr/i686-w64-mingw32/include -I/usr/i686-w64-mingw32/include/lua5.3 -L/usr/i686-w64-mingw32/lib -Wno-error" make -B
- run: cp /usr/lib/gcc/i686-w64-mingw32/14-win32/libgcc_s_dw2-1.dll /usr/lib/gcc/i686-w64-mingw32/14-win32/libstdc++-6.dll /usr/i686-w64-mingw32/lib/libportaudio-2.dll /usr/i686-w64-mingw32/lib/libwinpthread-1.dll /usr/lib/gcc/i686-w64-mingw32/14-win32/libgomp-1.dll bin/
- run: curl "http://127.0.0.1:9898/build?root=${{ github.workspace }}"
- run: cp -r /home/git/k4templateassets/* bin/assets/
- run: mv bin k4
- run: zip -9r "k4${{ github.ref_name }}.zip" k4/

View File

@@ -10,14 +10,14 @@ k3_HDRS := $(call rwildcard,k3/src,*.h)
k3_OBJS := $(patsubst k3/src/%.c, build/k3/%.o, $(k3_SRCS))
k3_DEPS := $(patsubst k3/src/%.c, build/k3/%.d, $(k3_SRCS))
CFLAGS := $(CFLAGS) -D_GNU_SOURCE -D_DEFAULT_SOURCE -Ik3/src -O2 -fopenmp -flto -s
CFLAGS := $(CFLAGS) -D_GNU_SOURCE -D_DEFAULT_SOURCE -DGLCA_CUSTOM_GLYPH_DATA -Ik3/src -fopenmp -O2 -flto -fwhole-program -Wno-error=incompatible-pointer-types -Wno-error=int-conversion
ifneq (,$(findstring mingw,$(CC)))
CFLAGS := -static-libgcc -static-libstdc++ -std=gnu99 -march=pentium4 -D_WIN32_WINNT=0x600 -DENET_FEATURE_ADDRESS_MAPPING -fno-pic -no-pie -fms-extensions -fno-pie -Isrc $(CFLAGS)
LIBS := -l:libglfw3.a -lopengl32 -pthread -lm -l:libode.a -l:libvorbisfile.a -l:libvorbis.a -l:libogg.a -lportaudio -lgdi32 -lws2_32 -lwinmm -lstdc++ -lole32 -lsetupapi -lhid -l:liblua5.3.a -liphlpapi $(LIBS)
else
CFLAGS := -march=opteron $(SAN) -std=gnu99 -DENET_FEATURE_ADDRESS_MAPPING -fms-extensions -fno-pic -no-pie -fno-pie -Isrc $(CFLAGS)
LIBS := -lglfw3 -pthread -ldl -lm -lode -lstdc++ -llua5.3 -lvorbis -lvorbisfile -lportaudio $(LIBS)
LIBS := -lglfw3 -pthread -ldl -lm -lode -lstdc++ -llua5.3 -lvorbis -lvorbisfile -logg -lasound -lfreetype -lportaudio -lz $(LIBS)
endif
CFLAGS := $(CFLAGS) -DLOCALHOST_ONLY

View File

@@ -11,6 +11,10 @@ Homepage: https://mid.net.ua/k4.html
5. Replaced the font subsystem with one that uses TrueType fonts directly, and they are drawn using signed distance fields when possible
6. Added `game.near` and `game.far` values for editing the camera planes
7. Added vsync parameter to command line
8. Graphics bug fixes
9. Improved mipmapping
10. Frustum culling
11. Added support for 32-bit indices in models
## v1

2
k3

Submodule k3 updated: 4d74b5e3e9...56ecba05b1

View File

@@ -19,6 +19,7 @@
#include<GLFW/glfw3.h>
#include"ssort.h"
#include<ctype.h>
#include<math.h>
/*
* This is by far the least clean or well-maintained source in the
@@ -341,7 +342,9 @@ static int game_addentity(lua_State *L) {
setstrstatic("mdl", c.mdl, sizeof(c.mdl));
c.cache = k3MdlCopySubs((struct k3Mdl*) resman_ref(RESMAN_MODEL, c.mdl));
if(strlen(c.mdl)) {
c.cache = k3MdlCopySubs((struct k3Mdl*) resman_ref(RESMAN_MODEL, c.mdl));
}
game_addcomponent(render, &c);
}
@@ -1722,7 +1725,7 @@ static int dagame_mdl(lua_State *L) {
}
lua_pop(L, 1);
struct k3Mdl *mdl = k3MdlCreate(vertexCount, indexCount, 0, positions, normals, uvs, NULL, NULL, NULL, indices, NULL, NULL);
struct k3Mdl *mdl = k3MdlCreate(vertexCount, indexCount, 0, positions, normals, (float*) uvs, NULL, NULL, NULL, indices, NULL, NULL);
struct k3Mdl **ud = lua_newuserdata(L, sizeof(*ud));
*ud = mdl;
@@ -1855,7 +1858,7 @@ static int dagame_ray_get(lua_State *L) {
return 1;
} else if(!strcmp(key, "ready")) {
lua_pushboolean(L, !isnanf(lr->out[0]));
lua_pushboolean(L, !isnan(lr->out[0]));
return 1;
}

View File

@@ -8,7 +8,6 @@
#else
#include<netdb.h>
#include<sys/socket.h>
#include<sys/random.h>
#include<arpa/inet.h>
#include<ifaddrs.h>
#endif
@@ -36,6 +35,13 @@
#define RAND(b, i) RtlGenRandom(b, i)
#else
#define RAND(b, i) getrandom(b, i, 0)
static void getrandom(void *buf, size_t amount, int flags) {
static FILE *f;
if(!f) {
f = fopen("/dev/urandom", "rb");
}
fread(buf, 1, amount, f);
}
#endif
struct StunMsg {