diff --git a/sc2/src/libs/gfxlib.h b/sc2/src/libs/gfxlib.h index 73b3ba72d..9ec004ade 100644 --- a/sc2/src/libs/gfxlib.h +++ b/sc2/src/libs/gfxlib.h @@ -246,7 +246,6 @@ extern Color SetContextBackGroundColor (Color Color); extern Color GetContextBackGroundColor (void); extern FRAME SetContextFGFrame (FRAME Frame); extern FRAME GetContextFGFrame (void); -extern BOOLEAN SetContextClipping (BOOLEAN ClipStatus); // Context cliprect defines the drawing bounds. Additionally, all // drawing positions (x,y) are relative to the cliprect corner. extern BOOLEAN SetContextClipRect (RECT *pRect); diff --git a/sc2/src/libs/graphics/context.c b/sc2/src/libs/graphics/context.c index 15b7e80b9..0ccb1d0f9 100644 --- a/sc2/src/libs/graphics/context.c +++ b/sc2/src/libs/graphics/context.c @@ -98,7 +98,6 @@ CreateContextAux (void) BUILD_COLOR (MAKE_RGB15 (0x1F, 0x1F, 0x1F), 0x0F)); SetContextBackGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x00), 0x00)); - SetContextClipping (TRUE); SetContext (OldContext); } @@ -200,27 +199,6 @@ GetContextBackGroundColor (void) return _get_context_bg_color (); } -BOOLEAN -SetContextClipping (BOOLEAN ClipStatus) -{ - BOOLEAN oldClipStatus; - - if (!ContextActive ()) - return (TRUE); - - oldClipStatus = (_get_context_flags () & BATCH_CLIP_GRAPHICS) != 0; - if (ClipStatus) - { - SetContextFlags (BATCH_CLIP_GRAPHICS); - } - else - { - UnsetContextFlags (BATCH_CLIP_GRAPHICS); - } - - return (oldClipStatus); -} - BOOLEAN SetContextClipRect (RECT *lpRect) { diff --git a/sc2/src/libs/graphics/context.h b/sc2/src/libs/graphics/context.h index 88ea5f01f..700e07ad2 100644 --- a/sc2/src/libs/graphics/context.h +++ b/sc2/src/libs/graphics/context.h @@ -29,6 +29,8 @@ typedef UWORD FBK_FLAGS; struct context_desc { UWORD Flags; + // Low nibble currently unused + // High nibble contains GRAPHICS_STATUS Color ForeGroundColor, BackGroundColor; FRAME ForeGroundFrame; diff --git a/sc2/src/libs/graphics/frame.c b/sc2/src/libs/graphics/frame.c index 26efc5267..0cc47e5ee 100644 --- a/sc2/src/libs/graphics/frame.c +++ b/sc2/src/libs/graphics/frame.c @@ -110,8 +110,6 @@ DrawBatch (PRIMITIVE *lpBasePrim, PRIM_LINKS PrimLinks, BatchFlags &= BATCH_SINGLE | BATCH_BUILD_PAGE | BATCH_XFORM; - BatchFlags |= _get_context_flags () & BATCH_CLIP_GRAPHICS; - BatchGraphics (); if (BatchFlags & BATCH_BUILD_PAGE) diff --git a/sc2/src/uqm/intro.c b/sc2/src/uqm/intro.c index 19eee9e1a..1338ccd85 100644 --- a/sc2/src/uqm/intro.c +++ b/sc2/src/uqm/intro.c @@ -281,7 +281,6 @@ Present_DrawMovieFrame (PRESENTATION_INPUT_STATE* pPIS) s.origin.y = 0; s.frame = SetAbsFrameIndex (pPIS->Frame, pPIS->MovieFrame); LockMutex (GraphicsLock); - SetContextClipping (TRUE); DrawStamp (&s); UnlockMutex (GraphicsLock); } @@ -496,7 +495,6 @@ DoPresentation (void *pIS) t.baseline.y = y; if (!pPIS->Batched) LockMutex (GraphicsLock); - SetContextClipping (TRUE); DrawTextEffect (&t, pPIS->TextColor, pPIS->TextBackColor, pPIS->TextEffect); if (!pPIS->Batched) @@ -542,7 +540,6 @@ DoPresentation (void *pIS) } LockMutex (GraphicsLock); - SetContextClipping (TRUE); for (i = 0; i < pPIS->LinesCount; ++i) DrawTextEffect (pPIS->TextLines + i, pPIS->TextFadeColor, pPIS->TextFadeColor, pPIS->TextEffect); @@ -565,7 +562,6 @@ DoPresentation (void *pIS) Present_UnbatchGraphics (pPIS, TRUE); LockMutex (GraphicsLock); - SetContextClipping (TRUE); /* do transition */ SetTransitionSource (&pPIS->tfade_r); BatchGraphics (); @@ -659,7 +655,6 @@ DoPresentation (void *pIS) LockMutex (GraphicsLock); old_mode = SetGraphicScaleMode (scale_mode); old_scale = SetGraphicScale (scale); - SetContextClipping (TRUE); DrawStamp (&s); SetGraphicScale (old_scale); SetGraphicScaleMode (old_mode); diff --git a/sc2/src/uqm/planets/lander.c b/sc2/src/uqm/planets/lander.c index 74b29167d..70ca08f9c 100644 --- a/sc2/src/uqm/planets/lander.c +++ b/sc2/src/uqm/planets/lander.c @@ -1486,7 +1486,6 @@ InitPlanetSide (POINT pt) r.extent.width = SURFACE_WIDTH; r.extent.height = SURFACE_HEIGHT; SetContextClipRect (&r); - SetContextClipping (TRUE); SetTransitionSource (&r); BatchGraphics (); diff --git a/sc2/src/uqm/planets/plangen.c b/sc2/src/uqm/planets/plangen.c index 9e34628e7..e6b0a7939 100644 --- a/sc2/src/uqm/planets/plangen.c +++ b/sc2/src/uqm/planets/plangen.c @@ -134,7 +134,6 @@ RenderTopography (FRAME DstFrame, BYTE *pTopoData, int w, int h) OldHot = SetFrameHot (DstFrame, MAKE_HOT_SPOT (0, 0)); GetContextClipRect (&ClipRect); SetContextClipRect (NULL); - SetContextClipping (FALSE); pBatch = &BatchArray[0]; for (i = 0; i < NUM_BATCH_POINTS; ++i, ++pBatch) @@ -201,7 +200,6 @@ RenderTopography (FRAME DstFrame, BYTE *pTopoData, int w, int h) DrawBatch (BatchArray, i, 0); } - SetContextClipping (TRUE); SetContextClipRect (&ClipRect); SetFrameHot (DstFrame, OldHot); } diff --git a/sc2/src/uqm/planets/report.c b/sc2/src/uqm/planets/report.c index b8aef7e89..9fc74180a 100644 --- a/sc2/src/uqm/planets/report.c +++ b/sc2/src/uqm/planets/report.c @@ -57,7 +57,6 @@ ClearReportArea (void) SetContextBackGroundColor (BLACK_COLOR); ClearDrawable (); - SetContextClipping (FALSE); SetContextForeGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x00, 0x07, 0x00), 0x57)); @@ -78,8 +77,6 @@ ClearReportArea (void) s.origin.y += r.extent.height + 1; } - SetContextClipping (TRUE); - UnbatchGraphics (); }