mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-16 12:40:38 +00:00
- prototyping some refactoring helpers.
This commit is contained in:
parent
fcfeafdbe9
commit
d368d734d3
2 changed files with 28 additions and 0 deletions
|
@ -246,6 +246,25 @@ extern usermaphack_t g_loadedMapHack;
|
||||||
EXTERN spriteext_t *spriteext;
|
EXTERN spriteext_t *spriteext;
|
||||||
EXTERN spritesmooth_t *spritesmooth;
|
EXTERN spritesmooth_t *spritesmooth;
|
||||||
|
|
||||||
|
// Wrapper that makes an array of pointers look like an array of references. (Refactoring helper.)
|
||||||
|
|
||||||
|
template<class T, int size>
|
||||||
|
class ReferenceArray
|
||||||
|
{
|
||||||
|
T* data[size];
|
||||||
|
public:
|
||||||
|
T& operator[](size_t index)
|
||||||
|
{
|
||||||
|
assert(index < size);
|
||||||
|
return *data[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
void set(int pos, T* spr)
|
||||||
|
{
|
||||||
|
data[pos] = spr;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
EXTERN sectortype *sector;
|
EXTERN sectortype *sector;
|
||||||
EXTERN walltype *wall;
|
EXTERN walltype *wall;
|
||||||
EXTERN spritetype *sprite;
|
EXTERN spritetype *sprite;
|
||||||
|
|
|
@ -30,6 +30,15 @@ struct weaponhit
|
||||||
int temp_data[6];
|
int temp_data[6];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// This is how a Duke actor should later be exposed to scripting. The object definition parts are disabled for now so that this can be used already to transition the code.
|
||||||
|
class DDukeActor //: public DBuildActor
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//DECLARE_CLASS(DDukeActor, DBuildActor)
|
||||||
|
spritetype s;
|
||||||
|
weaponhit h;
|
||||||
|
};
|
||||||
|
|
||||||
struct animwalltype
|
struct animwalltype
|
||||||
{
|
{
|
||||||
short wallnum, tag;
|
short wallnum, tag;
|
||||||
|
|
Loading…
Reference in a new issue