From c428fdee0fd155d67964274170b27812752efd7a Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 31 Dec 2022 16:21:47 +0000 Subject: [PATCH] Pass ranges::subrange to bitmap_index_read_n --- common/main/fwd-piggy.h | 3 +-- common/main/piggy.h | 5 +++++ similar/main/piggy.cpp | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/common/main/fwd-piggy.h b/common/main/fwd-piggy.h index f90fdb8d5..69eb5b6a8 100644 --- a/common/main/fwd-piggy.h +++ b/common/main/fwd-piggy.h @@ -52,6 +52,7 @@ enum class game_sound_offset : int struct digi_sound; extern digi_sound bogus_sound; extern unsigned Num_sound_files; +struct BitmapFile; } @@ -72,7 +73,6 @@ extern uint8_t Pigfile_initialized; // an index into the bitmap collection of the piggy file enum class bitmap_index : uint16_t; -struct BitmapFile; #if defined(DXX_BUILD_DESCENT_I) extern int MacPig; @@ -135,7 +135,6 @@ namespace dcx { * reads a bitmap_index structure from a PHYSFS_File */ void bitmap_index_read(PHYSFS_File *fp, bitmap_index &bi); -void bitmap_index_read_n(PHYSFS_File *fp, partial_range_t r); } void remove_char( char * s, char c ); // in piggy.c diff --git a/common/main/piggy.h b/common/main/piggy.h index 5dd0eb56b..ffdc23409 100644 --- a/common/main/piggy.h +++ b/common/main/piggy.h @@ -26,6 +26,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #pragma once #include "dsx-ns.h" +#include "backports-ranges.h" #include "fwd-inferno.h" #include "fwd-piggy.h" #include "fwd-robot.h" @@ -47,11 +48,15 @@ enum class bitmap_index : uint16_t None = UINT16_MAX }; +namespace dcx { struct BitmapFile { std::array name; }; +void bitmap_index_read_n(PHYSFS_File *fp, ranges::subrange r); +} + #ifdef dsx namespace dsx { diff --git a/similar/main/piggy.cpp b/similar/main/piggy.cpp index d68ef7ff3..fae1d5912 100644 --- a/similar/main/piggy.cpp +++ b/similar/main/piggy.cpp @@ -2190,7 +2190,7 @@ void bitmap_index_read(PHYSFS_File *fp, bitmap_index &bi) /* * reads n bitmap_index structs from a PHYSFS_File */ -void bitmap_index_read_n(PHYSFS_File *fp, const partial_range_t r) +void bitmap_index_read_n(PHYSFS_File *fp, const ranges::subrange r) { for (auto &bi : r) {