#include "stdafx.h"
#include <gtk/gtk.h>
+#include <glib/gi18n.h>
#include <assert.h>
#include <GL/gl.h>
// =============================================================================
// global functions
-// this is disabled, and broken
-// http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=394
-#if 0
+
void WXY_Print ()
{
- long width, height;
- width = g_pParentWnd->ActiveXY()->Width();
- height = g_pParentWnd->ActiveXY()->Height();
+ const long width = g_pParentWnd->ActiveXY()->Width();
+ const long height = g_pParentWnd->ActiveXY()->Height();
unsigned char* img;
const char* filename;
- filename = file_dialog (g_pParentWnd->m_pWidget, FALSE, "Save Image", NULL, FILTER_BMP);
+ filename = file_dialog (g_pParentWnd->m_pWidget, FALSE, _("Save BMP Image"), NULL, "bmp");
if (!filename)
return;
img = (unsigned char*)malloc (width*height*3);
qglReadPixels (0,0,width,height,GL_RGB,GL_UNSIGNED_BYTE,img);
- FILE *fp;
+ FILE *fp;
fp = fopen(filename, "wb");
if (fp)
{
unsigned long widthDW = (((width*24) + 31) / 32 * 4);
long row, row_size = width*3;
- for (row = 0; row < height; row++)
+ for (row = 0; row < height; row++)
{
unsigned char* buf = img+row*row_size;
putc(buf[col+1], fp);
putc(buf[col], fp);
}
- byteswritten += row_size;
+ byteswritten += row_size;
unsigned long count;
for (count = row_size; count < widthDW; count++)
free (img);
}
-#endif
float ptSum(vec3_t pt)
{
void CleanList(brush_t* pList)
{
- brush_t* pBrush = pList->next;
+ brush_t* pBrush = pList->next;
while (pBrush != NULL && pBrush != pList)
{
brush_t* pNext = pBrush->next;
void Brush_CopyList (brush_t* pFrom, brush_t* pTo)
{
- brush_t* pBrush = pFrom->next;
+ brush_t* pBrush = pFrom->next;
while (pBrush != NULL && pBrush != pFrom)
{
brush_t* pNext = pBrush->next;
{
return;
}
-
+
num_entities = 0;
for (te = entities.next ; te != &entities && num_entities != MAX_MAP_ENTITIES ; te = te->next)
{
num_entities++;
}
}
-
+
for (se = entities.next ; se != &entities ; se = se->next)
{
psz = ValueForKey(se, "targetname");
-
+
if (psz == NULL || psz[0] == '\0')
continue;
-
+
sb = se->brushes.onext;
if (sb == &se->brushes)
continue;
-
+
for (k=0 ; k<num_entities ; k++)
{
if (strcmp (ent_target[k], psz))
continue;
-
+
te = ent_entity[k];
tb = te->brushes.onext;
if (tb == &te->brushes)
continue;
-
+
for (i=0 ; i<3 ; i++)
- mid[i] = (sb->mins[i] + sb->maxs[i])*0.5;
-
+ mid[i] = (sb->mins[i] + sb->maxs[i])*0.5;
+
for (i=0 ; i<3 ; i++)
- mid1[i] = (tb->mins[i] + tb->maxs[i])*0.5;
-
+ mid1[i] = (tb->mins[i] + tb->maxs[i])*0.5;
+
VectorSubtract (mid1, mid, dir);
len = VectorNormalize (dir, dir);
s1[0] = -dir[1]*8 + dir[0]*8;
s2[0] = dir[1]*8 + dir[0]*8;
s1[1] = dir[0]*8 + dir[1]*8;
s2[1] = -dir[0]*8 + dir[1]*8;
-
+
qglColor3f (se->eclass->color[0], se->eclass->color[1], se->eclass->color[2]);
-
+
qglBegin(GL_LINES);
qglVertex3fv(mid);
qglVertex3fv(mid1);
-
+
arrows = (int)(len / 256) + 1;
-
+
for (i=0 ; i<arrows ; i++)
{
f = len * (i + 0.5) / arrows;
-
+
for (j=0 ; j<3 ; j++)
mid1[j] = mid[j] + f*dir[j];
qglVertex3fv (mid1);
qglVertex3fv (mid1);
qglVertex3f (mid1[0] + s2[0], mid1[1] + s2[1], mid1[2]);
}
-
+
qglEnd();
}
}
m_vOrigin[2] = org[2];
}
-void XYWnd::OnSize(int cx, int cy)
+void XYWnd::OnSize(int cx, int cy)
{
m_nWidth = cx;
m_nHeight = cy;
pList = (!g_bSwitch) ? &g_brFrontSplits : &g_brBackSplits;
else
pList = (g_bSwitch) ? &g_brFrontSplits : &g_brBackSplits;
-
+
if (pList->next != pList)
{
Brush_CopyList(pList, &hold_brushes);
CleanList(&g_brBackSplits);
g_brFrontSplits.next = &g_brFrontSplits;
g_brBackSplits.next = &g_brBackSplits;
-
+
// ydnar: set clipper points based on first selected patch mesh
if( selected_brushes.next != &selected_brushes )
{
break;
}
}
-
+
if( found )
{
// SetClipMode( true );
g_nPointCount = 0;
}
-void XYWnd::SetViewType(int n)
-{
- m_nViewType = n;
+void XYWnd::SetViewType(int n)
+{
+ m_nViewType = n;
if (g_pParentWnd->CurrentStyle() == MainFrame::eFloating)
{
char* str = "YZ Side";
Select_GetTrueMid(g_vRotateOrigin);
g_vRotation[0] = g_vRotation[1] = g_vRotation[2] = 0.0;
}
- else
+ else
{
if (bMode)
Sys_Printf("Need a brush selected to turn on Mouse Rotation mode\n");
xor_rectangle.set(rectangle);
}
-void XYWnd::OnMouseMove(guint32 nFlags, int pointx, int pointy)
+void XYWnd::OnMouseMove(guint32 nFlags, int pointx, int pointy)
{
// plugin entities
// TODO TTimo handle return code
g_strStatus.Format("x:: %.1f y:: %.1f z:: %.1f", tdp[0], tdp[1], tdp[2]);
g_pParentWnd->SetStatusText(1, g_strStatus);
- // i need to generalize the point code.. having 3 flavors pretty much sucks..
- // once the new curve stuff looks like it is going to stick i will
- // rationalize this down to a single interface..
+ // i need to generalize the point code.. having 3 flavors pretty much sucks..
+ // once the new curve stuff looks like it is going to stick i will
+ // rationalize this down to a single interface..
if (PointMode())
{
if (g_pMovingPoint && HasCapture ())
XY_MouseMoved (pointx, m_nHeight - 1 - pointy , nFlags);
}
}
- else
+ else
{
XY_MouseMoved (pointx, m_nHeight - 1 - pointy , nFlags);
}
g_pParentWnd->OnTimer ();
}
-void XYWnd::OnTimer ()
+void XYWnd::OnTimer ()
{
int nDim1 = (m_nViewType == YZ) ? 1 : 0;
int nDim2 = (m_nViewType == XY) ? 1 : 2;
XY_MouseMoved (m_ptDragX, m_nHeight - 1 - m_ptDragY , m_nScrollFlags);
}
-void XYWnd::OnLButtonDown(guint32 flags, int pointx, int pointy)
+void XYWnd::OnLButtonDown(guint32 flags, int pointx, int pointy)
{
g_pParentWnd->SetActiveXY(this);
UndoCopy();
OriginalButtonDown(flags, pointx, pointy);
}
-void XYWnd::OnRButtonDown(guint32 flags, int pointx, int pointy)
+void XYWnd::OnRButtonDown(guint32 flags, int pointx, int pointy)
{
g_pParentWnd->SetActiveXY(this);
m_ptDownX = pointx;
m_ptDownY = pointy;
m_bRButtonDown = true;
- if (g_PrefsDlg.m_nMouseButtons == 3) // 3 button mouse
+ if (g_PrefsDlg.m_nMouseButtons == 3) // 3 button mouse
{
if (flags & MK_CONTROL)
{
VectorClear(point);
XY_ToPoint (x, y, point);
-
+
VectorCopy (point, origin);
VectorClear (dir);
{
origin[2] = g_MaxWorldCoord;
dir[2] = -1;
- right[0] = 1 / m_fScale;
- right[1] = 0;
+ right[0] = 1 / m_fScale;
+ right[1] = 0;
right[2] = 0;
- up[0] = 0;
+ up[0] = 0;
up[1] = 1 / m_fScale;
up[2] = 0;
}
- else if (m_nViewType == XZ)
+ else if (m_nViewType == XZ)
{
origin[1] = g_MinWorldCoord; // view facing dir = positive Y
dir[1] = 1;
right[0] = 1 / m_fScale;
right[1] = 0;
- right[2] = 0;
+ right[2] = 0;
up[0] = 0;
up[1] = 0;
up[2] = 1 / m_fScale;
origin[0] = g_MaxWorldCoord;
dir[0] = -1;
right[0] = 0;
- right[1] = 1 / m_fScale;
- right[2] = 0;
+ right[1] = 1 / m_fScale;
+ right[2] = 0;
up[0] = 0;
up[1] = 0;
up[2] = 1 / m_fScale;
|| (buttons == (MK_LBUTTON | MK_SHIFT))
|| (buttons == (MK_LBUTTON | MK_CONTROL))
|| (buttons == (MK_LBUTTON | MK_CONTROL | MK_SHIFT)) )
- {
+ {
Patch_SetView( (m_nViewType == XY) ? W_XY : (m_nViewType == YZ) ? W_YZ : W_XZ);
Drag_Begin (x, y, buttons, right, up, origin, dir);
return;
// control mbutton = move camera
if (m_nButtonstate == (MK_CONTROL|nMouseButton) )
- {
+ {
VectorCopyXY(point, g_pParentWnd->GetCamWnd()->Camera()->origin);
Sys_UpdateWindows (W_CAMERA|W_XY_OVERLAY);
}
// mbutton = angle camera
if ((g_PrefsDlg.m_nMouseButtons == 3 && m_nButtonstate == MK_MBUTTON) ||
(g_PrefsDlg.m_nMouseButtons == 2 && m_nButtonstate == (MK_SHIFT|MK_CONTROL|MK_RBUTTON)))
- {
+ {
VectorSubtract (point, g_pParentWnd->GetCamWnd()->Camera()->origin, point);
int n1 = (m_nViewType == XY) ? 1 : 2;
for (i=0 ; i<3 ; i++)
{
delta[i] = xvec[i] * (x - m_nPressx) + yvec[i] * (y - m_nPressy);
- if (!g_PrefsDlg.m_bNoClamp)
+ if (g_PrefsDlg.m_bSnap)
{
delta[i] = floor(delta[i] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
}
*/
create_menu_item_with_mnemonic (menu, "Ungroup Entity",
GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_UNGROUPENTITY);
-
+
create_menu_item_with_mnemonic (menu, "Move into entity",
GTK_SIGNAL_FUNC (HandleCommand), ID_SELECTION_MERGE);
create_menu_item_with_mnemonic (menu, "Move into worldspawn",
submenu_root = NULL;
}
strActive = strLeft;
-
+
submenu = gtk_menu_new ();
submenu_root = submenu;
item = gtk_menu_item_new_with_label (strName);
submenu_root = NULL;
}
strActive = "";
-
+
item = gtk_menu_item_new_with_label (strName);
gtk_signal_connect (GTK_OBJECT (item), "activate", GTK_SIGNAL_FUNC (HandleCommand),
GINT_TO_POINTER (nID++));
// delete the current selection
if (selected_brushes.next != &selected_brushes)
Brush_Free (selected_brushes.next);
-
+
SnapToPoint (m_nPressx, m_nPressy, mins);
int nDim = (m_nViewType == XY) ? 2 : (m_nViewType == YZ) ? 0 : 1;
g_pParentWnd->OnViewZoomout ();
else
g_pParentWnd->OnViewZoomin ();
-
+
Sys_SetCursorPos (m_ptCursorX, m_ptCursorY);
}
}
g_Clip1.m_ptScreenX = pointx;
g_Clip1.m_ptScreenY = pointy;
}
- else
+ else
if (g_Clip2.Set() == false)
{
pPt = g_Clip2;
g_Clip2.m_ptScreenX = pointx;
g_Clip2.m_ptScreenY = pointy;
}
- else
+ else
if (g_Clip3.Set() == false)
{
pPt = g_Clip3;
g_Clip3.m_ptScreenX = pointx;
g_Clip3.m_ptScreenY = pointy;
}
- else
+ else
{
RetainClipMode(true);
pPt = g_Clip1;
int n = (g_pParentWnd->ActiveXY()->GetViewType() == XY) ? 2 : (g_pParentWnd->ActiveXY()->GetViewType() == YZ) ? 0 : 1;
int x = (n == 0) ? 1 : 0;
int y = (n == 2) ? 1 : 2;
-
+
if (n == 1) // on viewtype XZ, flip clip points
{
planepts[0][n] = pBrush->maxs[n];
{
bool bCaulk = false;
int nFlags;
-
+
if (AnyPatchesSelected())
{
Sys_Printf("Deselecting patches for clip operation.\n");
// ydnar: update the window if any patches are selected
Sys_UpdateWindows( XY | W_CAMERA_IFON );
}
-
+
CleanList(&g_brFrontSplits);
CleanList(&g_brBackSplits);
g_brFrontSplits.next = &g_brFrontSplits;
{
brush_t* pFront = NULL;
brush_t* pBack = NULL;
-
+
face_t face;
memset(&face,0,sizeof(face_t));
PlanePointsFromClipPoints(face.planepts, pBrush);
Brush_AddToList(pBack, &g_brBackSplits);
if (pFront)
Brush_AddToList(pFront, &g_brFrontSplits);
-
+
}
}
}
void XYWnd::SnapToPoint (int x, int y, vec3_t point)
{
- if (g_PrefsDlg.m_bNoClamp)
+ if (g_PrefsDlg.m_bSnap)
{
- XY_ToPoint(x, y, point);
+ XY_ToGridPoint(x, y, point);
}
else
{
- XY_ToGridPoint(x, y, point);
+ XY_ToPoint(x, y, point);
}
}
if (!g_qeglobals.d_savedinfo.show_axis)
{
qglRasterPos2f ( m_vOrigin[nDim1] - w + 35 / m_fScale, m_vOrigin[nDim2] + h - 20 / m_fScale );
-
+
char cView[20];
if (m_nViewType == XY)
strcpy(cView, "XY Top");
- else
+ else
if (m_nViewType == XZ)
strcpy(cView, "XZ Front");
else
strcpy(cView, "YZ Side");
-
+
gtk_glwidget_print_string(cView);
}
}
qglLineWidth (2);
qglBegin (GL_LINES);
-
+
for (x=xb ; x<=xe ; x+=g_qeglobals.blockSize)
{
qglVertex2f (x, yb);
qglVertex2f (xe, y);
}
}
-
+
qglEnd ();
qglLineWidth (1);
qglVertex3f (x-box,y,0);
qglVertex3f (x+box,y,0);
qglEnd ();
-
+
qglBegin(GL_LINE_STRIP);
qglVertex3f (x+fov*cos(a+Q_PI/4), y+fov*sin(a+Q_PI/4), 0);
qglVertex3f (x, y, 0);
}
}
-// can be greatly simplified but per usual i am in a hurry
+// can be greatly simplified but per usual i am in a hurry
// which is not an excuse, just a fact
void XYWnd::PaintSizeInfo(int nDim1, int nDim2, vec3_t vMinBounds, vec3_t vMaxBounds)
{
vec3_t vSize;
VectorSubtract(vMaxBounds, vMinBounds, vSize);
- qglColor3f(g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][0] * .65,
+ qglColor3f(g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][0] * .65,
g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][1] * .65,
g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][2] * .65);
qglVertex3f(vMaxBounds[nDim1], vMinBounds[nDim2] - 6.0f / m_fScale, 0.0f);
qglVertex3f(vMaxBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale, 0.0f);
-
+
qglVertex3f(vMaxBounds[nDim1] + 6.0f / m_fScale, vMinBounds[nDim2], 0.0f);
qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, vMinBounds[nDim2], 0.0f);
qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, vMinBounds[nDim2], 0.0f);
qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, vMaxBounds[nDim2], 0.0f);
-
+
qglVertex3f(vMaxBounds[nDim1] + 6.0f / m_fScale, vMaxBounds[nDim2], 0.0f);
qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, vMaxBounds[nDim2], 0.0f);
qglRasterPos3f (Betwixt(vMinBounds[nDim1], vMaxBounds[nDim1]), vMinBounds[nDim2] - 20.0 / m_fScale, 0.0f);
g_strDim.Format(g_pDimStrings[nDim1], vSize[nDim1]);
gtk_glwidget_print_string((char *) g_strDim.GetBuffer());
-
+
qglRasterPos3f (vMaxBounds[nDim1] + 16.0 / m_fScale, Betwixt(vMinBounds[nDim2], vMaxBounds[nDim2]), 0.0f);
g_strDim.Format(g_pDimStrings[nDim2], vSize[nDim2]);
gtk_glwidget_print_string((char *) g_strDim.GetBuffer());
qglVertex3f(vMaxBounds[nDim1], 0,vMinBounds[nDim2] - 6.0f / m_fScale);
qglVertex3f(vMaxBounds[nDim1], 0,vMinBounds[nDim2] - 10.0f / m_fScale);
-
+
qglVertex3f(vMaxBounds[nDim1] + 6.0f / m_fScale, 0,vMinBounds[nDim2]);
qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, 0,vMinBounds[nDim2]);
qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, 0,vMinBounds[nDim2]);
qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, 0,vMaxBounds[nDim2]);
-
+
qglVertex3f(vMaxBounds[nDim1] + 6.0f / m_fScale, 0,vMaxBounds[nDim2]);
qglVertex3f(vMaxBounds[nDim1] + 10.0f / m_fScale, 0,vMaxBounds[nDim2]);
qglRasterPos3f (Betwixt(vMinBounds[nDim1], vMaxBounds[nDim1]), 0, vMinBounds[nDim2] - 20.0 / m_fScale);
g_strDim.Format(g_pDimStrings[nDim1], vSize[nDim1]);
gtk_glwidget_print_string((char *) g_strDim.GetBuffer());
-
+
qglRasterPos3f (vMaxBounds[nDim1] + 16.0 / m_fScale, 0, Betwixt(vMinBounds[nDim2], vMaxBounds[nDim2]));
g_strDim.Format(g_pDimStrings[nDim2], vSize[nDim2]);
gtk_glwidget_print_string((char *) g_strDim.GetBuffer());
qglVertex3f(0, vMaxBounds[nDim1], vMinBounds[nDim2] - 6.0f / m_fScale);
qglVertex3f(0, vMaxBounds[nDim1], vMinBounds[nDim2] - 10.0f / m_fScale);
-
+
qglVertex3f(0, vMaxBounds[nDim1] + 6.0f / m_fScale, vMinBounds[nDim2]);
qglVertex3f(0, vMaxBounds[nDim1] + 10.0f / m_fScale, vMinBounds[nDim2]);
qglVertex3f(0, vMaxBounds[nDim1] + 10.0f / m_fScale, vMinBounds[nDim2]);
qglVertex3f(0, vMaxBounds[nDim1] + 10.0f / m_fScale, vMaxBounds[nDim2]);
-
+
qglVertex3f(0, vMaxBounds[nDim1] + 6.0f / m_fScale, vMaxBounds[nDim2]);
qglVertex3f(0, vMaxBounds[nDim1] + 10.0f / m_fScale, vMaxBounds[nDim2]);
qglRasterPos3f (0, Betwixt(vMinBounds[nDim1], vMaxBounds[nDim1]), vMinBounds[nDim2] - 20.0 / m_fScale);
g_strDim.Format(g_pDimStrings[nDim1], vSize[nDim1]);
gtk_glwidget_print_string((char *) g_strDim.GetBuffer());
-
+
qglRasterPos3f (0, vMaxBounds[nDim1] + 16.0 / m_fScale, Betwixt(vMinBounds[nDim2], vMaxBounds[nDim2]));
g_strDim.Format(g_pDimStrings[nDim2], vSize[nDim2]);
gtk_glwidget_print_string((char *) g_strDim.GetBuffer());
if (!active_brushes.next)
return; // not valid yet
- Patch_LODMatchAll(); // spog
+ Patch_LODMatchAll(); // spog
if (m_bTiming)
start = Sys_DoubleTime();
drawn = culled = 0;
e = world_entity;
-
+
if (m_bTiming)
start2 = Sys_DoubleTime();
if (brush->bFiltered)
continue;
- if (brush->mins[nDim1] > maxs[0] ||
- brush->mins[nDim2] > maxs[1] ||
- brush->maxs[nDim1] < mins[0] ||
+ if (brush->mins[nDim1] > maxs[0] ||
+ brush->mins[nDim2] > maxs[1] ||
+ brush->maxs[nDim1] < mins[0] ||
brush->maxs[nDim2] < mins[1])
{
culled++;
Brush_DrawXY(brush, m_nViewType);
}
-
+
if (m_bTiming)
end2 = Sys_DoubleTime();
for (brush = selected_brushes.next ; brush != &selected_brushes ; brush=brush->next)
{
// spog - added culling of selected brushes in XY window
- if (brush->mins[nDim1] > maxs[0] ||
- brush->mins[nDim2] > maxs[1] ||
- brush->maxs[nDim1] < mins[0] ||
+ if (brush->mins[nDim1] > maxs[0] ||
+ brush->mins[nDim2] > maxs[1] ||
+ brush->maxs[nDim1] < mins[0] ||
brush->maxs[nDim2] < mins[1])
{
culled++;
// edge / vertex flags
if (g_qeglobals.d_select_mode == sel_vertex)
{
- if(!g_PrefsDlg.m_bGlPtWorkaround)
+ if(!g_PrefsDlg.m_bGlPtWorkaround)
{
// brush verts
qglPointSize (4);
for (i=0 ; i<g_qeglobals.d_numpoints ; i++)
qglVertex3fv (g_qeglobals.d_points[i]);
qglEnd ();
-
+
if(g_qeglobals.d_num_move_points)
{
// selected brush verts
for (i=0; i < g_qeglobals.d_numpoints; i++)
DrawAlternatePoint(g_qeglobals.d_points[i], m_fScale);
qglEnd();
-
+
if(g_qeglobals.d_num_move_points)
{
// selected brush verts
else if (g_qeglobals.d_select_mode == sel_edge)
{
float *v1, *v2;
- if(!g_PrefsDlg.m_bGlPtWorkaround)
+ if(!g_PrefsDlg.m_bGlPtWorkaround)
{
qglPointSize (4);
qglColor3f (0,0,1);
return RotateMode() ? false : ScaleMode() ? false : true;
}
-void XYWnd::OnCreate ()
+void XYWnd::OnCreate ()
{
if (!MakeCurrent ())
Error ("glXMakeCurrent failed");
qglRotatef (-90, 0, 1, 0); // put Z going up
qglRotatef (-90, 1, 0, 0); // put Z going up
}
-
+
if (g_bCrossHairs)
{
qglColor4f(0.2f, 0.9f, 0.2f, 0.8f);
}
}
}
-
+
if (PathMode())
{
int n;
brush_t *b;
for( b = selected_brushes.next; b != &selected_brushes; b = b->next )
{
-
+
}
}
Sys_Printf("TODO: hook drop down group menu\n");
return;
}
-
+
if (strItem.Find("Smart_") >= 0)
{
CreateSmartEntity(this, m_ptDownX, m_ptDownY, strItem);
{
CreateRightClickEntity(this, m_ptDownX, m_ptDownY, (char*)strItem.GetBuffer());
}
-
+
Sys_UpdateWindows(W_ALL);
//OnLButtonDown((MK_LBUTTON | MK_SHIFT), CPoint(m_ptDown.x+2, m_ptDown.y+2));
}