Commit graph

17 commits

Author SHA1 Message Date
Kp 697ef5c32a Use std::array for last_palette_loaded_pig 2023-04-15 19:11:14 +00:00
Kp 0b066d23b4 Use enum class for load_palette arguments 2023-04-15 19:11:14 +00:00
Kp 2ecad00e90 Pass std::span to load_palette 2022-09-24 17:47:52 +00:00
Kp 522c696af0 Remove unnecessary members in splitpath_t
splitpath_t is designed for MS-DOS paths, even though Rebirth now runs
on many platforms that never used DOS conventions.  Most of the members
of splitpath_t are unused on all platforms.  Remove them, and switch to
returning an initialized version of the structure.
2022-06-11 15:00:02 +00:00
Kp 175fc1f650 Fix gcc-9 -Wstringop-truncation in gamepal.cpp 2019-05-11 20:18:29 +00:00
Kp 6a3ded191f Move EDITOR to dxxsconf.h; rename to DXX_USE_EDITOR
Rename symbol EDITOR to DXX_USE_EDITOR to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -wl EDITOR -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(EDITOR\)\>/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(EDITOR\))/#\1if \2DXX_USE_\3/' -e 's/^\s*#ifndef \(EDITOR\)\>/#if !DXX_USE_\1/'
2016-09-11 18:49:16 +00:00
Kp bbdecad649 Add helper macro to handle printf .* conversion for 32/64
Field width conversion `.*` always takes an `int`.

On Win32, casting `long` to `int` triggers a `-Wuseless-cast` warning.
Omitting the cast works correctly.

On Linux/amd64, casting `long` to `int` works correctly.
Omitting the cast triggers a `-Wformat` warning.

Add a macro that conditionally expands to `static_cast<int>` or to ``,
as necessary for the target platform.
2016-08-19 03:41:41 +00:00
Kp b282bea173 Rewrite simple integer casts from C style to static_cast<>
This pass only targets commonly used standard types.

s/(\(\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\)\s*)\s*(/static_cast<\1>(/g
2016-06-05 01:04:26 +00:00
Kp 26e948d5f1 Uninline namespace dsx 2015-12-13 18:00:49 +00:00
Kp 8109379fdd Use inline namespace dsx for similar/misc/ 2015-12-13 18:00:48 +00:00
Kp 8a97c173a3 Remove useless gr_remap_mono_fonts
gr_remap_mono_fonts searches for fonts with !(font->ft_flags & FT_COLOR)
and calls gr_remap_font on any it finds.

gr_remap_font starts with:

	if (!(font->ft_flags & FT_COLOR))
		return;
2015-12-04 03:36:32 +00:00
Kp fa73ca8a17 Pass gr_remap_bitmap_good arg by & 2015-01-25 05:32:45 +00:00
Kp 0f30d4eb72 Use PHYSFSX_gets_line_t for Current_level_palette 2014-12-20 04:36:08 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp b1c5307eb1 Use array for palette_array_t 2013-12-22 00:37:36 +00:00
Kp a3d66a3b37 Add typedef palette_array_t for palette data 2013-12-22 00:05:13 +00:00
Kp a7eadf58f4 Move d2x-rebirth/main/gamepal.c -> d2x-rebirth/main/gamepal.cpp 2013-11-09 18:07:28 +00:00
Renamed from d2x-rebirth/main/gamepal.c (Browse further)