Commit Graph

196 Commits

Author SHA1 Message Date
8d0e825157 rewrite copyright file header to provide more information about where the file is from. 2025-11-13 22:24:09 +01:00
316726a610 tmp: revert enabling a column limit 2025-10-16 23:35:30 +02:00
1aa34f7d3f enable a column limit. 2025-10-09 21:12:53 +02:00
00719b1933 refactor code with new formatting rules
Functions now break before their brace, mirroring the Linux kernel.
The reason for this is that breaking the parameter list otherwise makes
code unreadable.
2025-10-09 19:02:16 +02:00
eb45650178 fix: use uintptr over usize in locations where applicable 2025-10-09 18:35:39 +02:00
8ca49aa4fa fix: ssize got removed in rework of intdef.h/types.h. 2025-10-09 12:28:24 +02:00
d4fabf437c reformat the code by enabeling assignment- and declaration alignment. 2025-10-09 12:17:04 +02:00
cebe0df8a2 move /src/error.? to /src/util/error.? 2025-10-09 12:16:38 +02:00
aa58d931aa move /src/util/intdef.h to /src/util/types.h 2025-10-09 12:16:06 +02:00
27c862c215 rework intdef.h to not rely upon standard library headers by using predefined macros. 2025-10-09 12:05:05 +02:00
6eb7d126da create a custom definition for size_t and ssize_t, which is ssize and usize, for conveinience. 2025-09-18 10:39:57 +02:00
76c992efdc note about the memory leak I could not locate within my code.
hint: I couldn't locate it, because it isn't in my code.
2025-09-15 15:14:08 +02:00
28b98705f5 refactor the lot a bit, for clairity. 2025-09-15 15:08:15 +02:00
057b234251 fix: don't free window twice 2025-09-15 15:07:41 +02:00
dd2f4c403c add copyright information to error.c 2025-09-15 14:23:03 +02:00
dc3abf992b handle window exits more gracefully and appropriately. 2025-09-15 14:23:03 +02:00
1e10fec9c6 rename input callback to something more appropriate. 2025-09-15 14:12:18 +02:00
41d944ac21 remove old/stale code from main.c 2025-09-15 14:00:40 +02:00
faa93f4372 remove needless inline function from main.c
this is shorter, does the same, and this was an incorrect application of
`inline`.
2025-09-15 13:58:47 +02:00
e3c0afbb2f fix: glfw error logging inconsistent with how the rest of our application logs errors. 2025-09-15 13:55:32 +02:00
25fa078c98 add a check for debug logging, to only log when the environment variable DEBUG is set to 1 2025-09-15 13:51:36 +02:00
023123e54f make debug loggers not be needlessly abbreviated. 2025-09-15 13:06:20 +02:00
b04ce9998f fix: shader hex code is formatted incorrectly 2025-09-15 11:59:39 +02:00
218b98e684 fix: colour coding on error messages is incorrect 2025-09-15 11:59:39 +02:00
f20171c0d7 fix: using the linker for generating a .o file is a feature for only GNU ld.
Now utilising a process to generate a .c file using `xxd`, and compiling
those to object files.
2025-09-15 11:59:39 +02:00
4f081e7f3e remove usage of mempcpy; this is apart of GNU C 2025-09-13 21:09:56 +02:00
8548c2d037 fix: log macros were using GNU extensions without them needing them.
We can optionally add `,` utilising the `__VA_OPT__` macro. However,
this lead to the next problem, which is that an empty vardiac parameter
is a C23 extension. This was solved by dropping the string parameter,
making it be part of the vardiac parameters.
2025-09-13 20:25:38 +02:00
f0d14e76b2 write decompression logic up to the point of hanelling the buffer. 2025-09-10 12:52:35 +02:00
07f4ea34d2 macro flipped const char 2025-09-10 12:07:00 +02:00
5de0c77992 start writing code for decompressing chunk data.
I still haven't much of an idea where I'll take this, but it's a start.

I know it is needed for block filtering and such, I still need to find a
way how I'll actually implement it.
2025-09-10 11:37:20 +02:00
2cfae0fce4 rework error.h, to decrease impact on binary size.
We were statically creating a new string per log message, so re-using
the same message would cause duplicate byte sizes.
Now, all prefixes / suffixes are only defined once, the file name is
defined once per file, the line number should be defined once per unique
line.
This just saves some memory in the final binary, allowing things to be
optimised a little better.
2025-09-10 11:37:20 +02:00
d933931829 fix: shouldn't multiply by CHUNKS, but by SECTOR 2025-09-10 10:13:26 +02:00
f020347f71 change mvchunks parameter order, to be a bit more clear and consistent with functions such as memmove 2025-09-10 10:13:26 +02:00
b13de01f24 fix: violating strict aliasing rules in most areas in the new code.
Yes, I am aware there are plenty of violations in `conf.c`, but I'll
likely fix/rewrite those when I will use it. Since there are some other
changes I think I'll want to make.
2025-09-10 10:13:26 +02:00
b72b8eaee1 add comments to point at where strict aliasing rule violations occur in data scripts
this is definitely not all of them, a thorough rewrite must take place
to fix as many as we can.
2025-09-10 10:13:26 +02:00
55635d44ae delete redundant COLOUR32 definitions 2025-09-10 10:13:26 +02:00
4fa0b41e7a add quit in main.c to atexit, for added safety 2025-09-10 10:13:26 +02:00
8a5afd6915 write a portable version of endian.h, to replace the system's endian.h.
utilising GNU C standard library for some of the functionality, or GNU C
extensions.
2025-09-10 10:13:26 +02:00
0baadfca75 update copyright information in all files
the comment was using single-line comments, I prefer multi-line comments
now.
This bothered me for much too long.
2025-08-29 09:36:55 +02:00
9a45294e56 write some constants for mcx.c, so things are less error-prone. 2025-08-29 09:35:02 +02:00
5b5f1f54af remove unneeded code 2025-08-28 16:46:27 +02:00
f1141e0db4 fix: not moving chunks correctly in mcx_delchunk_range 2025-08-28 10:59:30 +02:00
15942b47f5 fix: assertion was inverted 2025-08-28 10:57:00 +02:00
bc8803525d update comments and a parameter name in mcx.h 2025-08-27 14:57:34 +02:00
7531d786be add a function for range deleting chunks 2025-08-27 14:50:35 +02:00
2c5b9def28 should set the spare chunk to 0x400, not 0 2025-08-27 14:50:35 +02:00
cd277873b5 split apart the moving of the data, for further flexibility 2025-08-27 14:50:35 +02:00
f203cabad9 fix: endianess was (often) converted after performing computations or missing completely. 2025-08-27 14:47:50 +02:00
28dd8af353 add comments 2025-08-27 14:38:30 +02:00
9c690eb327 add NONNULL attributes to chunk deletion functions 2025-08-27 12:58:59 +02:00