X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_items.pas;h=253a0311607bbc2f12f27e4ee4c6a85f2b234e99;hb=a4f25c41dfd783a925aa2dab4b9b84753d5c3f18;hp=5ec5ddb77998633d60adbd4ebd7ee1f9f007bc5a;hpb=31c92166ce1ba9decf93e39f77e77833f879c4b4;p=d2df-sdl.git diff --git a/src/game/g_items.pas b/src/game/g_items.pas index 5ec5ddb..253a031 100644 --- a/src/game/g_items.pas +++ b/src/game/g_items.pas @@ -68,6 +68,8 @@ function g_Items_ObjByIdx (idx: Integer): PObj; procedure g_Items_EmitPickupSound (idx: Integer); // at item position procedure g_Items_EmitPickupSoundAt (idx, x, y: Integer); +procedure g_Items_AddDynLights(); + type TItemEachAliveCB = function (it: PItem): Boolean is nested; // return `true` to stop @@ -628,7 +630,7 @@ begin with ggItems[i] do begin - if g_Collide(Obj.X, Obj.Y, Obj.Rect.Width, Obj.Rect.Height, sX, sY, sWidth, sHeight) then + if g_dbg_scale_05 or g_Collide(Obj.X, Obj.Y, Obj.Rect.Width, Obj.Rect.Height, sX, sY, sWidth, sHeight) then begin if (Animation = nil) then begin @@ -879,4 +881,31 @@ begin end; end; + +procedure g_Items_AddDynLights(); +var + f: Integer; + it: PItem; +begin + for f := 0 to High(ggItems) do + begin + it := @ggItems[f]; + if not it.Live then continue; + case it.ItemType of + ITEM_KEY_RED: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 24, 1.0, 0.0, 0.0, 0.6); + ITEM_KEY_GREEN: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 24, 0.0, 1.0, 0.0, 0.6); + ITEM_KEY_BLUE: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 24, 0.0, 0.0, 1.0, 0.6); + ITEM_ARMOR_GREEN: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 42, 0.0, 1.0, 0.0, 0.6); + ITEM_ARMOR_BLUE: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 42, 0.0, 0.0, 1.0, 0.6); + ITEM_SPHERE_BLUE: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 32, 0.0, 1.0, 0.0, 0.6); + ITEM_SPHERE_WHITE: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 32, 1.0, 1.0, 1.0, 0.6); + ITEM_INVUL: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 32, 1.0, 0.0, 0.0, 0.6); + ITEM_INVIS: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 32, 1.0, 1.0, 0.0, 0.6); + ITEM_BOTTLE: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 16, 0.0, 0.0, 0.8, 0.6); + ITEM_HELMET: g_AddDynLight(it.Obj.X+(it.Obj.Rect.Width div 2), it.Obj.Y+(it.Obj.Rect.Height div 2), 16, 0.0, 0.8, 0.0, 0.6); + end; + end; +end; + + end.