MCPcopy Create free account
hub / github.com/Meridian59/Meridian59 / Paint

Method Paint

roomedit/source/editcli.cpp:999–1060  ·  view source on GitHub ↗

//////////////////////////////////////////////////////////////// TEditorClient -------------

Source from the content-addressed store, hash-verified

997// -------------
998//
999void TEditorClient::Paint (TDC& dc, bool erase, TRect& rect)
1000{
1001 // Save GDI object and set WAIT cursor
1002 // SELECT_WAIT_CURSOR();
1003
1004 TLayoutWindow::Paint(dc, erase, rect);
1005
1006 // Draw mouse coord.
1007 DrawMouseCoord (dc);
1008
1009 // Set new visible map limits
1010 VisMapMinX = MAPX(rect.left);
1011 VisMapMaxX = MAPX(rect.right);
1012 VisMapMinY = MAPY(rect.bottom); // Vertical axe is reversed!
1013 VisMapMaxY = MAPY(rect.top); // Vertical axe is reversed!
1014
1015 // Draw map
1016 TMapDC ndc (this, dc);
1017 ndc.DrawMap (EditMode, GridScale, GridShown) ;
1018
1019 if (NumThings >= 2)
1020 {
1021 int left = Things[0].xpos;
1022 int top = Things[0].ypos;
1023 int right = Things[1].xpos;
1024 int bottom = Things[1].ypos;
1025#ifndef WINDOWS_SCALING
1026 left = SCREENX(left);
1027 top = SCREENY(top);
1028 right = SCREENX(right);
1029 bottom = SCREENY(bottom);
1030#endif
1031 int oldROP2 = ndc.SetROP2 (R2_XORPEN);
1032 ndc.SetPenColor16 (GetKodObjectColor (Things[0].type));
1033 ndc.Rectangle(left, top, right+1, bottom+1);
1034 ndc.SetROP2 (oldROP2);
1035 }
1036
1037 // Draw selected objects if user isn't dragging
1038 if ( ! DragObject )
1039 {
1040 // Draw selection
1041 if ( Selected != NULL)
1042 HighlightSelection (ndc, EditMode, Selected);
1043
1044 // Draw current selected object
1045 if (CurObject >= 0)
1046 HighlightObject(ndc, EditMode, CurObject, HL_COLOR);
1047 }
1048
1049 // Draw mouse coord.
1050 DrawMouseCoord (dc);
1051
1052 // Restore visible map limits
1053 VisMapMinX = MAPX(0);
1054 VisMapMaxX = MAPX(ScrMaxX);
1055 VisMapMinY = MAPY(ScrMaxY); // Vertical axe is reversed!
1056 VisMapMaxY = MAPY(0); // Vertical axe is reversed!

Callers

nothing calls this directly

Calls 8

PaintFunction · 0.85
GetKodObjectColorFunction · 0.85
HighlightSelectionFunction · 0.85
HighlightObjectFunction · 0.85
DrawMapMethod · 0.80
SetROP2Method · 0.80
SetPenColor16Method · 0.80
RectangleMethod · 0.80

Tested by

no test coverage detected