DEADSOFTWARE

render: move item animations into render
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Wed, 2 Feb 2022 21:30:11 +0000 (00:30 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Fri, 9 Jun 2023 08:23:29 +0000 (11:23 +0300)
src/game/g_items.pas
src/game/opengl/r_animations.pas
src/game/opengl/r_items.pas
src/game/opengl/r_player.pas
src/game/opengl/r_render.pas

index 33ab113df1c2552399ef7712825c7d43040a9c2a..e81bdd4caa55ddb98fa3c877a8dacd0b4adfda5d 100644 (file)
@@ -19,7 +19,7 @@ interface
 
 uses
   SysUtils, Classes,
-  MAPDEF, g_textures, g_phys, g_saveload;
+  MAPDEF, g_phys, g_saveload;
 
 Type
   PItem = ^TItem;
@@ -39,7 +39,6 @@ Type
     QuietRespawn: Boolean;
     SpawnTrigger: Integer;
     Obj: TObj;
-    Animation: TAnimationState;
     dropped: Boolean; // dropped from the monster? drops should be rendered after corpses, so zombie corpse will not obscure ammo container, for example
     NeedSend: Boolean;
 
@@ -238,11 +237,6 @@ begin
   if not it.slotIsUsed then raise Exception.Create('releaseItem: trying to release unallocated item (1)');
   if (it.arrIdx <> idx) then raise Exception.Create('releaseItem: arrIdx inconsistency');
   it.slotIsUsed := false;
-  if (it.Animation <> nil) then
-  begin
-    it.Animation.Free();
-    it.Animation := nil;
-  end;
   it.alive := False;
   it.SpawnTrigger := -1;
   it.ItemType := ITEM_NONE;
@@ -266,7 +260,6 @@ begin
     it.slotIsUsed := false;
     it.arrIdx := i;
     it.ItemType := ITEM_NONE;
-    it.Animation := nil;
     it.alive := false;
     it.SpawnTrigger := -1;
     it.Respawnable := false;
@@ -323,14 +316,9 @@ end;
 
 
 procedure g_Items_Free ();
-var
-  i: Integer;
 begin
   if (ggItems <> nil) then
-  begin
-    for i := 0 to High(ggItems) do ggItems[i].Animation.Free();
     ggItems := nil;
-  end;
   freeIds.clear();
 end;
 
@@ -368,7 +356,6 @@ begin
   it.Obj.Rect.Width := ITEMSIZE[ItemType][0];
   it.Obj.Rect.Height := ITEMSIZE[ItemType][1];
 
-  it.Animation := nil;
   it.SpawnTrigger := -1;
 
   // Êîîðäèíàòû îòíîñèòåëüíî öåíòðà íèæíåãî ðåáðà
@@ -386,19 +373,6 @@ begin
   it.Obj.oldX := it.Obj.X;
   it.Obj.oldY := it.Obj.Y;
 
-  // Óñòàíîâêà àíèìàöèè
-  case it.ItemType of
-    ITEM_ARMOR_GREEN: it.Animation := TAnimationState.Create(True, 20, 3);
-    ITEM_ARMOR_BLUE: it.Animation := TAnimationState.Create(True, 20, 3);
-    ITEM_JETPACK: it.Animation := TAnimationState.Create(True, 15, 3);
-    ITEM_SPHERE_BLUE: it.Animation := TAnimationState.Create(True, 15, 4);
-    ITEM_SPHERE_WHITE: it.Animation := TAnimationState.Create(True, 20, 4);
-    ITEM_INVUL: it.Animation := TAnimationState.Create(True, 20, 4);
-    ITEM_INVIS: it.Animation := TAnimationState.Create(True, 20, 4);
-    ITEM_BOTTLE: it.Animation := TAnimationState.Create(True, 20, 4);
-    ITEM_HELMET: it.Animation := TAnimationState.Create(True, 20, 4);
-  end;
-
   it.positionChanged();
 
   result := find_id;
@@ -536,8 +510,6 @@ begin
           QuietRespawn := false;
         end;
       end;
-
-      if (Animation <> nil) then Animation.Update();
     end;
   end;
 end;
index 8af7830556b35c49ba65b8a9c700357e7c25a0b6..6e02aec1ed0c9c95aed1c832ec194b6261ca3b69 100644 (file)
@@ -22,6 +22,9 @@ interface
   procedure r_AnimationState_Draw (FID: DWORD; t: TAnimationState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean);
   procedure r_AnimationState_DrawEx (FID: DWORD; t: TAnimationState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean; rpoint: TDFPoint; angle: SmallInt);
 
+  procedure r_AnimState_Draw (FID: DWORD; const t: TAnimState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean);
+  procedure r_AnimState_DrawEx (FID: DWORD; const t: TAnimState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean; rpoint: TDFPoint; angle: SmallInt);
+
   function g_CreateFramesImg (ia: TDynImageDataArray; ID: PDWORD; const Name: AnsiString; BackAnimation: Boolean = false): Boolean;
 
   function g_Frames_CreateWAD (ID: PDWORD; const Name, Resource: AnsiString; mWidth, mHeight, mCount: Word; BackAnimation: Boolean=false): Boolean;
@@ -80,6 +83,18 @@ implementation
       e_DrawAdv(framesArray[FID].TexturesID[t.currentFrame], x, y, alpha, true, blending, angle, @rpoint, mirror)
   end;
 
+  procedure r_AnimState_Draw (FID: DWORD; const t: TAnimState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean);
+  begin
+    if t.enabled then
+      e_DrawAdv(framesArray[FID].TexturesID[t.currentFrame], x, y, alpha, true, blending, 0, nil, mirror)
+  end;
+
+  procedure r_AnimState_DrawEx (FID: DWORD; const t: TAnimState; x, y: Integer; alpha: Byte; mirror: TMirrorType; blending: Boolean; rpoint: TDFPoint; angle: SmallInt);
+  begin
+    if t.enabled then
+      e_DrawAdv(framesArray[FID].TexturesID[t.currentFrame], x, y, alpha, true, blending, angle, @rpoint, mirror)
+  end;
+
 function allocFrameSlot (): LongWord;
 var
   f: integer;
index a36feece8045ce386679174a99194c52353c335b..168d740e804bad69eb1aa0cb83fe64dd0aa6c2f0 100644 (file)
@@ -23,24 +23,79 @@ interface
   procedure r_Items_Free;
   procedure r_Items_Draw;
   procedure r_Items_DrawDrop;
-
-  var
-    gItemsTexturesID: Array [1..ITEM_MAX] of DWORD;
+  procedure r_Items_Update;
 
 implementation
 
   uses
     SysUtils, Classes, Math,
     r_graphics, r_animations, r_textures,
-    g_base, g_basic, g_game, g_options,
+    g_base, g_basic, g_game, g_options, g_textures,
     g_items
   ;
 
   var
-    itemFrames: Array [0..ITEM_MAX] of DWORD;
+    items: Array [0..ITEM_MAX] of record
+      id: DWORD;
+      anim: TAnimState;
+    end;
+
+  procedure LoadItem (i: Integer; name: String; w, h, delay, n: Integer; backanim: Boolean);
+  begin
+    g_Frames_CreateWAD(@items[i].id, '', GameWAD + ':TEXTURES\' + name, w, h, n, backanim);
+    if backanim then n := n * 2 - 2;
+    items[i].anim := TAnimState.Create(True, delay, n);
+  end;
 
   procedure r_Items_Load;
+    var i: Integer;
   begin
+    //       i                            name           w    h    d  n  backanim
+    LoadItem(ITEM_NONE,                  'NOTEXTURE',    16,  16,  0, 1, False);
+    LoadItem(ITEM_MEDKIT_SMALL,          'MED1',         16,  16,  0, 1, False);
+    LoadItem(ITEM_MEDKIT_LARGE,          'MED2',         32,  32,  0, 1, False);
+    LoadItem(ITEM_MEDKIT_BLACK,          'BMED',         32,  32,  0, 1, False);
+    LoadItem(ITEM_ARMOR_GREEN,           'ARMORGREEN',   32,  16, 20, 3, True);
+    LoadItem(ITEM_ARMOR_BLUE,            'ARMORBLUE',    32,  16, 20, 3, True);
+    LoadItem(ITEM_SPHERE_BLUE,           'SBLUE',        32,  32, 15, 4, True);
+    LoadItem(ITEM_SPHERE_WHITE,          'SWHITE',       32,  32, 20, 4, True);
+    LoadItem(ITEM_SUIT,                  'SUIT',         32,  64,  0, 1, False);
+    LoadItem(ITEM_OXYGEN,                'OXYGEN',       16,  32,  0, 1, False);
+    LoadItem(ITEM_INVUL,                 'INVUL',        32,  32, 20, 4, True);
+    LoadItem(ITEM_WEAPON_SAW,            'SAW',          64,  32,  0, 1, False);
+    LoadItem(ITEM_WEAPON_SHOTGUN1,       'SHOTGUN1',     64,  16,  0, 1, False);
+    LoadItem(ITEM_WEAPON_SHOTGUN2,       'SHOTGUN2',     64,  16,  0, 1, False);
+    LoadItem(ITEM_WEAPON_CHAINGUN,       'MGUN',         64,  16,  0, 1, False);
+    LoadItem(ITEM_WEAPON_ROCKETLAUNCHER, 'RLAUNCHER',    64,  16,  0, 1, False);
+    LoadItem(ITEM_WEAPON_PLASMA,         'PGUN',         64,  16,  0, 1, False);
+    LoadItem(ITEM_WEAPON_BFG,            'BFG',          64,  64,  0, 1, False);
+    LoadItem(ITEM_WEAPON_SUPERPULEMET,   'SPULEMET',     64,  16,  0, 1, False);
+    LoadItem(ITEM_AMMO_BULLETS,          'CLIP',         16,  16,  0, 1, False);
+    LoadItem(ITEM_AMMO_BULLETS_BOX,      'AMMO',         32,  16,  0, 1, False);
+    LoadItem(ITEM_AMMO_SHELLS,           'SHELL1',       16,   8,  0, 1, False);
+    LoadItem(ITEM_AMMO_SHELLS_BOX,       'SHELL2',       32,  16,  0, 1, False);
+    LoadItem(ITEM_AMMO_ROCKET,           'ROCKET',       16,  32,  0, 1, False);
+    LoadItem(ITEM_AMMO_ROCKET_BOX,       'ROCKETS',      64,  32,  0, 1, False);
+    LoadItem(ITEM_AMMO_CELL,             'CELL',         16,  16,  0, 1, False);
+    LoadItem(ITEM_AMMO_CELL_BIG,         'CELL2',        32,  32,  0, 1, False);
+    LoadItem(ITEM_AMMO_BACKPACK,         'BPACK',        32,  32,  0, 1, False);
+    LoadItem(ITEM_KEY_RED,               'KEYR',         16,  16,  0, 1, False);
+    LoadItem(ITEM_KEY_GREEN,             'KEYG',         16,  16,  0, 1, False);
+    LoadItem(ITEM_KEY_BLUE,              'KEYB',         16,  16,  0, 1, False);
+    LoadItem(ITEM_WEAPON_KASTET,         'KASTET',       64,  32,  0, 1, False);
+    LoadItem(ITEM_WEAPON_PISTOL,         'PISTOL',       64,  16,  0, 1, False);
+    LoadItem(ITEM_BOTTLE,                'BOTTLE',       64,  32, 20, 4, True);
+    LoadItem(ITEM_HELMET,                'HELMET',       64,  16, 20, 4, True);
+    LoadItem(ITEM_JETPACK,               'JETPACK',      96,  32, 15, 3, True);
+    LoadItem(ITEM_INVIS,                 'INVIS',        128, 32, 20, 4, True);
+    LoadItem(ITEM_WEAPON_FLAMETHROWER,   'FLAMETHROWER', 64,  32,  0, 1, False);
+    LoadItem(ITEM_AMMO_FUELCAN,          'FUELCAN',      16,  32,  0, 1, False);
+
+    // fill with NOTEXURE forgotten item
+    for i := ITEM_AMMO_FUELCAN + 1 to ITEM_MAX do
+      LoadItem(i,'NOTEXTURE',    16,  16,  0, 1, False);
+
+    // hud
     g_Frames_CreateWAD(nil, 'FRAMES_ITEM_BLUESPHERE', GameWAD+':TEXTURES\SBLUE', 32, 32, 4, True);
     g_Frames_CreateWAD(nil, 'FRAMES_ITEM_WHITESPHERE', GameWAD+':TEXTURES\SWHITE', 32, 32, 4, True);
     g_Frames_CreateWAD(nil, 'FRAMES_ITEM_ARMORGREEN', GameWAD+':TEXTURES\ARMORGREEN', 32, 16, 3, True);
@@ -84,93 +139,13 @@ implementation
     g_Texture_CreateWADEx('ITEM_SUIT', GameWAD+':TEXTURES\SUIT');
     g_Texture_CreateWADEx('ITEM_WEAPON_KASTET', GameWAD+':TEXTURES\KASTET');
     g_Texture_CreateWADEx('ITEM_MEDKIT_BLACK', GameWAD+':TEXTURES\BMED');
-    //
-    g_Texture_Get('ITEM_MEDKIT_SMALL',     gItemsTexturesID[ITEM_MEDKIT_SMALL]);
-    g_Texture_Get('ITEM_MEDKIT_LARGE',     gItemsTexturesID[ITEM_MEDKIT_LARGE]);
-    g_Texture_Get('ITEM_MEDKIT_BLACK',     gItemsTexturesID[ITEM_MEDKIT_BLACK]);
-    g_Texture_Get('ITEM_SUIT',             gItemsTexturesID[ITEM_SUIT]);
-    g_Texture_Get('ITEM_OXYGEN',           gItemsTexturesID[ITEM_OXYGEN]);
-    g_Texture_Get('ITEM_WEAPON_SAW',       gItemsTexturesID[ITEM_WEAPON_SAW]);
-    g_Texture_Get('ITEM_WEAPON_SHOTGUN1',  gItemsTexturesID[ITEM_WEAPON_SHOTGUN1]);
-    g_Texture_Get('ITEM_WEAPON_SHOTGUN2',  gItemsTexturesID[ITEM_WEAPON_SHOTGUN2]);
-    g_Texture_Get('ITEM_WEAPON_CHAINGUN',  gItemsTexturesID[ITEM_WEAPON_CHAINGUN]);
-    g_Texture_Get('ITEM_WEAPON_ROCKETLAUNCHER', gItemsTexturesID[ITEM_WEAPON_ROCKETLAUNCHER]);
-    g_Texture_Get('ITEM_WEAPON_PLASMA',    gItemsTexturesID[ITEM_WEAPON_PLASMA]);
-    g_Texture_Get('ITEM_WEAPON_BFG',       gItemsTexturesID[ITEM_WEAPON_BFG]);
-    g_Texture_Get('ITEM_WEAPON_SUPERPULEMET', gItemsTexturesID[ITEM_WEAPON_SUPERPULEMET]);
-    g_Texture_Get('ITEM_WEAPON_FLAMETHROWER', gItemsTexturesID[ITEM_WEAPON_FLAMETHROWER]);
-    g_Texture_Get('ITEM_AMMO_BULLETS',     gItemsTexturesID[ITEM_AMMO_BULLETS]);
-    g_Texture_Get('ITEM_AMMO_BULLETS_BOX', gItemsTexturesID[ITEM_AMMO_BULLETS_BOX]);
-    g_Texture_Get('ITEM_AMMO_SHELLS',      gItemsTexturesID[ITEM_AMMO_SHELLS]);
-    g_Texture_Get('ITEM_AMMO_SHELLS_BOX',  gItemsTexturesID[ITEM_AMMO_SHELLS_BOX]);
-    g_Texture_Get('ITEM_AMMO_ROCKET',      gItemsTexturesID[ITEM_AMMO_ROCKET]);
-    g_Texture_Get('ITEM_AMMO_ROCKET_BOX',  gItemsTexturesID[ITEM_AMMO_ROCKET_BOX]);
-    g_Texture_Get('ITEM_AMMO_CELL',        gItemsTexturesID[ITEM_AMMO_CELL]);
-    g_Texture_Get('ITEM_AMMO_CELL_BIG',    gItemsTexturesID[ITEM_AMMO_CELL_BIG]);
-    g_Texture_Get('ITEM_AMMO_FUELCAN',     gItemsTexturesID[ITEM_AMMO_FUELCAN]);
-    g_Texture_Get('ITEM_AMMO_BACKPACK',    gItemsTexturesID[ITEM_AMMO_BACKPACK]);
-    g_Texture_Get('ITEM_KEY_RED',          gItemsTexturesID[ITEM_KEY_RED]);
-    g_Texture_Get('ITEM_KEY_GREEN',        gItemsTexturesID[ITEM_KEY_GREEN]);
-    g_Texture_Get('ITEM_KEY_BLUE',         gItemsTexturesID[ITEM_KEY_BLUE]);
-    g_Texture_Get('ITEM_WEAPON_KASTET',    gItemsTexturesID[ITEM_WEAPON_KASTET]);
-    g_Texture_Get('ITEM_WEAPON_PISTOL',    gItemsTexturesID[ITEM_WEAPON_PISTOL]);
-    // Frames
-    g_Frames_Get(itemFrames[ITEM_ARMOR_GREEN], 'FRAMES_ITEM_ARMORGREEN');
-    g_Frames_Get(itemFrames[ITEM_ARMOR_BLUE], 'FRAMES_ITEM_ARMORBLUE');
-    g_Frames_Get(itemFrames[ITEM_JETPACK], 'FRAMES_ITEM_JETPACK');
-    g_Frames_Get(itemFrames[ITEM_SPHERE_BLUE], 'FRAMES_ITEM_BLUESPHERE');
-    g_Frames_Get(itemFrames[ITEM_SPHERE_WHITE], 'FRAMES_ITEM_WHITESPHERE');
-    g_Frames_Get(itemFrames[ITEM_INVUL], 'FRAMES_ITEM_INVUL');
-    g_Frames_Get(itemFrames[ITEM_INVIS], 'FRAMES_ITEM_INVIS');
-    g_Frames_Get(itemFrames[ITEM_BOTTLE], 'FRAMES_ITEM_BOTTLE');
-    g_Frames_Get(itemFrames[ITEM_HELMET], 'FRAMES_ITEM_HELMET');
   end;
 
   procedure r_Items_Free;
+    var i: Integer;
   begin
-    g_Frames_DeleteByName('FRAMES_ITEM_BLUESPHERE');
-    g_Frames_DeleteByName('FRAMES_ITEM_WHITESPHERE');
-    g_Frames_DeleteByName('FRAMES_ITEM_ARMORGREEN');
-    g_Frames_DeleteByName('FRAMES_ITEM_ARMORBLUE');
-    g_Frames_DeleteByName('FRAMES_ITEM_JETPACK');
-    g_Frames_DeleteByName('FRAMES_ITEM_INVUL');
-    g_Frames_DeleteByName('FRAMES_ITEM_INVIS');
-    g_Frames_DeleteByName('FRAMES_ITEM_RESPAWN');
-    g_Frames_DeleteByName('FRAMES_ITEM_BOTTLE');
-    g_Frames_DeleteByName('FRAMES_ITEM_HELMET');
-    g_Frames_DeleteByName('FRAMES_FLAG_RED');
-    g_Frames_DeleteByName('FRAMES_FLAG_BLUE');
-    g_Frames_DeleteByName('FRAMES_FLAG_DOM');
-    g_Texture_Delete('ITEM_MEDKIT_SMALL');
-    g_Texture_Delete('ITEM_MEDKIT_LARGE');
-    g_Texture_Delete('ITEM_WEAPON_SAW');
-    g_Texture_Delete('ITEM_WEAPON_PISTOL');
-    g_Texture_Delete('ITEM_WEAPON_KASTET');
-    g_Texture_Delete('ITEM_WEAPON_SHOTGUN1');
-    g_Texture_Delete('ITEM_WEAPON_SHOTGUN2');
-    g_Texture_Delete('ITEM_WEAPON_CHAINGUN');
-    g_Texture_Delete('ITEM_WEAPON_ROCKETLAUNCHER');
-    g_Texture_Delete('ITEM_WEAPON_PLASMA');
-    g_Texture_Delete('ITEM_WEAPON_BFG');
-    g_Texture_Delete('ITEM_WEAPON_SUPERPULEMET');
-    g_Texture_Delete('ITEM_WEAPON_FLAMETHROWER');
-    g_Texture_Delete('ITEM_AMMO_BULLETS');
-    g_Texture_Delete('ITEM_AMMO_BULLETS_BOX');
-    g_Texture_Delete('ITEM_AMMO_SHELLS');
-    g_Texture_Delete('ITEM_AMMO_SHELLS_BOX');
-    g_Texture_Delete('ITEM_AMMO_ROCKET');
-    g_Texture_Delete('ITEM_AMMO_ROCKET_BOX');
-    g_Texture_Delete('ITEM_AMMO_CELL');
-    g_Texture_Delete('ITEM_AMMO_CELL_BIG');
-    g_Texture_Delete('ITEM_AMMO_FUELCAN');
-    g_Texture_Delete('ITEM_AMMO_BACKPACK');
-    g_Texture_Delete('ITEM_KEY_RED');
-    g_Texture_Delete('ITEM_KEY_GREEN');
-    g_Texture_Delete('ITEM_KEY_BLUE');
-    g_Texture_Delete('ITEM_OXYGEN');
-    g_Texture_Delete('ITEM_SUIT');
-    g_Texture_Delete('ITEM_WEAPON_KASTET');
-    g_Texture_Delete('ITEM_MEDKIT_BLACK');
+    for i := 0 to ITEM_MAX do
+      g_Frames_DeleteByID(items[i].id);
   end;
 
 procedure itemsDrawInternal (dropflag: Boolean);
@@ -192,14 +167,8 @@ begin
       if g_Collide(Obj.X, Obj.Y, Obj.Rect.Width, Obj.Rect.Height, sX, sY, sWidth, sHeight) then
       begin
         Obj.lerp(gLerpFactor, fX, fY);
-        if (Animation = nil) then
-        begin
-          e_Draw(gItemsTexturesID[ItemType], fX, fY, 0, true, false);
-        end
-        else if itemFrames[it.ItemType] <> 0 then
-        begin
-          r_AnimationState_Draw(itemFrames[it.ItemType], Animation, fX, fY, 0, TMirrorType.None, False)
-        end;
+
+        r_AnimState_Draw(items[it.ItemType].id, items[it.ItemType].anim, fX, fY, 0, TMirrorType.None, False);
 
         if g_debug_Frames then
         begin
@@ -224,4 +193,11 @@ begin
   itemsDrawInternal(true);
 end;
 
+  procedure r_Items_Update;
+    var i: Integer;
+  begin
+    for i := 0 to ITEM_MAX do
+      items[i].anim.Update;
+  end;
+
 end.
index 7e047f9a1752bacee291e6cdcc33ff55726bd4ea..6204da3b78fe1c5b004b37d75c0a624f9335917a 100644 (file)
@@ -65,12 +65,87 @@ implementation
   ;
 
   var
+    gItemsTexturesID: array [0..ITEM_MAX] of DWORD;
     PunchFrames: array [Boolean, 0..2] of DWORD;
     BulletTexture: DWORD;
     ShellTexture: DWORD;
 
   procedure r_Player_Load;
   begin
+    g_Frames_CreateWAD(nil, 'FRAMES_ITEM_BLUESPHERE', GameWAD+':TEXTURES\SBLUE', 32, 32, 4, True);
+    g_Frames_CreateWAD(nil, 'FRAMES_ITEM_WHITESPHERE', GameWAD+':TEXTURES\SWHITE', 32, 32, 4, True);
+    g_Frames_CreateWAD(nil, 'FRAMES_ITEM_ARMORGREEN', GameWAD+':TEXTURES\ARMORGREEN', 32, 16, 3, True);
+    g_Frames_CreateWAD(nil, 'FRAMES_ITEM_ARMORBLUE', GameWAD+':TEXTURES\ARMORBLUE', 32, 16, 3, True);
+    g_Frames_CreateWAD(nil, 'FRAMES_ITEM_JETPACK', GameWAD+':TEXTURES\JETPACK', 32, 32, 3, True);
+    g_Frames_CreateWAD(nil, 'FRAMES_ITEM_INVUL', GameWAD+':TEXTURES\INVUL', 32, 32, 4, True);
+    g_Frames_CreateWAD(nil, 'FRAMES_ITEM_INVIS', GameWAD+':TEXTURES\INVIS', 32, 32, 4, True);
+    g_Frames_CreateWAD(nil, 'FRAMES_ITEM_RESPAWN', GameWAD+':TEXTURES\ITEMRESPAWN', 32, 32, 5, True);
+    g_Frames_CreateWAD(nil, 'FRAMES_ITEM_BOTTLE', GameWAD+':TEXTURES\BOTTLE', 16, 32, 4, True);
+    g_Frames_CreateWAD(nil, 'FRAMES_ITEM_HELMET', GameWAD+':TEXTURES\HELMET', 16, 16, 4, True);
+    g_Frames_CreateWAD(nil, 'FRAMES_FLAG_RED', GameWAD+':TEXTURES\FLAGRED', 64, 64, 5, False);
+    g_Frames_CreateWAD(nil, 'FRAMES_FLAG_BLUE', GameWAD+':TEXTURES\FLAGBLUE', 64, 64, 5, False);
+    g_Frames_CreateWAD(nil, 'FRAMES_FLAG_DOM', GameWAD+':TEXTURES\FLAGDOM', 64, 64, 5, False);
+    g_Texture_CreateWADEx('ITEM_MEDKIT_SMALL', GameWAD+':TEXTURES\MED1');
+    g_Texture_CreateWADEx('ITEM_MEDKIT_LARGE', GameWAD+':TEXTURES\MED2');
+    g_Texture_CreateWADEx('ITEM_WEAPON_SAW', GameWAD+':TEXTURES\SAW');
+    g_Texture_CreateWADEx('ITEM_WEAPON_PISTOL', GameWAD+':TEXTURES\PISTOL');
+    g_Texture_CreateWADEx('ITEM_WEAPON_KASTET', GameWAD+':TEXTURES\KASTET');
+    g_Texture_CreateWADEx('ITEM_WEAPON_SHOTGUN1', GameWAD+':TEXTURES\SHOTGUN1');
+    g_Texture_CreateWADEx('ITEM_WEAPON_SHOTGUN2', GameWAD+':TEXTURES\SHOTGUN2');
+    g_Texture_CreateWADEx('ITEM_WEAPON_CHAINGUN', GameWAD+':TEXTURES\MGUN');
+    g_Texture_CreateWADEx('ITEM_WEAPON_ROCKETLAUNCHER', GameWAD+':TEXTURES\RLAUNCHER');
+    g_Texture_CreateWADEx('ITEM_WEAPON_PLASMA', GameWAD+':TEXTURES\PGUN');
+    g_Texture_CreateWADEx('ITEM_WEAPON_BFG', GameWAD+':TEXTURES\BFG');
+    g_Texture_CreateWADEx('ITEM_WEAPON_SUPERPULEMET', GameWAD+':TEXTURES\SPULEMET');
+    g_Texture_CreateWADEx('ITEM_WEAPON_FLAMETHROWER', GameWAD+':TEXTURES\FLAMETHROWER');
+    g_Texture_CreateWADEx('ITEM_AMMO_BULLETS', GameWAD+':TEXTURES\CLIP');
+    g_Texture_CreateWADEx('ITEM_AMMO_BULLETS_BOX', GameWAD+':TEXTURES\AMMO');
+    g_Texture_CreateWADEx('ITEM_AMMO_SHELLS', GameWAD+':TEXTURES\SHELL1');
+    g_Texture_CreateWADEx('ITEM_AMMO_SHELLS_BOX', GameWAD+':TEXTURES\SHELL2');
+    g_Texture_CreateWADEx('ITEM_AMMO_ROCKET', GameWAD+':TEXTURES\ROCKET');
+    g_Texture_CreateWADEx('ITEM_AMMO_ROCKET_BOX', GameWAD+':TEXTURES\ROCKETS');
+    g_Texture_CreateWADEx('ITEM_AMMO_CELL', GameWAD+':TEXTURES\CELL');
+    g_Texture_CreateWADEx('ITEM_AMMO_CELL_BIG', GameWAD+':TEXTURES\CELL2');
+    g_Texture_CreateWADEx('ITEM_AMMO_FUELCAN', GameWAD+':TEXTURES\FUELCAN');
+    g_Texture_CreateWADEx('ITEM_AMMO_BACKPACK', GameWAD+':TEXTURES\BPACK');
+    g_Texture_CreateWADEx('ITEM_KEY_RED', GameWAD+':TEXTURES\KEYR');
+    g_Texture_CreateWADEx('ITEM_KEY_GREEN', GameWAD+':TEXTURES\KEYG');
+    g_Texture_CreateWADEx('ITEM_KEY_BLUE', GameWAD+':TEXTURES\KEYB');
+    g_Texture_CreateWADEx('ITEM_OXYGEN', GameWAD+':TEXTURES\OXYGEN');
+    g_Texture_CreateWADEx('ITEM_SUIT', GameWAD+':TEXTURES\SUIT');
+    g_Texture_CreateWADEx('ITEM_WEAPON_KASTET', GameWAD+':TEXTURES\KASTET');
+    g_Texture_CreateWADEx('ITEM_MEDKIT_BLACK', GameWAD+':TEXTURES\BMED');
+
+    g_Texture_Get('ITEM_MEDKIT_SMALL',     gItemsTexturesID[ITEM_MEDKIT_SMALL]);
+    g_Texture_Get('ITEM_MEDKIT_LARGE',     gItemsTexturesID[ITEM_MEDKIT_LARGE]);
+    g_Texture_Get('ITEM_MEDKIT_BLACK',     gItemsTexturesID[ITEM_MEDKIT_BLACK]);
+    g_Texture_Get('ITEM_SUIT',             gItemsTexturesID[ITEM_SUIT]);
+    g_Texture_Get('ITEM_OXYGEN',           gItemsTexturesID[ITEM_OXYGEN]);
+    g_Texture_Get('ITEM_WEAPON_SAW',       gItemsTexturesID[ITEM_WEAPON_SAW]);
+    g_Texture_Get('ITEM_WEAPON_SHOTGUN1',  gItemsTexturesID[ITEM_WEAPON_SHOTGUN1]);
+    g_Texture_Get('ITEM_WEAPON_SHOTGUN2',  gItemsTexturesID[ITEM_WEAPON_SHOTGUN2]);
+    g_Texture_Get('ITEM_WEAPON_CHAINGUN',  gItemsTexturesID[ITEM_WEAPON_CHAINGUN]);
+    g_Texture_Get('ITEM_WEAPON_ROCKETLAUNCHER', gItemsTexturesID[ITEM_WEAPON_ROCKETLAUNCHER]);
+    g_Texture_Get('ITEM_WEAPON_PLASMA',    gItemsTexturesID[ITEM_WEAPON_PLASMA]);
+    g_Texture_Get('ITEM_WEAPON_BFG',       gItemsTexturesID[ITEM_WEAPON_BFG]);
+    g_Texture_Get('ITEM_WEAPON_SUPERPULEMET', gItemsTexturesID[ITEM_WEAPON_SUPERPULEMET]);
+    g_Texture_Get('ITEM_WEAPON_FLAMETHROWER', gItemsTexturesID[ITEM_WEAPON_FLAMETHROWER]);
+    g_Texture_Get('ITEM_AMMO_BULLETS',     gItemsTexturesID[ITEM_AMMO_BULLETS]);
+    g_Texture_Get('ITEM_AMMO_BULLETS_BOX', gItemsTexturesID[ITEM_AMMO_BULLETS_BOX]);
+    g_Texture_Get('ITEM_AMMO_SHELLS',      gItemsTexturesID[ITEM_AMMO_SHELLS]);
+    g_Texture_Get('ITEM_AMMO_SHELLS_BOX',  gItemsTexturesID[ITEM_AMMO_SHELLS_BOX]);
+    g_Texture_Get('ITEM_AMMO_ROCKET',      gItemsTexturesID[ITEM_AMMO_ROCKET]);
+    g_Texture_Get('ITEM_AMMO_ROCKET_BOX',  gItemsTexturesID[ITEM_AMMO_ROCKET_BOX]);
+    g_Texture_Get('ITEM_AMMO_CELL',        gItemsTexturesID[ITEM_AMMO_CELL]);
+    g_Texture_Get('ITEM_AMMO_CELL_BIG',    gItemsTexturesID[ITEM_AMMO_CELL_BIG]);
+    g_Texture_Get('ITEM_AMMO_FUELCAN',     gItemsTexturesID[ITEM_AMMO_FUELCAN]);
+    g_Texture_Get('ITEM_AMMO_BACKPACK',    gItemsTexturesID[ITEM_AMMO_BACKPACK]);
+    g_Texture_Get('ITEM_KEY_RED',          gItemsTexturesID[ITEM_KEY_RED]);
+    g_Texture_Get('ITEM_KEY_GREEN',        gItemsTexturesID[ITEM_KEY_GREEN]);
+    g_Texture_Get('ITEM_KEY_BLUE',         gItemsTexturesID[ITEM_KEY_BLUE]);
+    g_Texture_Get('ITEM_WEAPON_KASTET',    gItemsTexturesID[ITEM_WEAPON_KASTET]);
+    g_Texture_Get('ITEM_WEAPON_PISTOL',    gItemsTexturesID[ITEM_WEAPON_PISTOL]);
+
     g_Frames_CreateWAD(@PunchFrames[False, 0], 'FRAMES_PUNCH', GameWAD + ':WEAPONS\PUNCH', 64, 64, 4, False);
     g_Frames_CreateWAD(@PunchFrames[False, 1], 'FRAMES_PUNCH_UP', GameWAD + ':WEAPONS\PUNCH_UP', 64, 64, 4, False);
     g_Frames_CreateWAD(@PunchFrames[False, 2], 'FRAMES_PUNCH_DN', GameWAD + ':WEAPONS\PUNCH_DN', 64, 64, 4, False);
index e20271ab8e0caad2257009e71beb7ea5a40f4f8a..363093cd5ab7cab025f451473ba406b3c362435b 100644 (file)
@@ -288,6 +288,7 @@ implementation
     r_Map_Update;
     r_PlayerModel_Update;
     r_Console_Update;
+    r_Items_Update;
   end;
 
   procedure r_Render_Draw;