X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_holmes.inc;h=c053b4c73e8eb7b246bf9470fc055a808b0b6434;hb=5c72767aba48c236cd81972a6d79ff67b64ecd92;hp=3cfdd17b09580471164bfc819190b7ee85d861e6;hpb=8c90efc38cb9e8c9f728280138dd86820a502888;p=d2df-sdl.git diff --git a/src/game/g_holmes.inc b/src/game/g_holmes.inc index 3cfdd17..c053b4c 100644 --- a/src/game/g_holmes.inc +++ b/src/game/g_holmes.inc @@ -153,6 +153,34 @@ begin end; +// ////////////////////////////////////////////////////////////////////////// // +type + TScissorSave = record + public + wassc: Boolean; + scxywh: packed array[0..3] of GLint; + + public + procedure save (enableScissoring: Boolean); + procedure restore (); + end; + +procedure TScissorSave.save (enableScissoring: Boolean); +begin + wassc := (glIsEnabled(GL_SCISSOR_TEST) <> 0); + if wassc then glGetIntegerv(GL_SCISSOR_BOX, @scxywh[0]) else glGetIntegerv(GL_VIEWPORT, @scxywh[0]); + //conwritefln('(%d,%d)-(%d,%d)', [scxywh[0], scxywh[1], scxywh[2], scxywh[3]]); + if enableScissoring then glEnable(GL_SCISSOR_TEST); +end; + + +procedure TScissorSave.restore (); +begin + glScissor(scxywh[0], scxywh[1], scxywh[2], scxywh[3]); + if wassc then glEnable(GL_SCISSOR_TEST) else glDisable(GL_SCISSOR_TEST); +end; + + // ////////////////////////////////////////////////////////////////////////// // // fonts const kgiFont6: array[0..256*8-1] of Byte = (