mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
- defined the iterators.
This commit is contained in:
parent
78afb67c7f
commit
0f2c19522e
3 changed files with 53 additions and 1 deletions
|
@ -44,6 +44,7 @@ This file is a combination of code from the following sources:
|
|||
#include "names.h"
|
||||
#include "stats.h"
|
||||
#include "constants.h"
|
||||
#include "dukeactor.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
||||
|
|
50
source/games/duke/src/dukeactor.h
Normal file
50
source/games/duke/src/dukeactor.h
Normal file
|
@ -0,0 +1,50 @@
|
|||
#pragma once
|
||||
#include "dobject.h"
|
||||
#include "build.h"
|
||||
|
||||
BEGIN_DUKE_NS
|
||||
|
||||
|
||||
// Iterator wrappers that return an actor pointer, not an index.
|
||||
class DukeStatIterator : public StatIterator
|
||||
{
|
||||
public:
|
||||
DukeStatIterator(int stat) : StatIterator(stat)
|
||||
{
|
||||
}
|
||||
|
||||
DDukeActor *Next()
|
||||
{
|
||||
int n = NextIndex();
|
||||
return n >= 0? &hittype[n] : nullptr;
|
||||
}
|
||||
|
||||
DDukeActor *Peek()
|
||||
{
|
||||
int n = PeekIndex();
|
||||
return n >= 0? &hittype[n] : nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
class DukeSectIterator : public SectIterator
|
||||
{
|
||||
public:
|
||||
DukeSectIterator(int stat) : SectIterator(stat)
|
||||
{
|
||||
}
|
||||
|
||||
DDukeActor *Next()
|
||||
{
|
||||
int n = NextIndex();
|
||||
return n >= 0? &hittype[n] : nullptr;
|
||||
}
|
||||
|
||||
DDukeActor *Peek()
|
||||
{
|
||||
int n = PeekIndex();
|
||||
return n >= 0? &hittype[n] : nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
END_DUKE_NS
|
|
@ -44,11 +44,12 @@ struct weaponhit
|
|||
floorz = ceilingz = lastvx = lastvy = bposx = bposy = bposz = aflags = 0;
|
||||
memset(temp_data, 0, sizeof(temp_data));
|
||||
}
|
||||
int GetIndex() const { return this - array(); }
|
||||
};
|
||||
extern weaponhit hittype[MAXSPRITES + 1];
|
||||
inline weaponhit* weaponhit::array() { return hittype; }
|
||||
|
||||
using DDukeActor = weaponhit; // we do not really want that stupid name in our interface (but also not rename the struct yet.)
|
||||
using DDukeActor = weaponhit; // we do not really want that stupid name in our interface (but also not rename the struct yet.) The preceding 'D' is for the DObject interface this should be transitioned to later.
|
||||
|
||||
struct animwalltype
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue