Commit graph

38 commits

Author SHA1 Message Date
Kp bdeca5687e Remove unused copy_diminish_palette
Fixes: f413017317 ("Delegate bald_guy_load PCX to SDL image")
2022-07-02 18:10:45 +00:00
Kp c99b67e359 Switch callers to unchecked_partial_range(range) where possible
Use unchecked_partial_range(range) instead of
unchecked_partial_range(iterator), since the range form can preserve the
underlying index_type.
2021-09-04 12:17:14 +00:00
Kp 1354099b0d Move Computed_colors into gr_find_closest_color
- Inline add_computed_color into gr_find_closest_color, and then only
  one function will need access to Computed_colors.
- Allow the recent-choice bubble-up logic to apply to all elements
- If all entries are in use, always overwrite the last element in
  Computed_colors instead of picking one randomly.
2021-09-04 12:17:14 +00:00
Kp ae3dc7f934 Simplify computed color reset
gr_find_closest_color did not need it.  Remove it.  For the others,
resetting the count is sufficient.  There is no need to reset the
individual elements.
2021-09-04 12:17:14 +00:00
Kp 347b8d9f77 Factor out palette color search code 2021-09-04 12:17:14 +00:00
Kp f9ed412ba6 Move use of SQUARE into a helper
Give the compiler discretion over whether to inline the multiplications.
2021-08-26 03:13:45 +00:00
Kp 1c13d3c8d3 Improve error reporting for PHYSFSX_openReadBuffered
Return the PHYSFS error code on failure, so that callers can report why
the open failed.
2021-07-25 23:00:56 +00:00
Dmitry Grigoryev fbd05a1592 optimize include files (include what you use) 2021-02-06 21:38:50 +01:00
Kp c0601edde3 Move GammaLevel to CCfg 2020-12-27 22:03:09 +00:00
Kp fc63029833 Move more symbols into namespaces 2020-12-26 21:17:29 +00:00
Kp 6285878c4c Add color_palette_index type alias, to note palette-related uint8_t 2020-07-16 02:31:04 +00:00
Kp 3114874713 Delegate PCX loading to SDL_image
This adds a new dependency, but most systems likely already have
SDL_image installed.  Use of SDL_image can be disabled, but this is
discouraged, because various in-game interfaces assume the use of the
original background.

The old implementation automatically corrected for filename case.  The
new implementation expects that the supplied filename can be passed to
PYHSFS_openRead as-is.  All known uses in-game have been corrected to
satisfy this requirement.  If the new stricter match requirement becomes
a problem, a variant of PHYSFSRWOPS_openRead that adjusts filename case
could be created for use here.

- Update install instructions
- Update ebuild
- Update Arch PKGBUILD
2020-05-17 23:35:26 +00:00
Kp 8839f538e0 Refer to <array> directly, not through "compiler-array.h" 2020-05-02 21:18:42 +00:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp b3809266a3 Use enumerate in more loops 2016-12-11 01:56:44 +00:00
Kp 27cef20eb3 Move namespace dsx handling to dsx-ns.h 2016-03-19 19:08:10 +00:00
Kp db9fb0ed42 Move more symbols into namespace dcx/dsx 2015-12-22 04:18:50 +00:00
Kp 26e948d5f1 Uninline namespace dsx 2015-12-13 18:00:49 +00:00
Kp dc8c0323d8 Uninline namespace dcx 2015-12-13 18:00:49 +00:00
Kp 85d7c495e8 Use inline namespace dsx for similar/2d 2015-12-13 18:00:48 +00:00
Kp f668705f20 Use array<> for Computed_colors 2015-04-26 20:15:57 +00:00
Kp 67e5e8c6c1 Remove unused gr_make_blend_table 2015-04-26 20:15:57 +00:00
Kp ace2235ad8 Remove unused gr_make_cthru_table 2015-04-26 20:15:57 +00:00
Kp 9274e56a41 Simplify gr_find_closest_color exit 2015-04-26 20:15:56 +00:00
Kp f7815810e8 Use RAIIPHYSFS_File to manage PHYSFS_File
Fixes a few leaks on error paths.
2015-01-17 18:31:42 +00:00
Kp 68d705a85a Use bool conversion to test PHYSFS_File pointer 2015-01-17 18:31:42 +00:00
Kp 703f60ac3f Fix -Wtype-limits warnings 2014-09-21 21:41:55 +00:00
Kp b276590998 Change gr_fade_table to array<array<>> 2014-08-08 02:50:27 +00:00
Kp f47aa29cd9 Use color_t for color values 2014-08-08 02:07:47 +00:00
Kp 7f3ad84094 Use std::swap instead of inline swap 2014-06-08 00:05:33 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp 073f00974a Eliminate uses of the typedef struct X { ... } X; pattern
C++ does not require this pattern.

import re, fileinput
to = re.compile(r'^typedef struct ([a-z_A-Z]+)\s*{')
tc = re.compile(r'^}(.*?)\s*([a-z_A-Z]+);$')
osn = None
for line in fileinput.input(inplace=True):
	m = to.match(line)
	if m:
		osn = m.group(1)
		print 'struct %s\n{' % osn
		continue
	if osn:
		m = tc.match(line)
		if m:
			csn = m.group(2)
			if osn == csn:
				print '}%s;' % m.group(1)
				osn = None
				continue
			else:
				osn = None
	print line,
2013-12-28 22:48:07 +00:00
Kp b1c5307eb1 Use array for palette_array_t 2013-12-22 00:37:36 +00:00
Kp e9f9cb676f Centralize palette utilities 2013-12-22 00:05:13 +00:00
Kp a3d66a3b37 Add typedef palette_array_t for palette data 2013-12-22 00:05:13 +00:00
Kp 2714679284 Mark private functions static 2013-11-02 04:23:55 +00:00
Kp c58c4e4d06 Move declarations to headers 2013-10-03 03:11:52 +00:00
Kp f4c25c4e9a Move similar/2d/palette.c -> similar/2d/palette.cpp 2013-10-01 02:53:09 +00:00
Renamed from similar/2d/palette.c (Browse further)