Wormhole lighting intensity is currently fixed this patch fixes this by interpolating intensity based on wormhole radius
Index: code/fireball/fireballs.cpp
===================================================================
--- code/fireball/fireballs.cpp (Revision 7324)
+++ code/fireball/fireballs.cpp (Arbeitskopie)
@@ -1044,3 +1044,27 @@
return index;
}
+
+float fireball_wormhole_intensity( object *obj )
+{
+ int num, objnum;
+ fireball *fb;
+
+ num = obj->instance;
+ objnum = OBJ_INDEX(obj);
+ Assert( Fireballs[num].objnum == objnum, "Basic sanity check. Fireballs[num].objnum (%d) should == objnum (%d)", Fireballs[num].objnum, objnum );
+
+ fb = &Fireballs[num];
+
+ float t = fb->time_elapsed;
+ float rad;
+
+ if ( t < WARPHOLE_GROW_TIME ) {
+ rad = (float)pow(t/WARPHOLE_GROW_TIME,0.4f);
+ } else if ( t < fb->total_time - WARPHOLE_GROW_TIME ) {
+ rad = 1;
+ } else {
+ rad = (float)pow((fb->total_time - t)/WARPHOLE_GROW_TIME,0.4f);
+ }
+ return rad;
+}
Index: code/fireball/fireballs.h
===================================================================
--- code/fireball/fireballs.h (Revision 7324)
+++ code/fireball/fireballs.h (Arbeitskopie)
@@ -107,6 +107,9 @@
// returns the index of the fireball bitmap for this ship. -1 if there is none.
int fireball_ship_explosion_type(ship_info *sip);
+// returns the intensity of a wormhole
+float fireball_wormhole_intensity( object *obj );
+
// internal function to draw warp grid.
extern void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int warp_3d = 0 );
Index: code/object/object.cpp
===================================================================
--- code/object/object.cpp (Revision 7324)
+++ code/object/object.cpp (Arbeitskopie)
@@ -1261,11 +1261,17 @@
p = 1.0f - p;
p *= 2.0f;
-
+ float rad = p * (1.0f + frand() * 0.05f) * objp->radius;
+
+ float intensity = 1.0f;
+ if(fireball_is_warp(objp))
+ {
+ intensity = fireball_wormhole_intensity(objp); // Valathil: Get wormhole radius for lighting
+ rad = objp->radius;
+ }
// P goes from 0 to 1 to 0 over the life of the explosion
- float rad = p * (1.0f + frand() * 0.05f) * objp->radius;
-
- light_add_point( &objp->pos, rad * 2.0f, rad * 5.0f, 1.0f, r, g, b, -1 );
+
+ light_add_point( &objp->pos, rad * 2.0f, rad * 5.0f, intensity, r, g, b, -1 );
}
}