Commit Graph

251 Commits

Author SHA1 Message Date
veclavtalica
6298394957 twn_audio.c: a lot of fixes, optional TWN_FEATURE_PUSH_AUDIO for converging game ticks and audio, proper .wav handling with resample 2025-01-13 23:52:55 +03:00
veclavtalica
eefd53a630 twn_audio.c: .wav support and scratch channels 2025-01-13 19:56:20 +03:00
veclavtalica
87ae1a7312 missing textures: fix double free 2025-01-13 18:09:06 +03:00
veclavtalica
5f6c8dd8e6 missing texture when loading fails 2025-01-13 17:35:50 +03:00
veclavtalica
c694dfff82 use flatshading for space and skip setting irrelevant vertex color 2025-01-13 09:18:51 +03:00
veclavtalica
e8b02570a2 slot based allocator for lua, usage of lua_createtable 2025-01-12 02:44:41 +03:00
veclavtalica
46e077ba63 make ctx.frame_number overflow to 0 2025-01-11 17:33:05 +03:00
veclavtalica
313108092b don't use clamped float random_seed internally 2025-01-10 02:52:04 +03:00
veclavtalica
83e2dc5468 make vec4 and matrix types internal 2025-01-10 02:40:52 +03:00
veclavtalica
951d9c76c8 use floats for ctx.frame_number and ctx.random_seed 2025-01-10 02:20:21 +03:00
veclavtalica
8c401eda75 api changes and progress on filling in twn_api.json 2025-01-07 14:14:21 +03:00
veclavtalica
5b05386bb0 changes to twn.toml specification of resolution, make it optional as well 2025-01-06 21:19:26 +03:00
veclavtalica
e914cad0dd infer texture mode for triangles 2025-01-05 23:43:30 +03:00
veclavtalica
4dd028aeae support arbitrary count of billboards per batch (in regards to preallocated short index buffer) 2025-01-05 23:36:48 +03:00
veclavtalica
d7a119a592 fix aspect ratio as well as billboard scaling 2025-01-05 21:08:54 +03:00
veclavtalica
cb6c1df0be disallow ghostly billboards, reenable skybox in scenery demo 2025-01-05 19:59:23 +03:00
veclavtalica
3bfa86066e billboards! 2025-01-05 19:46:05 +03:00
veclavtalica
4f2b8ccd01 separate the rest of general drawing code 2025-01-03 21:59:00 +03:00
veclavtalica
472a0657f3 twn_draw.c: remove gl headers 2025-01-03 21:10:15 +03:00
veclavtalica
0f368e2700 move render_circle to twn_draw.c 2025-01-03 21:08:54 +03:00
veclavtalica
33471b4c46 generalization of deferred commands and any_gl rendering where appropriate 2025-01-03 21:01:26 +03:00
veclavtalica
edcb7fc39c make deferred draw primitives agnostic to backend 2025-01-03 19:59:37 +03:00
veclavtalica
f9a8448782 make SpritePrimitive take less space (52 -> 48 bytes) 2025-01-03 19:48:00 +03:00
veclavtalica
dc2535358e make input coordinates respect the viewport 2024-12-24 10:24:50 +03:00
veclavtalica
2f94e17852 twn_util_c.h: profile_list_stats() for average summary, without spam in console 2024-11-04 16:22:13 +03:00
veclavtalica
26a2bf293f twn_util_c.h: internal profiling api 2024-11-04 16:04:02 +03:00
veclavtalica
ee7fc42fbc inclide math.h so that it works under windows 2024-11-04 07:13:29 +03:00
veclavtalica
d794ca862f remove junky UncoloredSpaceTriangle union, hide vertex generation from generic triangle implementation 2024-11-03 23:08:53 +03:00
veclavtalica
26c75ffd7c optimize case of sequential shared radius circle drawing by reusing the geometry by just offsetting it 2024-11-03 22:33:18 +03:00
veclavtalica
e4da4a8b7f add a TODO 2024-11-03 21:54:55 +03:00
veclavtalica
9121da0675 yet another api rework, removal of integer types in public api, optionals at the end, some cleaning 2024-10-29 12:25:24 +03:00
veclavtalica
6464d14b3e twn_input.h: remove unbinding 2024-10-28 13:04:49 +03:00
veclavtalica
eff9fe6918 twn_util.h: make return structs comply to type naming 2024-10-28 12:39:42 +03:00
veclavtalica
d11143ac86 twn_draw.h: new camera api 2024-10-28 12:34:48 +03:00
veclavtalica
9da26638c8 rework input to be in line with rendering semantics 2024-10-22 20:32:17 +03:00
veclavtalica
a22bcfd97e rework timers, update overlap/intersect and other procedures, some other things i dont remember 2024-10-22 14:45:30 +03:00
veclavtalica
b390e9db23 audio_set() -> audio_set_parameter(), with string based convention 2024-10-22 13:52:24 +03:00
veclavtalica
5a08c01208 fix warnings 2024-10-22 11:06:02 +03:00
veclavtalica
eff2d9c5e1 direct header includes, remove redundant ones 2024-10-22 10:39:40 +03:00
veclavtalica
8aecc2bd06 fix rects render 2024-10-22 10:05:53 +03:00
veclavtalica
1296d41ad7 deferred fog, fix of first frame on double buffered option 2024-10-22 09:47:47 +03:00
veclavtalica
48f63fc9df deferred skybox, fixes to use of ARB_depth_clamp extension usage, have TextureKey explicitly in QuadBatch 2024-10-22 09:30:14 +03:00
c49789f1f4 make deferred space triangles work 2024-10-19 20:02:39 +03:00
a7b09b9f39 fix circle rendering over new impl 2024-10-19 19:16:18 +03:00
b683594013 proper size of build_vertex_buffer for circle indices 2024-10-18 18:45:17 +03:00
7e409fc14a work towards DeferredCommandDraw being universal, support for DeferredCommandDepthRange, rework of cirlce mesh (has a bug still), get_quad_element_buffer() now more general, as it should be with gl_any 2024-10-17 21:01:35 +03:00
aa3cab87d2 skip switching texture modes when they're the same as the last used 2024-10-16 22:52:10 +03:00
1dc0dea762 no need for packed types no more 2024-10-16 03:31:02 +03:00
119b706638 minor optimizations over sprite path 2024-10-15 19:32:42 +03:00
f2bbc1863e cache sprite srcrects 2024-10-15 18:43:02 +03:00
768daf1f54 move pipelines and texture modes to deferred commands 2024-10-15 18:35:08 +03:00
139394c6de partial implementation of double buffered render 2024-10-15 15:29:45 +03:00
446402c2e0 don't write unused color to vertices, utilize flat shading for only 2 important edges 2024-10-14 21:23:44 +03:00
f7a718003e send vertex data packed 2024-10-14 20:19:18 +03:00
f087bf1f7f fix depth clearing, ghostly modes not using depth layers, ortho with 0..1 2024-10-14 16:00:27 +03:00
19bf88d44e finally properly implemented depth optimization for 2d 2024-10-14 15:31:56 +03:00
3535a185df don't use depth range hack in rect case 2024-10-14 12:16:23 +03:00
d34516c4ee Merge branch 'main' of https://git.poto.cafe/wanp/townengine 2024-10-14 11:48:46 +03:00
b295c5920c rendering: use sprite batching techniques for rect primitives, unite their render path 2024-10-14 11:46:07 +03:00
f7f27119e1 use static, fixed arrays for circle geometry data instead of allocating for each one 2024-10-13 22:32:59 -03:00
ffab6a3924 cache font _files_ as well to avoid duplicate buffers 2024-10-13 21:34:05 -03:00
da98c0941b effort to have no warnings once again 2024-10-13 21:32:31 +03:00
ed93072371 twn_amalgam.c: a way for single unit compilation, controlled with -DTWN_USE_AMALGAM in cmake 2024-10-13 19:04:23 +03:00
f96d521af2 CMakeLists.txt: don't precompile stb_ds.h, precompile SDL.h 2024-10-13 18:14:36 +03:00
1a7322dccf twn_util.h: separate internal things away, remove indirect includes in places 2024-10-12 21:16:25 +03:00
e70366f82f rework to context: now there's engine and user code copies, renaming of fields, most things that shouldn't be there are hidden 2024-10-12 20:24:47 +03:00
667b599c19 remove /include/twn_config.h, move defauls to relevant headers 2024-10-11 20:21:02 +03:00
9b5c043d85 fix warnings 2024-10-08 10:30:11 +03:00
7c0107704d twn_gl_any_rendering.c: describe possible micro optimization 2024-10-08 10:22:31 +03:00
68df2eecfc fix an oopsie 2024-10-08 10:13:07 +03:00
0ede612bec twn_input: singleton rework, twn_control.h and fixes 2024-10-08 10:12:47 +03:00
aef3f6444e revert accidental commits, assert for zero-sized build_vertex_buffer(), explain the TODO on no-clear on skybox present 2024-10-08 08:30:26 +03:00
5c91423fbb clang-format on /apps/demos/bunnymark files 2024-10-08 01:21:31 +03:00
fd642171a4 twn_draw.c: clear after swap 2024-10-08 00:55:40 +03:00
1f8a225f89 twn_gl_15_rendering.c: only disable color array for sprite batch if it was used 2024-10-08 00:51:46 +03:00
f1e2fa090b twn_gl_15_rendering.c: re-enable depth write after text function 2024-10-08 00:42:15 +03:00
ac74f39c03 twn_text.c: discard empty inputs 2024-10-07 23:40:57 +03:00
fab958c963 twn_loop.c: use event watcher for more immediate resize redraw 2024-10-07 22:35:48 +03:00
7d92eff691 twn_loop.c: better log for /twn.toml misaccess 2024-10-07 20:57:02 +03:00
b0e6dd78b2 fix ratio 2024-10-07 20:29:03 +03:00
5aabab468d fix includes 2024-10-07 18:37:44 +03:00
ade1af12ca twn_rendering -> twn_draw 2024-10-07 17:53:09 +03:00
ae8cc5f50b twn_audio: rework interface 2024-10-07 15:21:44 +03:00
93aa8ff2b4 remove the assumption that game is ran from cwd at root 2024-10-07 13:22:25 +03:00
bbf79ad442 new method of pack loading, assume data or data.btw in root to point to all other 2024-10-07 12:28:15 +03:00
60a9307ce3 twn_util: separate internal c-only features from public header 2024-10-07 10:44:18 +03:00
3e972b2dad twn_input: add twn_scancode.h as port of SDL_scancode.h, remove SDL2/SDL.h header usage sa for plans on having clean public headers 2024-10-06 23:49:05 +03:00
bd99540280 add WIP lua binding app 2024-10-05 18:17:22 -03:00
dbbf6e25f0 add the long awaited push_9slice 2024-10-02 14:18:07 -03:00
452ecd72fe twn_sprites.c: fix texture region 2024-10-02 19:39:27 +03:00
0dc3cf4160 twn_rendering: have triangle uvs represented by floating vectors 2024-10-01 20:52:32 +03:00
b75ff20014 twn_gl_15_rendering.c: fix endlessly generating display lists 2024-10-01 18:38:54 +03:00
900a0a7506 twn_loop.c: delete gl context on cleanup, some implementations triggered leak detector otherwise 2024-10-01 18:21:27 +03:00
ad0438849e twn_fog.c: fog added! 2024-10-01 16:10:36 +03:00
9efcd79ba6 twn_gl_15_rendering.c: don't assume seethrough triangle textures, infer actual usage 2024-10-01 15:23:06 +03:00
d163e0f7ae twn_gl_15_rendering.c: better caching of pipelines 2024-10-01 15:18:05 +03:00
2ebb2ba53b twn_gl_15_rendering.c: disable depth writes for skybox 2024-10-01 15:17:51 +03:00
aa5ff1edf1 twn_gl_15_rendering.c: use display lists to cache common series of calls 2024-10-01 14:58:00 +03:00
91ea5356fc fix variout memory leaks 2024-10-01 13:34:58 +03:00
9ab7d1edff twn_gl_15_rendering.c: fix memory leak in finally_render_skybox() 2024-10-01 13:22:20 +03:00