Commit Graph

44 Commits

Author SHA1 Message Date
Azamat H. Hackimov
ad3aa8bb42 Cleanup misc submodule
Move common parts from platform-specific ifdefs.
2024-09-10 03:00:26 +03:00
Azamat H. Hackimov
c6ab519652 Add plog library as logging facility
Added additional cmake option `USE_SYSTEM_PLOG`.
2024-09-10 03:00:23 +03:00
Thomas Roß
69945e93a8 [Misc] Deleted leftover empty logging code. 2024-08-20 20:03:02 +02:00
Azamat H. Hackimov
1026a6e80b
Merge pull request #527 from tophyr/pr/modernize-renderer
Modernize Renderer
2024-08-20 19:00:43 +03:00
Chris Sarbora
d61deae68d
add rudimentary shaders and machinery 2024-08-18 02:52:46 -05:00
Azamat H. Hackimov
8943c676a1 MISC: Add StringJoin() and StringSplit() functions
Added new functions for std::string manipulation.
2024-08-15 11:48:16 +03:00
Azamat H. Hackimov
73373205e5
Merge pull request #517 from Lgt2x/cmake-headers
CMake: add all headers to target sources
2024-08-12 15:58:05 +03:00
Thomas Roß
1809f48ca9 [Misc] Removed some leftover debug stuff that does nothing anymore. 2024-08-10 18:44:29 +02:00
Louis Gombert
60c5dbf1fe CMake: add all headers to target sources
This can help with CMake IDE integration and file indexing.
2024-08-09 17:09:14 +02:00
C.W. Betts
1384aa62af Quiet warnings about uninitialized values. 2024-07-31 15:40:16 -06:00
Chris Sarbora
3da53e567f
Programmatically replace all __LINUX__ with POSIX
Steps:
```sh
srcs=$(mktemp)
find . -name "*.cpp" -or -name "*.c" -or -name "*.h" -or -name "*.hpp" -or -name "*.cc" -or -name "*.hh" > $srcs
xargs sed -i 's/ifndef __LINUX__/if !defined(POSIX)/' < $srcs
xargs sed -i 's/ifdef __LINUX__/if defined(POSIX)/' < $srcs
xargs sed -i 's/defined(__LINUX__)/defined(POSIX)/' < $srcs
```
2024-07-12 18:11:54 -05:00
Thomas Roß
12ec7c50c7 [CMake] Enabled the CMake property USE_FOLDERS to provide a more structured project list in IDEs with the help of set(CMAKE_FOLDER "...") calls. 2024-07-03 19:55:04 +02:00
Thomas Roß
e961d7c05d [Misc] Removed cast of assert condition to unsigned int to prevent pointer truncation.
This fixes over one thousand warnings of type:
C4311 'type cast': pointer truncation from 'foo *' to 'unsigned int'
C4302 'type cast': truncation from 'foo *' to 'unsigned int'
2024-06-29 21:47:28 +02:00
Louis Gombert
74c7b2cb0c Fix bad rebase for sdlmain.cpp 2024-06-29 18:28:23 +02:00
Azamat H. Hackimov
59487976f6 Isolate misc module
Isolate misc module for better dependency handling.
2024-06-27 01:26:35 +03:00
Louis Gombert
bcca92722d Release build fixes 2024-06-07 23:50:38 +02:00
Louis Gombert
b8949f292d more windows editor fixes 2024-06-07 21:41:40 +02:00
GravisZro
9cf9781369 Properly format/use variadic macros 2024-05-24 20:57:17 -04:00
GravisZro
fe855cf85e Fix missing header includes/restore third-party files 2024-05-23 23:14:40 -04:00
GravisZro
1618040db5 Replace "unsigned char" with "uint8_t" 2024-05-23 22:58:46 -04:00
GravisZro
fb74b66bdf Fix RAND_MAX overflow errors
In `psrand.h` it attempts to undefine RAND_MAX and then redefine it.
This may work on some compilers but G++/Clang. To resolve this error
RAND_MAX was renamed to D3_RAND_MAX but **only** in files that
included `psrand.h`. The code behavior should restored to that of the
official release.
2024-05-23 20:51:25 -04:00
GravisZro
dec9de7456 64-bit fixes
Switch all the (u)long types to (u)int32_t where appropriate.
2024-05-22 18:14:45 -04:00
Louis Gombert
959da14ff5 Remove spdlog dependency, keep the logging module 2024-05-14 14:12:03 +02:00
JeodC
a4ab78192c Join license header with historical commentrs
Join the license header with historical comments using a separator so IDEs can correctly parse the initial header.

