X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f93ce4dadc287261babbd21a29aae59a8efbed2b..0efe4a985555b3ef65ecfdf66202308ddac26284:/utils/ogl/src/drawn.cpp diff --git a/utils/ogl/src/drawn.cpp b/utils/ogl/src/drawn.cpp index f6d8f33a98..7a41a3eb17 100644 --- a/utils/ogl/src/drawn.cpp +++ b/utils/ogl/src/drawn.cpp @@ -11,6 +11,7 @@ #ifdef __GNUG__ #pragma implementation "drawn.h" +#pragma implementation "drawnp.h" #endif // For compilers that support precompilation, includes "wx.h". @@ -24,9 +25,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #include "basic.h" #include "basicp.h" @@ -432,7 +431,7 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset) if (m_image->m_outlineColours.Member((wxObject *)m_gdiIndex)) { if (m_image->m_outlinePen) - dc.SetPen(m_image->m_outlinePen); + dc.SetPen(* m_image->m_outlinePen); } else { @@ -441,7 +440,7 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset) { wxPen *pen = (wxPen *)node->Data(); if (pen) - dc.SetPen(pen); + dc.SetPen(* pen); } } break; @@ -457,14 +456,14 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset) { wxBrush *br = wxTheBrushList->FindOrCreateBrush(m_image->m_outlinePen->GetColour(), wxSOLID); if (br) - dc.SetBrush(br); + dc.SetBrush(* br); } } else if (m_image->m_fillColours.Member((wxObject *)m_gdiIndex)) { if (m_image->m_fillBrush) { - dc.SetBrush(m_image->m_fillBrush); + dc.SetBrush(* m_image->m_fillBrush); } } else @@ -474,7 +473,7 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset) { wxBrush *brush = (wxBrush *)node->Data(); if (brush) - dc.SetBrush(brush); + dc.SetBrush(* brush); } } break; @@ -486,7 +485,7 @@ void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset) { wxFont *font = (wxFont *)node->Data(); if (font) - dc.SetFont(font); + dc.SetFont(* font); } break; } @@ -608,7 +607,7 @@ void wxOpSetClipping::Do(wxDC& dc, double xoffset, double yoffset) { case DRAWOP_SET_CLIPPING_RECT: { - dc.SetClippingRegion(m_x1 + xoffset, m_y1 + yoffset, m_x2 + xoffset, m_y2 + yoffset); + dc.SetClippingRegion((long)(m_x1 + xoffset), (long)(m_y1 + yoffset), (long)(m_x2 + xoffset), (long)(m_y2 + yoffset)); break; } case DRAWOP_DESTROY_CLIPPING_RECT: @@ -1159,16 +1158,16 @@ void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) wxString hexString = expr->Nth(2)->StringValue(); while (i < m_noPoints) { - buf1[0] = hexString[bufPtr]; - buf1[1] = hexString[bufPtr + 1]; - buf1[2] = hexString[bufPtr + 2]; - buf1[3] = hexString[bufPtr + 3]; + buf1[0] = hexString[(size_t)bufPtr]; + buf1[1] = hexString[(size_t)(bufPtr + 1)]; + buf1[2] = hexString[(size_t)(bufPtr + 2)]; + buf1[3] = hexString[(size_t)(bufPtr + 3)]; buf1[4] = 0; - buf2[0] = hexString[bufPtr + 4]; - buf2[1] = hexString[bufPtr + 5]; - buf2[2] = hexString[bufPtr + 6]; - buf2[3] = hexString[bufPtr + 7]; + buf2[0] = hexString[(size_t)(bufPtr + 4)]; + buf2[1] = hexString[(size_t)(bufPtr + 5)]; + buf2[2] = hexString[(size_t)(bufPtr + 6)]; + buf2[3] = hexString[(size_t)(bufPtr + 7)]; buf2[4] = 0; bufPtr += 8; @@ -1195,7 +1194,7 @@ void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) // Draw an outline using the current operation. bool wxOpPolyDraw::OnDrawOutline(wxDC& dc, double x, double y, double w, double h, double oldW, double oldH) { - dc.SetBrush(wxTRANSPARENT_BRUSH); + dc.SetBrush(* wxTRANSPARENT_BRUSH); // Multiply all points by proportion of new size to old size double x_proportion = (double)(fabs(w/oldW)); @@ -1209,7 +1208,7 @@ bool wxOpPolyDraw::OnDrawOutline(wxDC& dc, double x, double y, double w, double intPoints[i].x = WXROUND (x_proportion * m_points[i].x); intPoints[i].y = WXROUND (y_proportion * m_points[i].y); } - dc.DrawPolygon(n, intPoints, x, y); + dc.DrawPolygon(n, intPoints, (long) x, (long) y); delete[] intPoints; return TRUE; } @@ -1219,7 +1218,7 @@ bool wxOpPolyDraw::GetPerimeterPoint(double x1, double y1, double x2, double y2, double *x3, double *y3, double xOffset, double yOffset, - bool attachmentMode) + int attachmentMode) { int n = m_noPoints; @@ -1227,7 +1226,7 @@ bool wxOpPolyDraw::GetPerimeterPoint(double x1, double y1, // and we would want to connect to a point on that vertical -- // oglFindEndForPolyline can't cope with this (the arrow // gets drawn to the wrong place). - if ((!attachmentMode) && (x1 == x2)) + if ((attachmentMode == ATTACHMENT_MODE_NONE) && (x1 == x2)) { // Look for the point we'd be connecting to. This is // a heuristic...