X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_grid.pas;h=6017ad4b492dfbc436da477ccd41a685a3bca7b1;hb=981037c01006b8a8bea65b69a75ba9f7353b295d;hp=153e6faa7bcc76f8339c2165c8d12a018cfd026b;hpb=00108962d2ec807119413ff0a5fbd48d712168e1;p=d2df-sdl.git diff --git a/src/game/g_grid.pas b/src/game/g_grid.pas index 153e6fa..6017ad4 100644 --- a/src/game/g_grid.pas +++ b/src/game/g_grid.pas @@ -20,6 +20,7 @@ {.$DEFINE D2F_DEBUG_XXQ} {.$DEFINE D2F_DEBUG_MOVER} {$ENDIF} +{.$DEFINE GRID_USE_ORTHO_ACCEL} unit g_grid; interface @@ -1283,8 +1284,10 @@ var f, ptag, distSq: Integer; x0, y0, x1, y1: Integer; // horizontal walker + {$IFDEF GRID_USE_ORTHO_ACCEL} wklen, wkstep: Integer; hopt: Boolean; + {$ENDIF} begin result := Default(ITP); lastObj := Default(ITP); @@ -1506,6 +1509,7 @@ begin end; lq := mLastQuery; + {$IFDEF GRID_USE_ORTHO_ACCEL} // if this is strict horizontal trace, use optimized codepath if (ax0 = ax1) or (ay0 = ay1) then begin @@ -1721,6 +1725,7 @@ begin if wasHit and not assigned(cb) then result := lastObj else begin ex := ax1; ey := ay1; end; exit; end; + {$ENDIF} {$IF DEFINED(D2F_DEBUG_RAYTRACE)} if assigned(dbgRayTraceTileHitCB) then dbgRayTraceTileHitCB((xptr^ div tsize*tsize)+minx, (yptr^ div tsize*tsize)+miny);