turn hwp Ammos overrides into overlays. untested.
authornemo
Tue, 25 Apr 2017 13:13:47 -0400
changeset 12324 69a37922353b
parent 12323 7c04b4c4ffc2
child 12325 2bfbbd3d04ee
turn hwp Ammos overrides into overlays. untested.
hedgewars/uStore.pas
hedgewars/uVariables.pas
share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png
share/hedgewars/Data/Graphics/AmmoMenu/Ammos_base.png
share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw.png
share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw_base.png
--- a/hedgewars/uStore.pas	Tue Apr 25 17:51:03 2017 +0200
+++ b/hedgewars/uStore.pas	Tue Apr 25 13:13:47 2017 -0400
@@ -374,7 +374,7 @@
     ii: TSprite;
     fi: THWFont;
     ai: TAmmoType;
-    tmpsurf: PSDL_Surface;
+    tmpsurf, tmpoverlay: PSDL_Surface;
     i, imflags: LongInt;
 begin
 AddFileLog('StoreLoad()');
@@ -445,6 +445,15 @@
                         Width:= tmpsurf^.w;
                         Height:= tmpsurf^.h
                         end;
+                if (ii in [sprAMAmmos, sprAMAmmosBW]) then
+                    begin
+                    tmpoverlay := LoadDataImage(Path, copy(FileName, 1, length(FileName)-5), (imflags and not ifCritical));
+                    if tmpoverlay <> nil then
+                        begin
+                        copyToXY(tmpoverlay, tmpsurf, 0, 0);
+                        SDL_FreeSurface(tmpoverlay)
+                        end
+                    end;
                 if (ii in [sprSky, sprSkyL, sprSkyR, sprHorizont, sprHorizontL, sprHorizontR]) then
                     begin
                     Texture:= Surface2Tex(tmpsurf, true);
--- a/hedgewars/uVariables.pas	Tue Apr 25 17:51:03 2017 +0200
+++ b/hedgewars/uVariables.pas	Tue Apr 25 13:13:47 2017 -0400
@@ -404,9 +404,9 @@
             Width:   0; Height:  0; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: true; getImageDimensions: true),// sprSkyR
             (FileName:   'Slot'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
             Width: 32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAMSlot
-            (FileName:      'Ammos'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
+            (FileName:      'Ammos_base'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAMAmmos
-            (FileName:   'Ammos_bw'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
+            (FileName:   'Ammos_bw_base'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: true; priority: tpHigh; getDimensions: false; getImageDimensions: true),// sprAMAmmosBW
             (FileName:   'SlotKeys'; Path: ptAmmoMenu; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  32; Height: 32; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprAMSlotKeys
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png has changed
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos_base.png has changed
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw.png has changed
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw_base.png has changed