Move some local structs into anonymous namespaces
This commit is contained in:
parent
40fd988a0f
commit
9794cfddc9
|
@ -92,7 +92,9 @@ static const sound_function_table_t digi_audio_table{
|
||||||
&digi_audio_set_digi_volume,
|
&digi_audio_set_digi_volume,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sound_function_pointers_t
|
namespace {
|
||||||
|
|
||||||
|
class sound_function_pointers_t
|
||||||
{
|
{
|
||||||
#ifdef USE_SDLMIXER
|
#ifdef USE_SDLMIXER
|
||||||
#ifdef DXX_COPY_SOUND_TABLE
|
#ifdef DXX_COPY_SOUND_TABLE
|
||||||
|
@ -101,6 +103,8 @@ struct sound_function_pointers_t
|
||||||
const sound_function_table_t *table;
|
const sound_function_table_t *table;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
public:
|
||||||
|
__attribute_cold
|
||||||
void report_invalid_table() __noreturn;
|
void report_invalid_table() __noreturn;
|
||||||
inline const sound_function_table_t *operator->();
|
inline const sound_function_table_t *operator->();
|
||||||
inline sound_function_pointers_t &operator=(const sound_function_table_t &t);
|
inline sound_function_pointers_t &operator=(const sound_function_table_t &t);
|
||||||
|
@ -152,6 +156,8 @@ sound_function_pointers_t &sound_function_pointers_t::operator=(const sound_func
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
static sound_function_pointers_t fptr;
|
static sound_function_pointers_t fptr;
|
||||||
|
|
||||||
void digi_select_system(int n) {
|
void digi_select_system(int n) {
|
||||||
|
|
|
@ -1041,7 +1041,9 @@ static void add_obj_to_seglist(render_state_t &rstate, objnum_t objnum, segnum_t
|
||||||
o.emplace_back(render_state_t::per_segment_state_t::distant_object{objnum});
|
o.emplace_back(render_state_t::per_segment_state_t::distant_object{objnum});
|
||||||
}
|
}
|
||||||
|
|
||||||
struct render_compare_context_t
|
namespace {
|
||||||
|
|
||||||
|
class render_compare_context_t
|
||||||
{
|
{
|
||||||
struct element
|
struct element
|
||||||
{
|
{
|
||||||
|
@ -1052,6 +1054,7 @@ struct render_compare_context_t
|
||||||
};
|
};
|
||||||
typedef array<element, MAX_OBJECTS> array_t;
|
typedef array<element, MAX_OBJECTS> array_t;
|
||||||
array_t a;
|
array_t a;
|
||||||
|
public:
|
||||||
array_t::reference operator[](std::size_t i) { return a[i]; }
|
array_t::reference operator[](std::size_t i) { return a[i]; }
|
||||||
array_t::const_reference operator[](std::size_t i) const { return a[i]; }
|
array_t::const_reference operator[](std::size_t i) const { return a[i]; }
|
||||||
render_compare_context_t(const render_state_t::per_segment_state_t &segstate)
|
render_compare_context_t(const render_state_t::per_segment_state_t &segstate)
|
||||||
|
@ -1068,6 +1071,8 @@ struct render_compare_context_t
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//compare function for object sort.
|
//compare function for object sort.
|
||||||
static bool compare_func(const render_compare_context_t &c, const render_state_t::per_segment_state_t::distant_object &a,const render_state_t::per_segment_state_t::distant_object &b)
|
static bool compare_func(const render_compare_context_t &c, const render_state_t::per_segment_state_t::distant_object &a,const render_state_t::per_segment_state_t::distant_object &b)
|
||||||
{
|
{
|
||||||
|
|
|
@ -138,14 +138,19 @@ static void draw_cell(int i,int j,g3s_point *p0,g3s_point *p1,g3s_point *p2,g3s_
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct terrain_y_cache
|
namespace {
|
||||||
|
|
||||||
|
class terrain_y_cache
|
||||||
{
|
{
|
||||||
static const std::size_t cache_size = 256;
|
static const std::size_t cache_size = 256;
|
||||||
std::bitset<cache_size> yc_flags;
|
std::bitset<cache_size> yc_flags;
|
||||||
array<vms_vector, cache_size> y_cache;
|
array<vms_vector, cache_size> y_cache;
|
||||||
|
public:
|
||||||
vms_vector &operator()(uint_fast32_t h);
|
vms_vector &operator()(uint_fast32_t h);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
vms_vector &terrain_y_cache::operator()(uint_fast32_t h)
|
vms_vector &terrain_y_cache::operator()(uint_fast32_t h)
|
||||||
{
|
{
|
||||||
auto &dyp = y_cache[h];
|
auto &dyp = y_cache[h];
|
||||||
|
|
Loading…
Reference in a new issue