add keywords for landscape ammomenu and touch interface
authorkoda
Sun, 12 Feb 2012 15:59:10 +0100
changeset 6676 21cf35a570a7
parent 6675 dab56311daa5
child 6677 6b7560b37eef
add keywords for landscape ammomenu and touch interface
hedgewars/options.inc
hedgewars/uTouch.pas
hedgewars/uTypes.pas
hedgewars/uVariables.pas
hedgewars/uWorld.pas
--- a/hedgewars/options.inc	Sun Feb 12 15:35:06 2012 +0100
+++ b/hedgewars/options.inc	Sun Feb 12 15:59:10 2012 +0100
@@ -36,6 +36,8 @@
     {$DEFINE Java_Prefix:= 'Java_org_hedgewars_hedgeroid_EngineProtocol_PascalExports_'}
     {$DEFINE USE_SDLTHREADS}
     {$DEFINE USE_CONTEXT_RESTORE}
+    {$DEFINE USE_LANDSCAPE_AMMOMENU}
+    {$DEFINE USE_TOUCH_INTERFACE}
 {$ENDIF}
 
 {$IFDEF IPHONEOS}
@@ -44,6 +46,7 @@
     {$DEFINE S3D_DISABLED}
     {$DEFINE GLunit:=gles11}
     {$DEFINE MOBILE}
+    {$DEFINE USE_LANDSCAPE_AMMOMENU}
 {$ENDIF}
 
 {$IFDEF WIN32}
--- a/hedgewars/uTouch.pas	Sun Feb 12 15:35:06 2012 +0100
+++ b/hedgewars/uTouch.pas	Sun Feb 12 15:59:10 2012 +0100
@@ -93,11 +93,11 @@
     //moving
     stopLeft, stopRight, walkingLeft, walkingRight :  boolean;
 
-
 procedure onTouchDown(x,y: Longword; pointerId: SDL_FingerId);
 var 
     finger: PTouch_Finger;
 begin
+{$IFDEF USE_TOUCH_INTERFACE}
 finger := addFinger(x,y,pointerId);
 case pointerCount of
         1:
@@ -163,6 +163,7 @@
             baseZoomValue := ZoomValue
         end;
     end;//end case pointerCount of
+{$ENDIF}
 end;
 
 procedure onTouchMotion(x,y: Longword;dx,dy: LongInt; pointerId: SDL_FingerId);
--- a/hedgewars/uTypes.pas	Sun Feb 12 15:35:06 2012 +0100
+++ b/hedgewars/uTypes.pas	Sun Feb 12 15:59:10 2012 +0100
@@ -58,7 +58,7 @@
             sprFinger, sprAirBomb, sprAirplane, sprAmAirplane, sprAmGirder,
             sprHHTelepMask, sprSwitch, sprParachute, sprTarget, sprRopeNode,
             sprQuestion, sprPowerBar, sprWindBar, sprWindL, sprWindR,
-{$IFDEF ANDROID}
+{$IFDEF USE_TOUCH_INTERFACE}
             sprFireButton, sprArrowUp, sprArrowDown, sprArrowLeft, sprArrowRight, sprBackjump, sprForwardjump,
 {$ENDIF}
             sprFlake, sprHandRope, sprHandBazooka, sprHandShotgun,
--- a/hedgewars/uVariables.pas	Sun Feb 12 15:35:06 2012 +0100
+++ b/hedgewars/uVariables.pas	Sun Feb 12 15:59:10 2012 +0100
@@ -195,7 +195,7 @@
 
 /////////////////////////////////////
 //Buttons
-{$IFDEF MOBILE}
+{$IFDEF USE_TOUCH_INTERFACE}
     buttonScale: GLFloat;
 
     arrowUpX, arrowUpY, arrowUpW, arrowUpH: LongInt; 
@@ -395,7 +395,7 @@
             Width:  80; Height: 13; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprWindL
             (FileName:      'WindR'; Path: ptGraphics; AltPath: ptNone; Texture: nil; Surface: nil;
             Width:  80; Height: 13; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpMedium; getDimensions: false; getImageDimensions: true),// sprWindR
