hedgewars/uWorld.pas
changeset 12719 637b1987570e
parent 12708 5ef6780b1c05
child 12787 a6f51ac9a3f2
equal deleted inserted replaced
12718:185c7f378f9d 12719:637b1987570e
   422 begin
   422 begin
   423     if cOnlyStats then exit(nil);
   423     if cOnlyStats then exit(nil);
   424 
   424 
   425     SlotsNum:= 0;
   425     SlotsNum:= 0;
   426     for i:= 0 to cMaxSlotIndex do
   426     for i:= 0 to cMaxSlotIndex do
   427         if((i = 0) and (Ammo^[i,1].Count > 0)) or ((i <> 0) and (i <> cHiddenSlotIndex) and (Ammo^[i,0].Count > 0)) then
   427         if (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0) then
   428             inc(SlotsNum);
   428             inc(SlotsNum);
   429 {$IFDEF USE_LANDSCAPE_AMMOMENU}
   429 {$IFDEF USE_LANDSCAPE_AMMOMENU}
   430     SlotsNumX:= SlotsNum;
   430     SlotsNumX:= SlotsNum;
   431     SlotsNumY:= cMaxSlotAmmoIndex + 2;
   431     SlotsNumY:= cMaxSlotAmmoIndex + 2;
   432     {$IFDEF USE_AM_NUMCOLUMN}
   432     {$IFDEF USE_AM_NUMCOLUMN}
   453     SDL_FillRect(amSurface, @AMRect, SDL_MapRGB(amSurface^.format, 0,0,0));
   453     SDL_FillRect(amSurface, @AMRect, SDL_MapRGB(amSurface^.format, 0,0,0));
   454 
   454 
   455     x:= AMRect.x;
   455     x:= AMRect.x;
   456     y:= AMRect.y;
   456     y:= AMRect.y;
   457     for i:= 0 to cMaxSlotIndex do
   457     for i:= 0 to cMaxSlotIndex do
   458         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0)) then
   458         if (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0) then
   459             begin
   459             begin
   460 {$IFDEF USE_LANDSCAPE_AMMOMENU}
   460 {$IFDEF USE_LANDSCAPE_AMMOMENU}
   461             y:= AMRect.y;
   461             y:= AMRect.y;
   462 {$ELSE}
   462 {$ELSE}
   463             x:= AMRect.x;
   463             x:= AMRect.x;
   660 Pos:= -1;
   660 Pos:= -1;
   661 Slot:= -1;
   661 Slot:= -1;
   662 {$IFDEF USE_LANDSCAPE_AMMOMENU}
   662 {$IFDEF USE_LANDSCAPE_AMMOMENU}
   663 c:= -1;
   663 c:= -1;
   664     for i:= 0 to cMaxSlotIndex do
   664     for i:= 0 to cMaxSlotIndex do
   665         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0)) then
   665         if (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0) then
   666             begin
   666             begin
   667             inc(c);
   667             inc(c);
   668     {$IFDEF USE_AM_NUMCOLUMN}
   668     {$IFDEF USE_AM_NUMCOLUMN}
   669             g:= 1;
   669             g:= 1;
   670     {$ELSE}
   670     {$ELSE}
   690                    end;
   690                    end;
   691             end;
   691             end;
   692 {$ELSE}
   692 {$ELSE}
   693 c:= -1;
   693 c:= -1;
   694     for i:= 0 to cMaxSlotIndex do
   694     for i:= 0 to cMaxSlotIndex do
   695         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0)) then
   695         if (i <> cHiddenSlotIndex) and (Ammo^[i, 0].Count > 0) then
   696             begin
   696             begin
   697             inc(c);
   697             inc(c);
   698     {$IFDEF USE_AM_NUMCOLUMN}
   698     {$IFDEF USE_AM_NUMCOLUMN}
   699             g:= 1;
   699             g:= 1;
   700     {$ELSE}
   700     {$ELSE}