Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function w2s(localx,localy, tileheight : integer) : TPoint;
- var
- rd : TRenderData;
- r : TRender;
- i1, j1, l1, k1, i2: integer;
- begin;
- result := point(-1,-1);
- UpdateRenderInfo(r,rd);
- i1 := RD.zOff + ( (RD.zX * (localx + RD.zY) * (tileheight + RD.zZ) * localy) shr 15);
- writeln('i1 = '+inttostr(i1));
- writeln('zNear: '+inttostr(r.zNear));
- writeln('zFar: '+inttostr(r.zFar));
- if( (i1 < R.zNear) or (i1 > R.zFar) )then
- begin
- Writeln('Fail 1.');
- Exit;
- end;
- j1 := (R.xMultiplier * (RD.xOff + ((RD.xX * (localx + RD.xY) *
- (tileHeight + RD.xZ) * localy) shr 15)) ) / i1;
- l1 := (R.yMultiplier * (RD.yOff + ((RD.yX * (localx + RD.yY) *
- (tileHeight + RD.yZ) * localy) shr 15)) ) / i1;
- writeln('j1: '+inttostr(j1));
- writeln('l1: '+inttostr(l1));
- if( (j1 >= R.absoluteX1) and (j1 <= r.absoluteY1) and
- (l1 >= r.absoluteY1) and (l1 <= r.absoluteY2) )then
- begin
- Result := Point(j1 - r.absoluteX1, l1 - R.absoluteY1);
- Writeln('Result: ('+inttostr(Result.x)+', '+inttostr(Result.y)+');');
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement