Commits

Torr_Samaho  committed a84cb1e

- added Vavoom light conversion routines to P_SpawnMapThing
- added declaration of function GL_DestroyActorLights
- added implementation of AActor::PostBeginPlay()

SVN r87 (trunk)

  • Participants
  • Parent commits 4c524e2

Comments (0)

Files changed (1)

File src/p_mobj.cpp

 #include "team.h"
 #include "sv_commands.h"
 
+// [ZDoomGL]
+#include "gl_lights.h"
+
 // MACROS ------------------------------------------------------------------
 
 #define WATER_SINK_FACTOR		3
 // P_RemoveMobj
 //
 
+void GL_DestroyActorLights(AActor *actor); // [ZDoomGL]
+
 void AActor::Destroy ()
 {
 	ULONG	ulIdx;
 		return;
 	}
 
+	// [ZDoomGL] - convert Vavoom lights
+	BYTE args[5];
+	if (mthing->type == 1502)
+	{
+		memcpy(args, mthing->args, 5);
+		mthing->type = 9825;
+		mthing->args[LIGHT_INTENSITY] = args[0];
+		mthing->args[LIGHT_RED] = 128;
+		mthing->args[LIGHT_GREEN] = 128;
+		mthing->args[LIGHT_BLUE] = 128;
+	}
+	else if (mthing->type == 1503)
+	{
+		memcpy(args, mthing->args, 5);
+		mthing->type = 9825;
+		mthing->args[LIGHT_INTENSITY] = args[0];
+		mthing->args[LIGHT_RED] = args[1] >> 1;
+		mthing->args[LIGHT_GREEN] = args[2] >> 1;
+		mthing->args[LIGHT_BLUE] = args[3] >> 1;
+	}
+
 	// [RH] Determine if it is an old ambient thing, and if so,
 	//		map it to MT_AMBIENT with the proper parameter.
 	if (mthing->type >= 14001 && mthing->type <= 14064)
 	return arc;
 }
 
+// [ZDoomGL]
+void AActor::PostBeginPlay()
+{
+   Super::PostBeginPlay();
+   Lights.Clear();
+}
+
 // [BC] meh
 void P_ResetSpawnCounters( void )
 {