mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
MapArt: Fix a harmless C++ warning. (malloc casting, for those interested)
EDuke32 has me so accustomed to straight C... using a template and pass-by-reference makes my day. git-svn-id: https://svn.eduke32.com/eduke32@4267 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
3a85134e31
commit
fedfcd81e3
1 changed files with 15 additions and 0 deletions
|
@ -9857,6 +9857,20 @@ static void E_RecalcPicSiz(void)
|
|||
} while (0)
|
||||
|
||||
// Allocate per-map ART backup array and back up the original!
|
||||
#ifdef __cplusplus
|
||||
template <typename origar_t, typename bakar_t>
|
||||
static inline void ALLOC_MAPART_ARRAY(origar_t &origar, bakar_t &bakar)
|
||||
{
|
||||
bakar = (bakar_t) Bmalloc(MAXUSERTILES*sizeof(origar[0]));
|
||||
if (bakar == NULL)
|
||||
{
|
||||
initprintf("OUT OF MEMORY allocating per-map ART backup arrays!\n");
|
||||
uninitengine();
|
||||
exit(12);
|
||||
}
|
||||
Bmemcpy(bakar, origar, MAXUSERTILES*sizeof(origar[0]));
|
||||
}
|
||||
#else
|
||||
#define ALLOC_MAPART_ARRAY(origar, bakar) do { \
|
||||
bakar = Bmalloc(MAXUSERTILES*sizeof(origar[0])); \
|
||||
if (bakar == NULL) \
|
||||
|
@ -9867,6 +9881,7 @@ static void E_RecalcPicSiz(void)
|
|||
} \
|
||||
Bmemcpy(bakar, origar, MAXUSERTILES*sizeof(origar[0])); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
void E_MapArt_Clear(void)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue