Changeset 548 for trunk/LocalPlayer
- Timestamp:
- Apr 21, 2024, 10:57:18 AM (8 months ago)
- Location:
- trunk/LocalPlayer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Battle.pas
r505 r548 169 169 170 170 IsoMap.SetOutput(Buffer); 171 BitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm + 8 + 4,172 171 UnshareBitmap(Buffer); 172 BitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm + 8 + 4, ym - 8 - 12 - 48); 173 173 { if TerrType<fForest then 174 174 Sprite(Buffer,HGrTerrain,0,16,66,32,1+TerrType*(xxt*2+1),1+yyt) … … 181 181 end; } 182 182 IsoMap.PaintUnit(1, 0, UnitInfo, 0); 183 BitBltCanvas(ca, xm + 8 + 4, ym - 8 - 12 - 48, 66, 48, Buffer.Canvas, 184 0, 0); 185 186 BitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm - 8 - 4 - 66, 187 ym + 8 + 12); 183 BitBltCanvas(ca, xm + 8 + 4, ym - 8 - 12 - 48, 66, 48, Buffer.Canvas, 0, 0); 184 185 UnshareBitmap(Buffer); 186 BitBltCanvas(Buffer.Canvas, 0, 0, 66, 48, ca, xm - 8 - 4 - 66, ym + 8 + 12); 188 187 MakeUnitInfo(Me, MyUn[uix], UnitInfo); 189 188 UnitInfo.Flags := UnitInfo.Flags and not unFortified; -
trunk/LocalPlayer/CityScreen.pas
r536 r548 1366 1366 and (Y >= ymOpt - 32) and (Y < ymOpt + 32) then 1367 1367 begin 1368 I := sqr(X - xmOpt) + sqr(Y - ymOpt); // click radius1368 I := Sqr(X - xmOpt) + Sqr(Y - ymOpt); // click radius 1369 1369 if I <= 32 * 32 then 1370 1370 begin … … 1375 1375 I := 3 // rwGrowth 1376 1376 else 1377 case trunc(arctan2(X - xmOpt, ymOpt - Y) * 180 / pi) of1377 case Trunc(ArcTan2(X - xmOpt, ymOpt - Y) * 180 / Pi) of 1378 1378 - 25 - 52 * 2 .. -26 - 52: 1379 1379 I := 1; -
trunk/LocalPlayer/IsoEngine.pas
r538 r548 36 36 Diry: array [0..7] of Integer = (-1, 0, 1, 2, 1, 0, -1, -2); 37 37 procedure CityGrid(xm, ym: Integer; CityAllowClick: Boolean); 38 procedure ClippedLine(X, Y, dx0, dy0: Integer; Mirror: Boolean); 38 39 function IsShoreTile(Loc: Integer): Boolean; 39 40 procedure MakeDark(Line: PPixelPointer; Length: Integer); … … 1053 1054 CityInfo: TCityInfo; 1054 1055 UnitInfo: TUnitInfo; 1055 fog: Boolean;1056 Fog: Boolean; 1056 1057 SpecialRow: Integer; 1057 1058 SpecialCol: Integer; … … 1192 1193 1193 1194 if moEditMode in MapOptions then 1194 fog := (Loc < 0) or (Loc >= G.lx * G.ly)1195 // else if CityLoc >=0 then1196 // fog:= (Loc<0) or (Loc>=G.lx*G.ly) or (Distance(Loc,CityLoc)>5)1195 Fog := (Loc < 0) or (Loc >= G.lx * G.ly) 1196 // else if CityLoc >= 0 then 1197 // Fog:= (Loc < 0) or (Loc >= G.lx * G.ly) or (Distance(Loc, CityLoc) > 5) 1197 1198 else if ShowGrWall then 1198 fog := Tile and fGrWall = 01199 Fog := Tile and fGrWall = 0 1199 1200 else 1200 fog := FoW and (Tile and fObserved = 0);1201 if fog and ShowObjects then1201 Fog := FoW and (Tile and fObserved = 0); 1202 if Fog and ShowObjects then 1202 1203 if Loc < -G.lx then 1203 1204 Sprite(HGrTerrain, X, Y + yyt, xxt * 2, yyt, 1 + 6 * (xxt * 2 + 1), … … 1298 1299 end; 1299 1300 1301 procedure TIsoMap.ClippedLine(X, Y, dx0, dy0: Integer; Mirror: Boolean); 1302 var 1303 x0, x1, dxmin, dymin, dxmax, dymax, N: Integer; 1304 begin 1305 with FOutput.Canvas do 1306 begin 1307 dxmin := (FLeft - X) div xxt; 1308 dymin := (RealTop - Y) div yyt; 1309 dxmax := (FRight - X - 1) div xxt + 1; 1310 dymax := (RealBottom - Y - 1) div yyt + 1; 1311 N := dymax - dy0; 1312 if Mirror then 1313 begin 1314 if dx0 - dxmin < N then 1315 N := dx0 - dxmin; 1316 if dx0 > dxmax then 1317 begin 1318 N := N - (dx0 - dxmax); 1319 dy0 := dy0 + (dx0 - dxmax); 1320 dx0 := dxmax; 1321 end; 1322 if dy0 < dymin then 1323 begin 1324 N := N - (dymin - dy0); 1325 dx0 := dx0 - (dymin - dy0); 1326 dy0 := dymin; 1327 end; 1328 end 1329 else 1330 begin 1331 if dxmax - dx0 < N then 1332 N := dxmax - dx0; 1333 if dx0 < dxmin then 1334 begin 1335 N := N - (dxmin - dx0); 1336 dy0 := dy0 + (dxmin - dx0); 1337 dx0 := dxmin; 1338 end; 1339 if dy0 < dymin then 1340 begin 1341 N := N - (dymin - dy0); 1342 dx0 := dx0 + (dymin - dy0); 1343 dy0 := dymin; 1344 end; 1345 end; 1346 if N <= 0 then 1347 Exit; 1348 if Mirror then 1349 begin 1350 x0 := X + dx0 * xxt - 1; 1351 x1 := X + (dx0 - N) * xxt - 1; 1352 end 1353 else 1354 begin 1355 x0 := X + dx0 * xxt; 1356 x1 := X + (dx0 + N) * xxt; 1357 end; 1358 MoveTo(x0, Y + dy0 * yyt); 1359 LineTo(x1, Y + (dy0 + N) * yyt); 1360 end; 1361 end; 1362 1300 1363 procedure TIsoMap.PaintGrid(X, Y, nx, ny: Integer); 1301 1302 procedure ClippedLine(dx0, dy0: Integer; Mirror: Boolean);1303 var1304 x0, x1, dxmin, dymin, dxmax, dymax, N: Integer;1305 begin1306 with FOutput.Canvas do1307 begin1308 dxmin := (FLeft - X) div xxt;1309 dymin := (RealTop - Y) div yyt;1310 dxmax := (FRight - X - 1) div xxt + 1;1311 dymax := (RealBottom - Y - 1) div yyt + 1;1312 N := dymax - dy0;1313 if Mirror then1314 begin1315 if dx0 - dxmin < N then1316 N := dx0 - dxmin;1317 if dx0 > dxmax then1318 begin1319 N := N - (dx0 - dxmax);1320 dy0 := dy0 + (dx0 - dxmax);1321 dx0 := dxmax;1322 end;1323 if dy0 < dymin then1324 begin1325 N := N - (dymin - dy0);1326 dx0 := dx0 - (dymin - dy0);1327 dy0 := dymin;1328 end;1329 end1330 else1331 begin1332 if dxmax - dx0 < N then1333 N := dxmax - dx0;1334 if dx0 < dxmin then1335 begin1336 N := N - (dxmin - dx0);1337 dy0 := dy0 + (dxmin - dx0);1338 dx0 := dxmin;1339 end;1340 if dy0 < dymin then1341 begin1342 N := N - (dymin - dy0);1343 dx0 := dx0 + (dymin - dy0);1344 dy0 := dymin;1345 end;1346 end;1347 if N <= 0 then1348 Exit;1349 if Mirror then1350 begin1351 x0 := X + dx0 * xxt - 1;1352 x1 := X + (dx0 - N) * xxt - 1;1353 end1354 else1355 begin1356 x0 := X + dx0 * xxt;1357 x1 := X + (dx0 + N) * xxt;1358 end;1359 MoveTo(x0, Y + dy0 * yyt);1360 LineTo(x1, Y + (dy0 + N) * yyt);1361 end;1362 end;1363 1364 1364 var 1365 1365 I: Integer; 1366 1366 begin 1367 FOutput.Canvas. pen.Color := $000000; // $FF shl (8 * Random(3));1367 FOutput.Canvas.Pen.Color := $000000; // $FF shl (8 * Random(3)); 1368 1368 for I := 0 to nx div 2 do 1369 ClippedLine( I * 2, 0, False);1369 ClippedLine(X, Y, I * 2, 0, False); 1370 1370 for I := 1 to (nx + 1) div 2 do 1371 ClippedLine( I * 2, 0, True);1371 ClippedLine(X, Y, I * 2, 0, True); 1372 1372 for I := 0 to ny div 2 do 1373 1373 begin 1374 ClippedLine( 0, 2 * I + 2, False);1375 ClippedLine( nx + 1, 2 * I + 1 + nx and 1, True);1374 ClippedLine(X, Y, 0, 2 * I + 2, False); 1375 ClippedLine(X, Y, nx + 1, 2 * I + 1 + nx and 1, True); 1376 1376 end; 1377 1377 end; … … 1425 1425 if Abs(y_n) < rShade then begin 1426 1426 // Darken left and right parts of elipsis 1427 w_n := sqrt(sqr(rShade) - sqr(y_n));1428 wBright := trunc(w_n * xxt + 0.5);1427 w_n := Sqrt(Sqr(rShade) - Sqr(y_n)); 1428 wBright := Trunc(w_n * xxt + 0.5); 1429 1429 Line.SetX(0); 1430 1430 MakeDark(@Line, ScaleToNative(xm - wBright)); -
trunk/LocalPlayer/Wonders.pas
r530 r548 88 88 const 89 89 Darken = 24; 90 // space =pi/120;90 // space = Pi / 120; 91 91 amax0 = 15734; // 1 shl 16*tan(pi/12-space); 92 92 amin1 = 19413; // 1 shl 16*tan(pi/12+space);
Note:
See TracChangeset
for help on using the changeset viewer.