-{$IFDEF ANDROID}
+{$IFDEF USE_TOUCH_INTERFACE}
             (FileName: 'firebutton'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;
             Width: 128; Height: 128; imageWidth: 0; imageHeight: 0; saveSurf: false; priority: tpHigh; getDimensions: false; getImageDimensions: true), // sprFireButton
             (FileName: 'arrowUp'; Path: ptButtons; AltPath: ptNone; Texture: nil; Surface: nil;
--- a/hedgewars/uWorld.pas	Sun Feb 12 15:35:06 2012 +0100
+++ b/hedgewars/uWorld.pas	Sun Feb 12 15:59:10 2012 +0100
@@ -197,7 +197,7 @@
 SkyOffset:= 0;
 HorizontOffset:= 0;
 
-{$IFDEF ANDROID}
+{$IFDEF USE_TOUCH_INTERFACE}
 //positioning of the buttons
 buttonScale:= 1.5/cDefaultZoomLevel;
 firebuttonX:= (cScreenWidth shr 1) - Round(spritesData[sprFireButton].Texture^.h * buttonScale);
@@ -266,7 +266,7 @@
     for i:= 0 to cMaxSlotIndex do
         if((i = 0) and (Ammo^[i,1].Count > 0)) or ((i <> 0) and (Ammo^[i,0].Count > 0)) then
             inc(SlotsNum);
-{$IFDEF MOBILE}
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
     SlotsNumX:= SlotsNum;
     SlotsNumY:= cMaxSlotAmmoIndex + 2;
 {$ELSE}
@@ -290,7 +290,7 @@
     for i:= 0 to cMaxSlotIndex do
         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
             begin
-{$IFDEF MOBILE}
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
             y:= AMRect.y;
 {$ELSE}
             x:= AMRect.x;
@@ -315,14 +315,14 @@
                             DrawSprite2Surf(sprAMAmmos, amSurface, x + AMSlotPadding, 
        						       y + AMSlotPadding, AMFrame);
                         end;
-{$IFDEF MOBILE}
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
 	    inc(y, AMSlotSize + 1); //the plus one is for the border
 {$ELSE}
 	    inc(x, AMSlotSize + 1);
 {$ENDIF}
 	    end;
 	end;
-{$IFDEF MOBILE}
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
     inc(x, AMSlotSize + 1);
 {$ELSE}
     inc(y, AMSlotSize + 1);
@@ -385,7 +385,7 @@
     FreeTexture(AmmoMenuTex);
     AmmoMenuTex:= GetAmmoMenuTexture(Ammo);
 
-{$IFDEF MOBILE}
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
     if isPhone() then
         begin
         AmmoRect.x:= -(AmmoRect.w shr 1);
@@ -465,7 +465,7 @@
     Pos:= -1;
     Slot:= -1;
     c:= -1;
-{$IFDEF MOBILE}
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
     for i:= 0 to cMaxSlotIndex do
         if ((i = 0) and (Ammo^[i, 1].Count > 0)) or ((i <> 0) and (Ammo^[i, 0].Count > 0)) then
             begin
@@ -549,7 +549,7 @@
         FreeWeaponTooltip;
 
     if (WeaponTooltipTex <> nil) and (AMShiftX = 0) and (AMShiftY = 0) then
-{$IFDEF MOBILE}
+{$IFDEF USE_LANDSCAPE_AMMOMENU}
         if not isPhone() then
             ShowWeaponTooltip(-WeaponTooltipTex^.w div 2, AmmoRect.y - WeaponTooltipTex^.h - AMSlotSize);
 {$ELSE}
@@ -557,7 +557,7 @@
 {$ENDIF}
 
     bSelected:= false;
-{$IFNDEF MOBILE}
+{$IFNDEF USE_LANDSCAPE_AMMOMENU}
    if (AMShiftX = 0) and (AMShiftY = 0) then
         DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8);
 {$ENDIF}
@@ -1089,7 +1089,7 @@
 // Captions
 DrawCaptions;
 
-{$IFDEF ANDROID}
+{$IFDEF USE_TOUCH_INTERFACE}
 // Draw buttons Related to the Touch interface
 DrawTexture(arrowLeftX, arrowLeftY,spritesData[sprArrowLeft].Texture, buttonScale);
 DrawTexture(arrowRightX, arrowRightY,spritesData[sprArrowRight].Texture, buttonScale);