[Decorate] Teleport glitter
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
- The Ultimate DooMer
- Posts: 2109
- Joined: Tue Jul 15, 2003 5:29 pm
- Location: Industrial Zone
[Decorate] Teleport glitter
I was wondering about this: is it possible to recreate Heretic's teleport glitter in decorate without inheriting from it's states?
- The Ultimate DooMer
- Posts: 2109
- Joined: Tue Jul 15, 2003 5:29 pm
- Location: Industrial Zone
- The Ultimate DooMer
- Posts: 2109
- Joined: Tue Jul 15, 2003 5:29 pm
- Location: Industrial Zone
- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Actually, it doesn't. The generator just spawns the glitter at random positions:
Code: Select all
void A_SpawnTeleGlitter (AActor *actor)
{
AActor *mo;
fixed_t x = actor->x+((pr_teleg()&31)-16)*FRACUNIT;
fixed_t y = actor->y+((pr_teleg()&31)-16)*FRACUNIT;
mo = Spawn<ATeleGlitter1> (x, y,
actor->Sector->floorplane.ZatPoint (actor->x, actor->y));
mo->momz = FRACUNIT/4;
}
- Bio Hazard
- Posts: 4019
- Joined: Fri Aug 15, 2003 8:15 pm
- Location: ferret ~/C/ZDL $
- Contact:
Iyaa! That can be simplified!
Saves sizeof(fixed_t)*2 bytes!
Code: Select all
void A_SpawnTeleGlitter(AActor *actor){
AActor *mo = Spawn<ATeleGlitter1>(
(actor->x+((pr_teleg()&31)-16)*FRACUNIT),
(actor->y+((pr_teleg()&31)-16)*FRACUNIT),
actor->Sector->floorplane.ZatPoint(actor->x,actor->y)
);
mo->momz = FRACUNIT/4;
}- The Ultimate DooMer
- Posts: 2109
- Joined: Tue Jul 15, 2003 5:29 pm
- Location: Industrial Zone
- Hirogen2
- Posts: 2033
- Joined: Sat Jul 19, 2003 6:15 am
- Operating System Version (Optional): Tumbleweed x64
- Graphics Processor: Intel with Vulkan/Metal Support
- Location: Central Germany
- Contact:
This can, I think, be crushed even more, of course sacrificing readabilitz:Bio Hazard wrote:Iyaa! That can be simplified!Saves sizeof(fixed_t)*2 bytes!Code: Select all
void A_SpawnTeleGlitter(AActor *actor){ AActor *mo = Spawn<ATeleGlitter1>( (actor->x+((pr_teleg()&31)-16)*FRACUNIT), (actor->y+((pr_teleg()&31)-16)*FRACUNIT), actor->Sector->floorplane.ZatPoint(actor->x,actor->y) ); mo->momz = FRACUNIT/4; }
Code: Select all
Spawn<ATeleGlitter1>(
(actor->x+((pr_teleg()&31)-16)*FRACUNIT),
(actor->y+((pr_teleg()&31)-16)*FRACUNIT),
actor->Sector->floorplane.ZatPoint(actor->x,actor->y)
)->momz = FRACUNIT/4;
Ask the Linux kernel people on why they try to enforce "4K stacks" instead of larger ones (8K).And what's the point in saving stack anyway?
- Bio Hazard
- Posts: 4019
- Joined: Fri Aug 15, 2003 8:15 pm
- Location: ferret ~/C/ZDL $
- Contact:
- Doomguy0505
- Posts: 625
- Joined: Tue Mar 29, 2005 4:53 am
- Contact: