aboutsummaryrefslogtreecommitdiffstats
path: root/Game/Code
diff options
context:
space:
mode:
authork-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-05-22 17:48:55 +0000
committerk-m_schindler <k-m_schindler@b956fd51-792f-4845-bead-9b4dfca2ff2c>2008-05-22 17:48:55 +0000
commite1938f1d401aed7c142c823f964f07ff31b49229 (patch)
tree4520b78fa4026a8edc4fd48cefb92ff9d53edfcd /Game/Code
parent7350834648d9281db447a153a06719fd7f5ccc92 (diff)
downloadusdx-e1938f1d401aed7c142c823f964f07ff31b49229.tar.gz
usdx-e1938f1d401aed7c142c823f964f07ff31b49229.tar.xz
usdx-e1938f1d401aed7c142c823f964f07ff31b49229.zip
further code improvement in TMenu.InRegion
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1119 b956fd51-792f-4845-bead-9b4dfca2ff2c
Diffstat (limited to '')
-rw-r--r--Game/Code/Menu/UMenu.pas5
1 files changed, 2 insertions, 3 deletions
diff --git a/Game/Code/Menu/UMenu.pas b/Game/Code/Menu/UMenu.pas
index 102722e4..5fe7d317 100644
--- a/Game/Code/Menu/UMenu.pas
+++ b/Game/Code/Menu/UMenu.pas
@@ -1422,11 +1422,10 @@ function TMenu.InRegion(X1, Y1, X2, Y2, X, Y: real): boolean;
var
scaled_x, scaled_y : real;
begin
- Result := false;
+ { RenderW and RenderH are defined in Classes/UGraphic.pas }
scaled_x := x*640.0/RenderW;
scaled_y := x*480.0/RenderH;
- if (X1 <= scaled_x) and (scaled_x <= X2) and (Y1 <= scaled_y) and (scaled_y <= Y2) then
- Result := true;
+ Result := (X1 <= scaled_x) and (scaled_x <= X2) and (Y1 <= scaled_y) and (scaled_y <= Y2);
end;
function TMenu.InStaticRegion(StaticNr: integer; X, Y: integer): boolean;