hedgewars/uStore.pas
changeset 2753 2305bb5dc5f2
parent 2751 2a3091b13ce4
child 2786 85f6425a4d74
equal deleted inserted replaced
2752:df01bbbd0e1a 2753:2305bb5dc5f2
    36     cScaleFactor: GLfloat;
    36     cScaleFactor: GLfloat;
    37     SupportNPOTT: Boolean;
    37     SupportNPOTT: Boolean;
    38     Step: LongInt;
    38     Step: LongInt;
    39     squaresize : LongInt;
    39     squaresize : LongInt;
    40     numsquares : LongInt;
    40     numsquares : LongInt;
    41 {$IFDEF SDL13notworking}
       
    42     ProgrTex: TSDL_TextureID;
       
    43 {$ELSE}
       
    44     ProgrTex: PTexture;
    41     ProgrTex: PTexture;
    45 {$ENDIF}
       
    46 
    42 
    47 procedure init_uStore;
    43 procedure init_uStore;
    48 procedure free_uStore;
    44 procedure free_uStore;
    49 
    45 
    50 procedure StoreLoad;
    46 procedure StoreLoad;
  1483 RenderHelpWindow:=  Surface2Tex(tmpsurf, true);
  1479 RenderHelpWindow:=  Surface2Tex(tmpsurf, true);
  1484 SDL_FreeSurface(tmpsurf)
  1480 SDL_FreeSurface(tmpsurf)
  1485 end;
  1481 end;
  1486 
  1482 
  1487 procedure RenderWeaponTooltip(atype: TAmmoType);
  1483 procedure RenderWeaponTooltip(atype: TAmmoType);
       
  1484 {$IFNDEF IPHONEOS}
  1488 var r: TSDL_Rect;
  1485 var r: TSDL_Rect;
  1489 	i: LongInt;
  1486 	i: LongInt;
  1490 	extra: string;
  1487 	extra: string;
  1491 	extracolor: LongInt;
  1488 	extracolor: LongInt;
  1492 begin
  1489 begin
  1493 {$IFNDEF IPHONEOS}
       
  1494 // don't do anything if the window shouldn't be shown
  1490 // don't do anything if the window shouldn't be shown
  1495 if not cWeaponTooltips then
  1491 if not cWeaponTooltips then
  1496 	begin
  1492 	begin
  1497 {$ENDIF}
       
  1498 	WeaponTooltipTex:= nil;
  1493 	WeaponTooltipTex:= nil;
  1499 {$IFNDEF IPHONEOS}
       
  1500 	exit
  1494 	exit
  1501 	end;
  1495 	end;
  1502 
  1496 
  1503 // free old texture
  1497 // free old texture
  1504 FreeWeaponTooltip;
  1498 FreeWeaponTooltip;
  1530 	extracolor:= 0;
  1524 	extracolor:= 0;
  1531 	end;
  1525 	end;
  1532 
  1526 
  1533 // render window and return the texture
  1527 // render window and return the texture
  1534 WeaponTooltipTex:= RenderHelpWindow(trammo[Ammoz[atype].NameId], trammoc[Ammoz[atype].NameId], trammod[Ammoz[atype].NameId], extra, extracolor, SpritesData[sprAMAmmos].Surface, @r)
  1528 WeaponTooltipTex:= RenderHelpWindow(trammo[Ammoz[atype].NameId], trammoc[Ammoz[atype].NameId], trammod[Ammoz[atype].NameId], extra, extracolor, SpritesData[sprAMAmmos].Surface, @r)
  1535 {$ENDIF}
  1529 end;
  1536 end;
  1530 {$ELSE}
       
  1531 begin end;
       
  1532 {$ENDIF}
  1537 
  1533 
  1538 procedure ShowWeaponTooltip(x, y: LongInt);
  1534 procedure ShowWeaponTooltip(x, y: LongInt);
  1539 begin
  1535 begin
  1540 {$IFNDEF IPHONEOS}
  1536 {$IFNDEF IPHONEOS}
  1541 // draw the texture if it exists
  1537 // draw the texture if it exists
  1562 	{$IFNDEF IPHONEOS}cGPUVendor:= gvUnknown;{$ENDIF}
  1558 	{$IFNDEF IPHONEOS}cGPUVendor:= gvUnknown;{$ENDIF}
  1563 
  1559 
  1564 	cScaleFactor:= 2.0;
  1560 	cScaleFactor:= 2.0;
  1565 	SupportNPOTT:= false;
  1561 	SupportNPOTT:= false;
  1566 	Step:= 0;
  1562 	Step:= 0;
  1567 {$IFDEF SDL13notworking}
       
  1568 	ProgrTex:= 0;
       
  1569 {$ELSE}
       
  1570 	ProgrTex:= nil;
  1563 	ProgrTex:= nil;
  1571 {$ENDIF}
       
  1572 end;
  1564 end;
  1573 
  1565 
  1574 procedure free_uStore;
  1566 procedure free_uStore;
  1575 begin
  1567 begin
  1576 
  1568