Commit graph

66 commits

Author SHA1 Message Date
Kp c428fdee0f Pass ranges::subrange to bitmap_index_read_n 2022-12-31 16:21:47 +00:00
Kp e3553586c1 Use enum class for bitmap_index 2022-12-31 16:21:47 +00:00
Kp 64eae78dcc Prefer direct initialization for bitmap_index 2022-12-18 18:32:14 +00:00
Kp 9716d42ea0 Use enum class for pig_hamfile_version 2022-10-09 23:15:20 +00:00
Kp 6215ef8e06 Pass LevelSharedRobotInfoState to various functions that need it 2022-07-09 13:39:29 +00:00
Kp cc2f3caa7e Split piggy.h -> fwd-piggy.h 2022-06-05 17:44:52 +00:00
Kp 11a0aae9ee Pass GameBitmaps to piggy_bitmap_page_in 2022-06-05 17:44:52 +00:00
Kp 6b8a0a74c6 Fix some check_header_includes=1 failures 2022-02-12 18:57:12 +00:00
Kp b2968c55da Improve error reporting for read_sndfile
Move error reporting down into read_sndfile, so that individual failure
paths can have specific error messages.
2021-07-25 23:00:56 +00:00
Kp 9c3fc7523c Make extra_bitmap_num static
Modify read_extra_bitmap_d1_pig to take the bitmap-to-write as a
parameter, instead of computing it from extra_bitmap_num.
2020-08-24 01:31:28 +00:00
Kp dd035a8f2f Move some piggy code into namespace dsx 2020-08-24 01:31:28 +00:00
Kp b29f19da51 Use enum class for GameBitmapOffset
Values in GameBitmapOffset are only intended for use indexing within the
game's PIG file.  Give them a specific type to reflect that.
2020-08-24 01:31:28 +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 b8cb819bb4 Make read_sndfile static for D1
Currently, only D2 can reread sounds.  Restore static for D1
read_sndfile.
2019-08-15 01:34:22 +00:00
Kp aa9bea4b92 Remove redundant declaration of Piggy_hamfile_version 2019-08-15 01:34:22 +00:00
ziplantil d9c113c315 load .s11,.s22 when loading D2 mission to allow custom sounds 2019-08-13 22:47:22 +03:00
Kp a0ed5cb283 Pass Vclip as context 2018-10-21 00:24:07 +00:00
Kp dc0a405222 Factor out piggy bitmap loading code 2018-08-26 18:10:36 +00:00
Kp 32561c5d0a Use partial_range for piggy_does_bitmap_exist_slow 2018-08-26 18:10:36 +00:00
Kp 0c3e99f14c Split side uses based on shared vs unique 2018-06-24 05:06:15 +00:00
Kp 88832e3679 Use constexpr integral_constant for various magic numbers 2017-10-14 17:10:30 +00:00
Kp 764d20d4e1 Make grs_bitmap::bm_flags private 2017-01-15 00:03:13 +00:00
Kp 223a9dfd56 Pass grs_bitmap &to piggy_register_bitmap 2016-11-19 17:24:53 +00:00
Kp 47de4e2906 Pass grs_bitmap &to swap_0_255 2016-11-19 17:24:52 +00:00
Kp b43dcc1a52 Revert "Disable piggy_bitmap_page_out_all"
This reverts commit 3c20c24ac0.

Rebirth no longer contains the Descent memory manager, but Rebirth still
has many traces of the paging support used in the DOS version.  One of
the unfortunate and subtle traces of this support is that it allocates a
contiguous buffer for game data and loads many of the games bitmaps into
that buffer.  The buffer is large enough for most workloads, but not
all.  When the buffer is too small, it is discarded by
piggy_bitmap_page_out_all and rebuilt piecemeal to contain only what it
needs.  Fixing this would be nice, but the memory ownership rules are
messy.  The performance consequences of the legacy approach are not
sufficient to justify the effort to fix this properly.  Instead, revert
to the legacy design.
2016-11-19 17:24:51 +00:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp 63651b8c68 Move PIGGY_PAGE_IN into namespace dsx with GameBitmaps 2016-07-15 03:43:01 +00:00
Kp 96f78e1032 Use constexpr for MAX_BITMAP_FILES 2016-07-14 01:59:05 +00:00
Kp 9d0c6f59a5 Remove always-zero piggy_page_flushed
Descent for DOS supported paging content on demand.  Rebirth has no
support for paging content out, but retained piggy_page_flushed
to track whether anything had been paged out.  Commit 3c20c24 ("Disable
piggy_bitmap_page_out_all") removed the last site that could set
piggy_bitmap_page_out_all to a non-zero value.  All remaining code
either tests it for non-zero or sets it to zero.

Remove the statements that set it to zero.
Remove assertions that the value is zero.
Remove conditional blocks that execute only when it is non-zero.
2016-05-22 17:49:30 +00:00
Kp 27cef20eb3 Move namespace dsx handling to dsx-ns.h 2016-03-19 19:08:10 +00:00
Kp 3c20c24ac0 Disable piggy_bitmap_page_out_all 2016-02-20 17:28:11 +00:00
Kp 8e86a3586d Use #ifdef dsx to guard dsx namespace 2016-01-09 16:38:15 +00:00
Kp 86709f547b Fix capitalization of PHYSFS_File
Per comment in physfs.h, the spelling PHYSFS_file is deprecated.
Replace all instances with PHYSFS_File.
2016-01-09 16:38:14 +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 232cc324f9 Use inline namespace dsx for similar/arch/sdl/ 2015-12-13 18:00:48 +00:00
Kp b946011299 Remove non-GNU PIGGY_PAGE_IN
Non-GNU PIGGY_PAGE_IN uses a do {} while(0), but some callers are in a
context where do{}while() is an error.
2015-08-22 20:43:03 +00:00
Kp d73e5a24c3 Reduce scope of ifdef(D1||D2) 2015-07-04 21:01:17 +00:00
Kp 83afd8d96f Reduce piggy.h includes 2015-04-19 04:18:52 +00:00
Kp 90fbebf8fd Convert most global arrays to array<> 2015-04-02 02:36:52 +00:00
Kp b940ca0510 Use array<> for bogus_data 2015-02-28 19:36:01 +00:00
Kp 0ad02ad975 Remove unused piggy_game_bitmap_name 2015-02-28 19:36:01 +00:00
Kp 68e2168377 Use array<> for bitmap_index arrays 2015-02-14 22:48:30 +00:00
Kp dc8b88eed4 Convert various loops to range_for 2015-02-14 22:48:27 +00:00
Kp b031e449de Make equal_space a preprocessor constant 2015-01-29 04:27:35 +00:00
Kp c2aa2c2e4b Rename space to space_tab
Name space is too simple and causes conflicts elsewhere.
2015-01-29 04:27:35 +00:00
Kp dc511d0a5c Pass array<> to iff_read_animbrush 2014-09-27 23:06:33 +00:00
Kp 78ad2adabf Write weapon_info carefully 2014-09-27 22:46:25 +00:00
Kp 6d5b9e3004 Move MAX_BITMAPS_PER_BRUSH definitions to piggy.h 2014-09-21 21:53:54 +00:00