mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-28 12:30:46 +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 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 walltype *wall;
|
||||
EXTERN spritetype *sprite;
|
||||
|
|
|
@ -30,6 +30,15 @@ struct weaponhit
|
|||
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
|
||||
{
|
||||
short wallnum, tag;
|
||||
|
|
Loading…
Reference in a new issue