X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Frenders%2Fopengl%2Fr_map.pas;h=ecc219200a203a4c8d0a58298849c33350299731;hb=b8cc5f22e26818c1db1df53234fdaa36ab723325;hp=f27043e12a0cb26addf19793eddde58ad44bb6ba;hpb=02521d15eb6020ddac536714d2eefedd69fd0f6e;p=d2df-sdl.git diff --git a/src/game/renders/opengl/r_map.pas b/src/game/renders/opengl/r_map.pas index f27043e..ecc2192 100644 --- a/src/game/renders/opengl/r_map.pas +++ b/src/game/renders/opengl/r_map.pas @@ -42,6 +42,7 @@ interface procedure r_Map_Update; procedure r_Map_Draw (x, y, w, h, camx, camy: Integer; player: TPlayer; out acx, acy: Integer); + procedure r_Map_GetSpectatorLimits (out x0, y0, x1, y1: Integer); implementation @@ -1711,6 +1712,34 @@ implementation g_Anim_GetFrameByTime(FlagAnim, tick, count, FlagFrame); end; + procedure r_Map_GetSpectatorLimits (out x0, y0, x1, y1: Integer); + var w, h: Integer; + begin + w := Round(gScreenWidth / g_dbg_scale); + if gMapInfo.Width > w then + begin + x0 := w div 2; + x1 := gMapInfo.Width - w div 2 - 1; + end + else + begin + x0 := gMapInfo.Width div 2; + x1 := gMapInfo.Width div 2; + end; + + h := Round(gScreenHeight / g_dbg_scale); + if gMapInfo.Height > h then + begin + y0 := h div 2; + y1 := gMapInfo.Height - h div 2 - 1; + end + else + begin + y0 := gMapInfo.Height div 2; + y1 := gMapInfo.Height div 2; + end; + end; + initialization conRegVar('r_sq_draw', @UseAccel, 'accelerated spatial queries in rendering', 'accelerated rendering'); conRegVar('r_debug_camera_scale', @DebugCameraScale, 0.0001, 1000.0, '', '');