Compare commits
12 Commits
cf0f402da3
...
v2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b7c0b0780c | ||
|
|
46bd5e8d5e | ||
|
|
d614e2ced4 | ||
|
|
57fffeb0a3 | ||
|
|
def545450d | ||
|
|
9b7ecb3ae7 | ||
|
|
9c2e4ffae1 | ||
|
|
3e14195bf7 | ||
|
|
055ff4f5ce | ||
|
|
4d0e043f4c | ||
|
|
3da728c768 | ||
|
|
8857b93f90 |
@@ -14,9 +14,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: 'true'
|
submodules: 'true'
|
||||||
- run: mkdir build build/k3 build/k3/compr bin bin/assets
|
- 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: 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: 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/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: 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: curl "http://127.0.0.1:9898/build?root=${{ github.workspace }}"
|
||||||
- run: cp -r /home/git/k4templateassets/* bin/assets/
|
- run: cp -r /home/git/k4templateassets/* bin/assets/
|
||||||
- run: mv bin k4
|
- run: mv bin k4
|
||||||
- run: zip -9r "k4${{ github.ref_name }}.zip" k4/
|
- run: zip -9r "k4${{ github.ref_name }}.zip" k4/
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -10,14 +10,14 @@ k3_HDRS := $(call rwildcard,k3/src,*.h)
|
|||||||
k3_OBJS := $(patsubst k3/src/%.c, build/k3/%.o, $(k3_SRCS))
|
k3_OBJS := $(patsubst k3/src/%.c, build/k3/%.o, $(k3_SRCS))
|
||||||
k3_DEPS := $(patsubst k3/src/%.c, build/k3/%.d, $(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)))
|
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)
|
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)
|
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
|
else
|
||||||
CFLAGS := -march=opteron $(SAN) -std=gnu99 -DENET_FEATURE_ADDRESS_MAPPING -fms-extensions -fno-pic -no-pie -fno-pie -Isrc $(CFLAGS)
|
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
|
endif
|
||||||
|
|
||||||
CFLAGS := $(CFLAGS) -DLOCALHOST_ONLY
|
CFLAGS := $(CFLAGS) -DLOCALHOST_ONLY
|
||||||
|
|||||||
@@ -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
|
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
|
6. Added `game.near` and `game.far` values for editing the camera planes
|
||||||
7. Added vsync parameter to command line
|
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
|
## v1
|
||||||
|
|
||||||
|
|||||||
2
k3
2
k3
Submodule k3 updated: 4d74b5e3e9...56ecba05b1
@@ -19,6 +19,7 @@
|
|||||||
#include<GLFW/glfw3.h>
|
#include<GLFW/glfw3.h>
|
||||||
#include"ssort.h"
|
#include"ssort.h"
|
||||||
#include<ctype.h>
|
#include<ctype.h>
|
||||||
|
#include<math.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is by far the least clean or well-maintained source in the
|
* 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));
|
setstrstatic("mdl", c.mdl, sizeof(c.mdl));
|
||||||
|
|
||||||
|
if(strlen(c.mdl)) {
|
||||||
c.cache = k3MdlCopySubs((struct k3Mdl*) resman_ref(RESMAN_MODEL, c.mdl));
|
c.cache = k3MdlCopySubs((struct k3Mdl*) resman_ref(RESMAN_MODEL, c.mdl));
|
||||||
|
}
|
||||||
|
|
||||||
game_addcomponent(render, &c);
|
game_addcomponent(render, &c);
|
||||||
}
|
}
|
||||||
@@ -1722,7 +1725,7 @@ static int dagame_mdl(lua_State *L) {
|
|||||||
}
|
}
|
||||||
lua_pop(L, 1);
|
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));
|
struct k3Mdl **ud = lua_newuserdata(L, sizeof(*ud));
|
||||||
*ud = mdl;
|
*ud = mdl;
|
||||||
@@ -1855,7 +1858,7 @@ static int dagame_ray_get(lua_State *L) {
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} else if(!strcmp(key, "ready")) {
|
} else if(!strcmp(key, "ready")) {
|
||||||
lua_pushboolean(L, !isnanf(lr->out[0]));
|
lua_pushboolean(L, !isnan(lr->out[0]));
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#else
|
#else
|
||||||
#include<netdb.h>
|
#include<netdb.h>
|
||||||
#include<sys/socket.h>
|
#include<sys/socket.h>
|
||||||
#include<sys/random.h>
|
|
||||||
#include<arpa/inet.h>
|
#include<arpa/inet.h>
|
||||||
#include<ifaddrs.h>
|
#include<ifaddrs.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -36,6 +35,13 @@
|
|||||||
#define RAND(b, i) RtlGenRandom(b, i)
|
#define RAND(b, i) RtlGenRandom(b, i)
|
||||||
#else
|
#else
|
||||||
#define RAND(b, i) getrandom(b, i, 0)
|
#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
|
#endif
|
||||||
|
|
||||||
struct StunMsg {
|
struct StunMsg {
|
||||||
|
|||||||
Reference in New Issue
Block a user