Also use .gitattributes to ensure all files are LF.
2024-05-08 14:41:19 -04:00
Azamat H. Hackimov
d82d3a2c3a Unittests for misc
Unittests that used for testing refactored CleanupStr() in #207.
2024-05-01 02:46:20 +03:00
Azamat H. Hackimov
b063f40b1a
Merge pull request #207 from Nakhr11n/pstring-refactor
Refactor CleanupStr in misc/pstring.cpp
2024-05-01 00:45:03 +03:00
bperris
27eadbf66b
Merge branch 'main' into new-log-system 2024-04-30 14:38:11 -04:00
Bryan Perris
b0e5754e96 Introduce spdlog logging system
* The game version is now printed via the log system rather than from within the loki_initialize function.
remove this line
2024-04-30 14:27:38 -04:00
Azamat H. Hackimov
2aece028d0 Move debug functions to own module
This commit is part of efforts to isolate subsystems of project into own modules.
2024-04-30 00:58:34 +03:00
Oskar Strengbohm
ee12e3a5dd misc: pstring: Improve CleanupStr. 2024-04-29 22:11:57 +02:00
Oskar Strengbohm
4582b44eb3 misc: pstring: Refactor dependents. 2024-04-29 10:01:33 +02:00
Oskar Strengbohm
f9fdfc22e8 misc: pstring: Remove unneccesary or unused functions. 2024-04-29 09:55:45 +02:00
Ryan C. Gordon
6c8977caf0
Heavy patching for compiler warnings.
The vast majority of this is fixing up `char *` that should be `const char *`
but a handful of other fixes, like potential buffer overflows that GCC
noticed, etc, were applied as well.

This removes `-Wno-write-strings` from CMakeLists.txt, as it is no longer
necessary, as there is no longer a flood of compiler warning spam when
building.

This does not fix all compiler warnings; there are still a handful, and they
are legitimate, but they can be dealt with in a future commit.
2024-04-29 00:18:56 -04:00
Chris Sarbora
e6ba1906c9
Remove MacOS (Classic) code and all references (1/3)
The MACINTOSH define refers to MacOS Classic (not OS X) which we do not
plan to support. Rather than carry the cruft forever, let's delete it.

NOTE: legacy/ is unused but we're keeping it around, so MACINTOSH uses
there are left alone.

Process used for this commit:
```
git rm -r mac
find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" \) \
  -exec unifdef -UMACINTOSH -o {} {} \;
git restore legacy
git add .
```

Test Plan:
On Mac, build both Debug and Release
```
cmake --build --preset mac --config Debug
cmake --build --preset mac --config Release
```
2024-04-27 07:38:14 -07:00
Oskar Strengbohm
b54d22614d misc: Remove endian.cpp and lib/psendian.h
They were not used, and a better alternative is now lib/byteswap.h
2024-04-24 17:27:21 +02:00
Thomas Otto
00389c50ea Some more CMake white space formatting
- tabs to spaces
 - use Unix line endings everywhere
 - newline at end of file
 - remove trailing white space
 - no space between keywords and opening parenthesis
 - use 2 spaces to indent
2024-04-21 11:46:32 +02:00
Kevin Bentley
1f45163248 Updated source to reflect the license that this code is released under. 2024-04-20 09:57:49 -06:00
Louis Gombert
c2b71b8147 Standardize CMake formatting
lowercase function names, blocks indent
2024-04-20 14:45:49 +02:00
C.W. Betts
7d7f5bf896 Quiet Clang Static Analyzer warnings.
Most of the warnings were caused by uninitialized values. Some were in plug-ins that didn't have a break in a switch, causing the memory to be deleted twice.
2024-04-19 17:42:17 -06:00
C.W. Betts
57078ae4b5 Change most sprintf to snprintf.
This also includes vsprintf to vsnprintf.
2024-04-19 12:31:28 -06:00
Thomas Otto
26266d625c Unix: set -std=c++17 explicitly
remove register keyword, add cstdint include
2024-04-17 01:38:18 +02:00
Azamat H. Hackimov
38128ea134 Additional clang-format 2024-04-17 00:25:04 +03:00
Kevin Bentley
c6640cc631 clang-format on everything. 2024-04-16 12:56:40 -06:00
Kevin Bentley
df209742fc Initial import 2024-04-15 21:43:29 -06:00