mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 20:42:11 +00:00
- User[] is mostly gone.
All access is now through the actor.
This commit is contained in:
parent
cd73cd616e
commit
898f56dd86
2 changed files with 10 additions and 8 deletions
|
@ -959,14 +959,14 @@ void SerializeUser(FSerializer& arc)
|
|||
{
|
||||
for (int i = 0; i < MAXSPRITES; i++)
|
||||
{
|
||||
hitlist.Set(i, !!User[i].Data());
|
||||
hitlist.Set(i, swActors[i].hasU());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < MAXSPRITES; i++)
|
||||
{
|
||||
User[i].Clear();
|
||||
swActors[i].clearUser();
|
||||
}
|
||||
}
|
||||
arc("usermap", hitlist);
|
||||
|
|
|
@ -9,6 +9,7 @@ class DSWActor
|
|||
{
|
||||
int index;
|
||||
DSWActor* base();
|
||||
auto& up() { return User[index]; }
|
||||
|
||||
public:
|
||||
|
||||
|
@ -19,20 +20,21 @@ public:
|
|||
{
|
||||
clearUser();
|
||||
}
|
||||
bool hasU() { return User[index].Data() != nullptr; }
|
||||
bool hasU() { return u() != nullptr; }
|
||||
|
||||
|
||||
spritetype& s() { return sprite[index]; }
|
||||
USER* u() { return User[index].Data(); }
|
||||
USER* u() { return up().Data(); }
|
||||
USER* allocUser()
|
||||
{
|
||||
User[index].Alloc();
|
||||
User[index]->SpriteNum = GetSpriteIndex();
|
||||
return User[index].Data();
|
||||
up().Alloc();
|
||||
u()->SpriteNum = GetSpriteIndex();
|
||||
return u();
|
||||
}
|
||||
|
||||
void clearUser()
|
||||
{
|
||||
if (hasU()) User[index].Clear();
|
||||
up().Clear();
|
||||
}
|
||||
|
||||
int GetIndex()
|
||||
|
|
Loading…
Reference in a new issue