29 #include "../../idlib/precompiled.h"
37 #include "../../renderer/tr_local.h"
38 #include "../../renderer/model_local.h"
43 static char THIS_FILE[] = __FILE__;
47 const char *
g_pOrgStrings[] = {
"(x:%.f y:%.f)",
"(x:%.f z:%.f)",
"(y:%.f z:%.f)" };
126 #define MAX_DRAG_POINTS 128
129 static CDragPoint *activeDrag =
NULL;
130 static bool activeDragging =
false;
136 bool CDragPoint::PointWithin(
idVec3 p,
int nView) {
138 if (
fDiff(p[0], vec[0]) <= 3 &&
fDiff(p[1], vec[1]) <= 3 &&
fDiff(p[2], vec[2]) <= 3) {
143 int nDim1 = (nView == YZ) ? 1 : 0;
144 int nDim2 = (nView == XY) ? 1 : 2;
145 if (
fDiff(p[nDim1], vec[nDim1]) <= 3 &&
fDiff(p[nDim2], vec[nDim2]) <= 3) {
161 CDragPoint *drag =
NULL;
162 CDragPoint *priority =
NULL;
167 bestd = 12 / scale / 2;
170 for (i = 0; i <
count; i++) {
171 drag = reinterpret_cast < CDragPoint * > (
dragPoints[
i]);
172 temp = drag->vec - org;
174 temp = org + d * dir;
175 temp = drag->vec - temp;
180 if (priority ==
NULL) {
181 priority = reinterpret_cast < CDragPoint * > (
dragPoints[besti]);
182 if (!priority->priority) {
193 drag = reinterpret_cast < CDragPoint * > (
dragPoints[besti]);
194 if (priority && !drag->priority) {
214 int count = ptr.GetSize();
216 if (b == reinterpret_cast < CDragPoint * > ( ptr.GetAt(
i))->pBrush ) {
231 dragPoints.Add(
new CDragPoint(b, v, type, priority));
241 CDragPoint *drag = reinterpret_cast < CDragPoint * > (
dragPoints.GetAt(
i));
242 if (b == drag->pBrush && type == drag->nType) {
257 if ((vec[0] == 0) && (vec[1] == 0)) {
267 yaw =
RAD2DEG( atan2(vec[1], vec[0]) );
273 pitch =
RAD2DEG( atan2(vec[2], forward) );
292 v.
x = floor(v.
x / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
293 v.
y = floor(v.
y / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
294 v.
z = floor(v.
z / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
304 double angle, dist, d,
len;
308 newtarget = target + delta;
318 double dp = target * newtarget;
319 double dv = dp /
len;
324 cross = target.
Cross( newtarget );
327 if (cross[0] || cross[1] || cross[2]) {
346 dist = normal * target;
348 d = (normal * up) - dist;
351 d = (normal *
right) - dist;
381 if (activeDrag->nType == LIGHT_TARGET) {
388 RotateLight(target, up, right, move);
392 SetKeyVec3(activeDrag->pBrush->owner,
"light_target", target);
393 SetKeyVec3(activeDrag->pBrush->owner,
"light_up", up);
394 SetKeyVec3(activeDrag->pBrush->owner,
"light_right", right);
395 target += (activeDrag->pBrush->trackLightOrigin) ? activeDrag->pBrush->owner->lightOrigin : activeDrag->pBrush->owner->origin;
402 else if (activeDrag->nType == LIGHT_UP) {
407 SetKeyVec3(activeDrag->pBrush->owner,
"light_up", up);
409 target += (activeDrag->pBrush->trackLightOrigin) ? activeDrag->pBrush->owner->lightOrigin : activeDrag->pBrush->owner->origin;
413 else if (activeDrag->nType == LIGHT_RIGHT) {
418 SetKeyVec3(activeDrag->pBrush->owner,
"light_right", right);
420 target += (activeDrag->pBrush->trackLightOrigin) ? activeDrag->pBrush->owner->lightOrigin : activeDrag->pBrush->owner->origin;
424 else if (activeDrag->nType == LIGHT_START) {
429 SetKeyVec3(activeDrag->pBrush->owner,
"light_start", start);
430 start += (activeDrag->pBrush->trackLightOrigin) ? activeDrag->pBrush->owner->lightOrigin : activeDrag->pBrush->owner->origin;
433 else if (activeDrag->nType == LIGHT_END) {
438 SetKeyVec3(activeDrag->pBrush->owner,
"light_end", end);
439 end += (activeDrag->pBrush->trackLightOrigin) ? activeDrag->pBrush->owner->lightOrigin : activeDrag->pBrush->owner->origin;
442 else if (activeDrag->nType == LIGHT_CENTER) {
447 SetKeyVec3(activeDrag->pBrush->owner,
"light_center", end);
448 end += (activeDrag->pBrush->trackLightOrigin) ? activeDrag->pBrush->owner->lightOrigin : activeDrag->pBrush->owner->origin;
468 for (
int i = 0;
i < numDragPoints;
i++) {
469 if (reinterpret_cast < CDragPoint * > (
dragPoints[
i])->PointWithin(p, nView)) {
470 activeDrag = reinterpret_cast < CDragPoint * > (
dragPoints[
i]);
509 g_pMovingClip =
NULL;
510 g_pMovingPath =
NULL;
532 CMenu *pMenu = reinterpret_cast < CMenu * > (
g_ptrMenus.GetAt(nSize - 1));
534 pMenu->DestroyMenu();
543 BEGIN_MESSAGE_MAP(
CXYWnd, CWnd)
579 HINSTANCE hInstance = AfxGetInstanceHandle();
580 if (::GetClassInfo(hInstance, XY_WINDOW_CLASS, &wc) ==
FALSE) {
582 memset(&wc, 0,
sizeof(wc));
583 wc.style = CS_NOCLOSE;
584 wc.lpszClassName = XY_WINDOW_CLASS;
586 wc.lpfnWndProc = ::DefWindowProc;
587 if (AfxRegisterClass(&wc) ==
FALSE) {
588 Error(
"CCamWnd RegisterClass: failed");
592 cs.lpszClass = XY_WINDOW_CLASS;
593 cs.lpszName =
"VIEW";
594 if (cs.style != QE3_CHILDSTYLE) {
595 cs.style = QE3_SPLITTER_STYLE;
598 return CWnd::PreCreateWindow(cs);
604 static unsigned s_stipple[32] = {
651 DefWindowProc(hWnd, uMsg, wParam, lParam);
656 SendMessage(hWnd, WM_NCACTIVATE, uMsg == WM_SETFOCUS, 0);
664 return DefWindowProc(hWnd, uMsg, wParam, lParam);
671 static void WXY_InitPixelFormat(PIXELFORMATDESCRIPTOR *pPFD) {
672 memset(pPFD, 0,
sizeof(*pPFD));
674 pPFD->nSize =
sizeof(PIXELFORMATDESCRIPTOR);
676 pPFD->dwFlags = PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW;
677 pPFD->iPixelType = PFD_TYPE_RGBA;
678 pPFD->cColorBits = 24;
679 pPFD->cDepthBits = 32;
680 pPFD->iLayerType = PFD_MAIN_PLANE;
693 memset(&pd, 0,
sizeof(pd));
694 pd.lStructSize =
sizeof(pd);
696 pd.Flags = PD_RETURNDC;
698 if (!PrintDlg(&pd) || !pd.hDC) {
699 g_pParentWnd->MessageBox(
"Could not PrintDlg()",
"QE4 Print Error", MB_OK | MB_ICONERROR);
704 memset(&di, 0,
sizeof(di));
705 di.cbSize =
sizeof(di);
706 di.lpszDocName =
"QE4";
707 if (StartDoc(pd.hDC, &di) <= 0) {
708 g_pParentWnd->MessageBox(
"Could not StartDoc()",
"QE4 Print Error", MB_OK | MB_ICONERROR);
713 if (StartPage(pd.hDC) <= 0) {
714 g_pParentWnd->MessageBox(
"Could not StartPage()",
"QE4 Print Error", MB_OK | MB_ICONERROR);
717 int bmwidth = 320, bmheight = 320;
724 bmwidth = r.right - r.left;
725 bmheight = r.bottom - r.top;
727 pwidth = GetDeviceCaps(pd.hDC, PHYSICALWIDTH) - GetDeviceCaps(pd.hDC, PHYSICALOFFSETX);
728 pheight = GetDeviceCaps(pd.hDC, PHYSICALHEIGHT) - GetDeviceCaps(pd.hDC, PHYSICALOFFSETY);
730 StretchBlt(pd.hDC, 0, 0, pwidth, pheight, s_hdcXY, 0, 0, bmwidth, bmheight, SRCCOPY);
734 if (EndPage(pd.hDC) <= 0) {
735 g_pParentWnd->MessageBox(
"QE4 Print Error",
"Could not EndPage()", MB_OK | MB_ICONERROR);
739 if (EndDoc(pd.hDC) <= 0) {
740 g_pParentWnd->MessageBox(
"QE4 Print Error",
"Could not EndDoc()", MB_OK | MB_ICONERROR);
750 if (CWnd::OnCreate(lpCreateStruct) == -1) {
754 s_hdcXY = ::GetDC(GetSafeHwnd());
755 QEW_SetupPixelFormat(s_hdcXY,
false);
767 return pt[0] + pt[1] + pt[2];
783 if (g_Clip1.
Set() ==
false) {
788 else if (g_Clip2.
Set() ==
false) {
793 else if (g_Clip3.
Set() ==
false) {
805 SnapToPoint(point.x, rctZ.Height() - 1 - point.y, *pPt);
808 if ( GetAsyncKeyState(VK_CONTROL) & 0x8000 ) {
811 Select_GetBounds( smins, smaxs );
814 if ( GetAsyncKeyState(VK_SHIFT) & 0x8000 ) {
820 if ( GetAsyncKeyState(VK_SHIFT) & 0x8000 ) {
826 if ( GetAsyncKeyState(VK_SHIFT) & 0x8000 ) {
894 for (i = 0; i <
num; i++) {
904 for (i = 0; i <
num; i++) {
933 return f2 + ((f1 - f2) / 2);
936 return f1 + ((f2 - f1) / 2);
948 if (g_Clip1.
Set() && g_Clip2.
Set()) {
954 if (g_Clip3.
Set() ==
false) {
989 brush_t *pBrush = pList->next;
990 while (pBrush !=
NULL && pBrush != pList) {
991 brush_t *pNext = pBrush->next;
1002 if (AnyPatchesSelected()) {
1003 Sys_Status(
"Deslecting patches for clip operation.\n");
1023 brush_t *pFront =
NULL;
1024 brush_t *pBack =
NULL;
1026 if (g_Clip1.
Set() && g_Clip2.
Set()) {
1031 if (g_Clip3.
Set() ==
false) {
1033 face.planepts[0][2] = pBrush->mins[2];
1034 face.planepts[1][2] = pBrush->mins[2];
1037 face.planepts[2][2] = pBrush->maxs[2];
1040 face.planepts[0][0] = pBrush->mins[0];
1041 face.planepts[1][0] = pBrush->mins[0];
1044 face.planepts[2][0] = pBrush->maxs[0];
1047 face.planepts[0][1] = pBrush->mins[1];
1048 face.planepts[1][1] = pBrush->mins[1];
1051 face.planepts[2][1] = pBrush->maxs[1];
1073 brush_t *pBrush = pFrom->next;
1074 while (pBrush !=
NULL && pBrush != pFrom) {
1075 brush_t *pNext = pBrush->next;
1092 if ((GetAsyncKeyState(VK_CONTROL) & 0x8000)) {
1116 if (g_pMovingClip) {
1118 g_pMovingClip =
NULL;
1141 if ((GetAsyncKeyState(VK_MENU) & 0x8000)) {
1145 if ((GetAsyncKeyState(VK_CONTROL) & 0x8000)) {
1149 if ((GetAsyncKeyState(VK_SHIFT) & 0x8000)) {
1167 GetClientRect(rctZ);
1168 SetWindowPos(&wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
1175 XY_MouseDown(point.x, rctZ.Height() - 1 - point.y, nFlags);
1185 GetClientRect(rctZ);
1186 XY_MouseUp(point.x, rctZ.Height() - 1 - point.y, nFlags);
1187 if (!(nFlags & (MK_LBUTTON | MK_RBUTTON | MK_MBUTTON))) {
1207 GetCapture() ==
this
1209 float fAdjustment = (g_qeglobals.d_gridsize / 8 * 64) /
m_fScale;
1247 bool bCrossHair =
false;
1249 tdp[0] = tdp[1] = tdp[2] = 0.0;
1252 g_strStatus.Format(
"x:: %.1f y:: %.1f z:: %.1f", tdp[0], tdp[1], tdp[2]);
1261 if (g_pMovingPoint && GetCapture() ==
this) {
1268 g_pMovingPoint =
NULL;
1275 fDiff(g_PointPoints[
n].m_ptClip[nDim1], tdp[nDim1]) < 3 &&
1276 fDiff(g_PointPoints[
n].m_ptClip[nDim2], tdp[nDim2]) < 3
1279 g_pMovingPoint = &g_PointPoints[
n];
1285 if (g_pMovingClip && GetCapture() ==
this) {
1291 g_pMovingClip =
NULL;
1295 if (g_Clip1.
Set()) {
1306 if (g_Clip2.
Set()) {
1317 if (g_Clip3.
Set()) {
1329 if (bCrossHair ==
false) {
1334 if (g_pMovingPath && GetCapture() ==
this) {
1340 g_pMovingPath =
NULL;
1347 fDiff(g_PathPoints[
n].m_ptClip[nDim1], tdp[nDim1]) < 3 &&
1348 fDiff(g_PathPoints[
n].m_ptClip[nDim2], tdp[nDim2]) < 3
1351 g_pMovingPath = &g_PathPoints[
n];
1365 SetCursor(::LoadCursor(
NULL, IDC_CROSS));
1368 SetCursor(::LoadCursor(
NULL, IDC_ARROW));
1386 if (bMode ==
true) {
1411 if (g_pMovingClip) {
1413 g_pMovingClip =
NULL;
1474 if (!qwglMakeCurrent(dc.m_hDC,
win32.
hGLRC)) {
1476 common->
Printf(
"Please restart Q3Radiant if the Map view is not working\n");
1481 QE_CheckOpenGLForErrors();
1483 QE_CheckOpenGLForErrors();
1521 qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER].ToFloatPtr());
1523 if (g_Clip1.
Set()) {
1527 if (g_Clip2.
Set()) {
1531 if (g_Clip3.
Set()) {
1539 if (g_Clip1.
Set()) {
1544 qglCallLists(strMsg.GetLength(), GL_UNSIGNED_BYTE, strMsg);
1547 if (g_Clip2.
Set()) {
1552 qglCallLists(strMsg.GetLength(), GL_UNSIGNED_BYTE, strMsg);
1555 if (g_Clip3.
Set()) {
1560 qglCallLists(strMsg.GetLength(), GL_UNSIGNED_BYTE, strMsg);
1568 for (pBrush = pList->next; pBrush !=
NULL && pBrush != pList; pBrush = pBrush->next) {
1573 for (face = pBrush->brush_faces, order = 0; face; face = face->next, order++) {
1593 qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_CLIPPER].ToFloatPtr());
1608 g_PathPoints[n].m_ptClip[0] + 2,
1609 g_PathPoints[n].m_ptClip[1] + 2,
1610 g_PathPoints[n].m_ptClip[2] + 2
1612 strMsg.Format(
"%i", n + 1);
1613 qglCallLists(strMsg.GetLength(), GL_UNSIGNED_BYTE, strMsg);
1621 qwglSwapBuffers(dc.m_hDC);
1622 TRACE(
"XY Paint\n");
1642 if (
stricmp(pName,
"worldspawn") == 0) {
1643 g_pParentWnd->MessageBox(
"Can't create an entity with worldspawn.",
"info", 0);
1649 if ((GetAsyncKeyState(VK_SHIFT) & 0x8000)) {
1656 if (petNew &&
idStr::Icmp(pName,
"light") == 0 ) {
1659 if (rad.
x != 0 && rad.
y != 0 && rad.
z != 0) {
1666 if (petNew ==
NULL) {
1669 if (b->owner !=
world_entity && ((b->owner->eclass->fixedsize && pecNew->fixedsize) || forceFixed)) {
1672 for (
int i = 0;
i < 3;
i++) {
1673 origin[
i] = b->mins[
i] - pecNew->mins[
i];
1679 brush_t *nb =
Brush_Create(mins, maxs, &pecNew->texdef);
1681 nb->owner->eclass = pecNew;
1691 g_pParentWnd->MessageBox(
"Failed to create entity.",
"info", 0);
1701 Select_Brush(petNew->
brushes.onext);
1722 mins[nDim] = g_qeglobals.d_gridsize * ((
int)(g_qeglobals.d_new_brush_bottom[nDim] / g_qeglobals.d_gridsize));
1723 maxs[nDim] = g_qeglobals.d_gridsize * ((
int)(g_qeglobals.d_new_brush_top[nDim] / g_qeglobals.d_gridsize));
1725 if (maxs[nDim] <= mins[nDim]) {
1726 maxs[nDim] = mins[nDim] + g_qeglobals.d_gridsize;
1729 for (i = 0; i < 3; i++) {
1730 if (mins[i] == maxs[i]) {
1734 if (mins[i] > maxs[i]) {
1741 n =
Brush_Create(mins, maxs, &g_qeglobals.d_texturewin.texdef);
1758 Select_GetBounds(min, max);
1762 pWnd->GetClientRect(rctZ);
1786 for (i = 0; i < 3; i++) {
1787 mins[
i] = v[
i] - 16;
1788 maxs[
i] = v[
i] + 16;
1791 n =
Brush_Create(mins, maxs, &g_qeglobals.d_texturewin.texdef);
1813 g_bSmartWaiting =
false;
1823 g_strSmartEntity = pName;
1824 if (g_strSmartEntity.Find(
"Smart_Train") >= 0) {
1825 ShowInfoDialog(
"Select the path of the train by left clicking in XY, YZ and/or XZ views. You can move an already dropped point by grabbing and moving it. When you are finished, press ENTER to accept and create the entity and path(s), press ESC to abandon the creation");
1831 else if (g_strSmartEntity.Find(
"Smart_Monster...") >= 0) {
1836 else if (g_strSmartEntity.Find(
"Smart_Rotating") >= 0) {
1837 g_bSmartWaiting =
true;
1840 while (g_bSmartWaiting) {
1842 if (::PeekMessage(&msg,
NULL, 0, 0, PM_REMOVE)) {
1843 TranslateMessage(&msg);
1844 DispatchMessage(&msg);
1859 Select_Brush(reinterpret_cast < brush_t * > (array.GetAt(0)));
1860 Select_Brush(reinterpret_cast < brush_t * > (array.GetAt(1)));
1874 brush_t *pEntities =
NULL;
1875 if (g_strSmartEntity.Find(
"Smart_Train") >= 0) {
1894 Select_Brush(reinterpret_cast < brush_t * > (array.GetAt(n)));
1895 Select_Brush(reinterpret_cast < brush_t * > (array.GetAt(n + 1)));
1931 m_mnuDrop.GetMenuString(nID, strItem, MF_BYCOMMAND);
1933 if (strItem.CompareNoCase(
"Add to...") == 0) {
1938 common->
Printf(
"TODO: Add to... in CXYWnd::OnEntityCreate\n");
1940 else if (strItem.CompareNoCase(
"Remove") == 0) {
1950 strItem.CompareNoCase(
"Add to...") == 0 ||
1951 strItem.CompareNoCase(
"Remove") == 0 ||
1952 strItem.CompareNoCase(
"Name...") == 0 ||
1953 strItem.CompareNoCase(
"New group...") == 0
1959 if (strItem.Find(
"Smart_") >= 0) {
1974 if ( CWnd::OnCmdMsg( nID, nCode, pExtra, pHandlerInfo ) ) {
1977 return AfxGetMainWnd()->OnCmdMsg( nID, nCode, pExtra, pHandlerInfo );
1980 bool MergeMenu(CMenu * pMenuDestination,
const CMenu * pMenuAdd,
bool bTopLevel )
1983 int iMenuAddItemCount = pMenuAdd->GetMenuItemCount();
1984 int iMenuDestItemCount = pMenuDestination->GetMenuItemCount();
1987 if (iMenuAddItemCount == 0)
1992 if (!bTopLevel && iMenuDestItemCount > 0)
1993 pMenuDestination->AppendMenu(MF_SEPARATOR);
1996 for(
int iLoop = 0; iLoop < iMenuAddItemCount; iLoop++)
1999 CString sMenuAddString;
2000 pMenuAdd->GetMenuString(iLoop, sMenuAddString, MF_BYPOSITION);
2003 CMenu* pSubMenu = pMenuAdd->GetSubMenu(iLoop);
2010 UINT nState = pMenuAdd->GetMenuState(iLoop, MF_BYPOSITION);
2011 UINT nItemID = pMenuAdd->GetMenuItemID(iLoop);
2012 if (pMenuDestination->AppendMenu(nState, nItemID, sMenuAddString))
2015 iMenuDestItemCount++;
2019 TRACE(
"MergeMenu: AppendMenu failed!\n");
2028 int iInsertPosDefault = -1;
2034 ASSERT(sMenuAddString !=
"&?" && sMenuAddString !=
2036 CString csAdd(sMenuAddString);
2038 bool bAdded =
false;
2041 for(
int iLoop1 = 0; iLoop1 < iMenuDestItemCount; iLoop1++ )
2045 pMenuDestination->GetMenuString(iLoop1, sDest, MF_BYPOSITION);
2052 CMenu* pSubMenuDest =
2053 pMenuDestination->GetSubMenu(iLoop1);
2058 if (!
MergeMenu(pSubMenuDest, pSubMenu,
false))
2066 if (iInsertPosDefault == -1 && (sDest ==
"Window"
2067 || sDest ==
"?" || sDest ==
"Help"))
2069 iInsertPosDefault = iLoop1;
2080 if( iInsertPosDefault == -1 )
2082 iInsertPosDefault = pMenuDestination->GetMenuItemCount();
2087 if (!NewPopupMenu.CreatePopupMenu())
2089 TRACE(
"MergeMenu: CreatePopupMenu failed!\n");
2094 if (!
MergeMenu(&NewPopupMenu, pSubMenu,
false))
2098 HMENU hNewMenu = NewPopupMenu.GetSafeHmenu();
2099 if (pMenuDestination->InsertMenu(iInsertPosDefault,
2100 MF_BYPOSITION | MF_POPUP | MF_ENABLED,
2101 (
UINT)hNewMenu, sMenuAddString ))
2104 iMenuDestItemCount++;
2108 TRACE(
"MergeMenu: InsertMenu failed!\n");
2113 NewPopupMenu.Detach();
2134 CMenu *drop =
new CMenu;
2144 const int entitiesOnSubMenu =
false;
2145 if ( entitiesOnSubMenu ) {
2146 pMakeEntityPop =
new CMenu;
2147 pMakeEntityPop->CreateMenu();
2150 CMenu *pChild =
NULL;
2156 for (e = eclass; e; e = e->next) {
2160 int n_ = strName.Find(
"_");
2162 CString strLeft = strName.Left(n_);
2163 CString strRight = strName.Right(strName.GetLength() - n_ - 1);
2164 if (strLeft == strActive) {
2166 pChild->AppendMenu(MF_STRING, nID++, strName);
2170 pMakeEntityPop->AppendMenu (
2172 reinterpret_cast < unsigned int > (pChild->GetSafeHmenu()),
2181 strActive = strLeft;
2183 pChild->CreateMenu();
2184 pChild->AppendMenu(MF_STRING, nID++, strName);
2189 pMakeEntityPop->AppendMenu (
2191 reinterpret_cast < unsigned int > (pChild->GetSafeHmenu()),
2201 pMakeEntityPop->AppendMenu(MF_STRING, nID++, strName);
2207 reinterpret_cast < unsigned int > (pMakeEntityPop->GetSafeHmenu()),
2214 GetCursorPos(&ptMouse);
2215 m_mnuDrop.TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON, ptMouse.x, ptMouse.y,
this);
2290 point[0] = floor(point[0] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
2291 point[1] = floor(point[1] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
2300 point[1] = floor(point[1] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
2301 point[2] = floor(point[2] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
2310 point[0] = floor(point[0] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
2311 point[2] = floor(point[2] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
2341 origin[2] = HUGE_DISTANCE;
2352 origin[0] = HUGE_DISTANCE;
2363 origin[1] = HUGE_DISTANCE;
2384 if (buttons == MK_LBUTTON && activeDrag) {
2385 activeDragging =
true;
2388 activeDragging =
false;
2394 (buttons == MK_LBUTTON) ||
2395 (buttons == (MK_LBUTTON | MK_SHIFT)) ||
2396 (buttons == (MK_LBUTTON | MK_CONTROL)) ||
2397 (buttons == (MK_LBUTTON | MK_CONTROL | MK_SHIFT))
2399 if (g_qeglobals.d_select_mode == sel_addpoint) {
2401 if (g_qeglobals.selectObject) {
2402 g_qeglobals.selectObject->addPoint(point);
2409 Drag_Begin(x, y, buttons, right, up, origin, dir);
2432 if (point[n1] || point[n2]) {
2443 if (g_bPatchBendMode) {
2453 z.origin[0] = point[0];
2454 z.origin[1] = point[1];
2457 z.origin[0] = point[1];
2458 z.origin[1] = point[2];
2461 z.origin[0] = point[0];
2462 z.origin[1] = point[2];
2476 activeDragging =
false;
2477 Drag_MouseUp(buttons);
2483 while (::ShowCursor(
TRUE) < 0)
2492 idVec3 xvec, yvec, delta;
2496 xvec[1] = xvec[2] = 0;
2498 yvec[0] = yvec[2] = 0;
2500 for (i = 0; i < 3; i++) {
2503 delta[
i] = floor(delta[i] / g_qeglobals.d_gridsize + 0.5) * g_qeglobals.d_gridsize;
2511 if (move[0] || move[1] || move[2]) {
2546 mins[nDim] = g_qeglobals.d_gridsize * ((
int)(g_qeglobals.d_new_brush_bottom[nDim] / g_qeglobals.d_gridsize));
2548 maxs[nDim] = g_qeglobals.d_gridsize * ((
int)(g_qeglobals.d_new_brush_top[nDim] / g_qeglobals.d_gridsize));
2549 if (maxs[nDim] <= mins[nDim]) {
2550 maxs[nDim] = mins[nDim] + g_qeglobals.d_gridsize;
2553 for (i = 0; i < 3; i++) {
2554 if (mins[i] == maxs[i]) {
2558 if (mins[i] > maxs[i]) {
2565 n =
Brush_Create(mins, maxs, &g_qeglobals.d_texturewin.texdef);
2572 g_strStatus.Format(
"Size X:: %.1f Y:: %.1f Z:: %.1f", vSize[0], vSize[1], vSize[2]);
2595 ::ShowCursor(
FALSE);
2615 Drag_MouseMoved(x, y, buttons);
2635 if (g_bPatchBendMode) {
2645 z.origin[0] = point[0];
2646 z.origin[1] = point[1];
2649 z.origin[0] = point[1];
2650 z.origin[1] = point[2];
2653 z.origin[0] = point[0];
2654 z.origin[1] = point[2];
2674 if (point[n1] || point[n2]) {
2684 Sys_GetCursorPos(&x, &y);
2687 if ((GetAsyncKeyState(VK_MENU) & 0x8000)) {
2703 else if (*px < *px2) {
2720 ::ShowCursor(
FALSE);
2742 float x,
y, xb, xe, yb, ye;
2746 int startPos =
max ( 64 , g_qeglobals.d_gridsize );
2760 xb = startPos * floor(xb / startPos);
2767 xe = startPos * ceil(xe / startPos);
2774 yb = startPos * floor(yb / startPos);
2781 ye = startPos * ceil(ye / startPos);
2784 qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_GRIDMAJOR].ToFloatPtr());
2786 int stepSize = 64 * 0.1 /
m_fScale;
2787 if (stepSize < 64) {
2788 stepSize =
max ( 64 , g_qeglobals.d_gridsize );
2792 for (i = 1; i < stepSize; i <<= 1) {
2798 if (g_qeglobals.d_showgrid) {
2801 for (x = xb; x <= xe; x += stepSize) {
2806 for (y = yb; y <= ye; y += stepSize) {
2816 g_qeglobals.d_showgrid &&
2817 g_qeglobals.d_gridsize *
m_fScale >= 4 &&
2818 !g_qeglobals.d_savedinfo.colors[COLOR_GRIDMINOR].Compare( g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK] ) ) {
2820 qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_GRIDMINOR].ToFloatPtr());
2823 for (x = xb; x < xe; x += g_qeglobals.d_gridsize) {
2824 if (!((
int)x & (startPos - 1))) {
2832 for (y = yb; y < ye; y += g_qeglobals.d_gridsize) {
2833 if (!((
int)y & (startPos - 1))) {
2873 if (g_qeglobals.d_savedinfo.show_coordinates) {
2875 qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_GRIDTEXT].ToFloatPtr());
2877 float lastRaster = xb;
2879 for (x = xb; x < xe; x += stepSize) {
2885 for (y = yb; y < ye; y += stepSize) {
2892 qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_VIEWNAME].ToFloatPtr());
2899 strcpy(cView,
"XY Top");
2902 strcpy(cView,
"XZ Front");
2905 strcpy(cView,
"YZ Side");
2923 float x,
y, xb, xe, yb, ye;
2938 xb = 1024 * floor(xb / 1024);
2945 xe = 1024 * ceil(xe / 1024);
2952 yb = 1024 * floor(yb / 1024);
2959 ye = 1024 * ceil(ye / 1024);
2962 qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_GRIDBLOCK].ToFloatPtr());
2967 for (x = xb; x <= xe; x += 1024) {
2972 for (y = yb; y <= ye; y += 1024) {
2981 for (x = xb; x < xe; x += 1024) {
2982 for (y = yb; y < ye; y += 1024) {
2984 sprintf(text,
"%i,%i", (
int)floor(x / 1024), (
int)floor(y / 1024));
2997 qglColor4f(color[0], color[1], color[2], color[3]);
3005 qglColor4f(textColor[0], textColor[1], textColor[2], textColor[3]);
3019 x = g_vRotateOrigin[0];
3020 y = g_vRotateOrigin[1];
3023 x = g_vRotateOrigin[1];
3024 y = g_vRotateOrigin[2];
3027 x = g_vRotateOrigin[0];
3028 y = g_vRotateOrigin[2];
3058 const char *
p =
"Rotate Z Axis";
3059 if (g_qeglobals.rotateAxis == 1) {
3060 p =
"Rotate Y Axis";
3061 }
else if (g_qeglobals.rotateAxis == 0) {
3062 p =
"Rotate X Axis";
3065 if (g_qeglobals.flatRotation) {
3066 str += g_qeglobals.flatRotation == 2 ?
" Flat [center] " :
" Flat [ rot origin ] ";
3128 float x =
z.origin[0];
3129 float y =
z.origin[1];
3173 if (pb->hiddenBrush) {
3177 if ( pb->forceVisibile ) {
3197 if (g_qeglobals.d_savedinfo.exclude & (EXCLUDE_CAULK | EXCLUDE_VISPORTALS)) {
3204 f = pb->brush_faces;
3206 if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CAULK) {
3207 if (!strstr(f->texdef.name,
"caulk")) {
3211 if (strstr(f->texdef.name,
"visportal")) {
3219 if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CAULK) {
3226 if (strstr(pb->brush_faces->texdef.name,
"donotenter")) {
3231 if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_HINT) {
3232 if (strstr(pb->brush_faces->texdef.name,
"hint")) {
3237 if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CLIP) {
3238 if (strstr(pb->brush_faces->texdef.name,
"clip")) {
3243 if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_TRIGGERS) {
3244 if (strstr(pb->brush_faces->texdef.name,
"trig")) {
3249 if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_NODRAW) {
3250 if (strstr(pb->brush_faces->texdef.name,
"nodraw")) {
3256 if (strstr(pb->brush_faces->texdef.name,
"skip")) {
3260 if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_DYNAMICS) {
3261 if (pb->modelHandle > 0) {
3263 if ( dynamic_cast<idRenderModelLiquid*>(model) ) {
3269 if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_CURVES) {
3276 if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_WORLD) {
3283 if ( g_qeglobals.d_savedinfo.exclude & EXCLUDE_ENT ) {
3284 return (
idStr::Cmpn( pb->owner->eclass->name,
"func_static", 10 ) != 0 );
3288 if ( g_qeglobals.d_savedinfo.exclude & EXCLUDE_LIGHTS && pb->owner->eclass->nShowFlags & ECLASS_LIGHT ) {
3292 if ( g_qeglobals.d_savedinfo.exclude & EXCLUDE_COMBATNODES && pb->owner->eclass->nShowFlags & ECLASS_COMBATNODE ) {
3296 if ( g_qeglobals.d_savedinfo.exclude & EXCLUDE_PATHS && pb->owner->eclass->nShowFlags & ECLASS_PATH) {
3300 if ( g_qeglobals.d_savedinfo.exclude & EXCLUDE_MODELS && ( pb->owner->eclass->entityModel !=
NULL || pb->modelHandle > 0 ) ) {
3324 const char *ent_target[MAX_MAP_ENTITIES];
3325 entity_t *ent_entity[MAX_MAP_ENTITIES];
3327 if (g_qeglobals.d_savedinfo.exclude & EXCLUDE_PATHS) {
3333 for (
int i = 0; i < 2048; i++) {
3335 ent_target[num_entities] =
ValueForKey(te,
"target");
3337 ent_target[num_entities] =
ValueForKey(te,
va(
"target%i", i));
3339 if (ent_target[num_entities][0]) {
3340 ent_entity[num_entities] = te;
3342 }
else if (i > 16) {
3351 if (psz ==
NULL || psz[0] ==
'\0') {
3360 for (k = 0; k < num_entities; k++) {
3361 if (
strcmp(ent_target[k], psz)) {
3371 mid = sb->owner->origin;
3372 mid1 = tb->owner->origin;
3376 s1[0] = -dir[1] * 8 + dir[0] * 8;
3377 s2[0] = dir[1] * 8 + dir[0] * 8;
3378 s1[1] = dir[0] * 8 + dir[1] * 8;
3379 s2[1] = -dir[0] * 8 + dir[1] * 8;
3387 arrows = (
int)(len / 256) + 1;
3389 for (i = 0; i < arrows; i++) {
3390 f = len * (i + 0.5) / arrows;
3392 mid1 = mid + (f * dir);
3395 qglVertex3f(mid1[0] + s1[0], mid1[1] + s1[1], mid1[2]);
3397 qglVertex3f(mid1[0] + s2[0], mid1[1] + s2[1], mid1[2]);
3418 g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][0] * .65,
3419 g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][1] * .65,
3420 g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES][2] * .65
3559 g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][0],
3560 g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][1],
3561 g_qeglobals.d_savedinfo.colors[COLOR_GRIDBACK][2],
3567 qglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
3584 viewBounds[0].z = -99999;
3585 viewBounds[1].z = 99999;
3611 if ( brush->forceVisibile || ( brush->owner->eclass->nShowFlags & ( ECLASS_LIGHT | ECLASS_PROJECTEDLIGHT ) ) ) {
3612 }
else if ( brush->mins[nDim1] > maxs[0] || brush->mins[nDim2] > maxs[1] || brush->maxs[nDim1] < mins[0] || brush->maxs[nDim2] < mins[1] ) {
3623 if (brush->owner != e && brush->owner) {
3624 qglColor3fv(brush->owner->eclass->color.ToFloatPtr());
3627 qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_BRUSHES].ToFloatPtr());
3636 if (g_qeglobals.d_pointfile_display_list) {
3637 qglCallList(g_qeglobals.d_pointfile_display_list);
3645 if (g_qeglobals.show_blocks) {
3663 g_qeglobals.d_select_translate[0],
3664 g_qeglobals.d_select_translate[1],
3665 g_qeglobals.d_select_translate[2]
3675 qglColor3fv(g_qeglobals.d_savedinfo.colors[COLOR_SELBRUSHES].ToFloatPtr());
3687 vMinBounds[0] = vMinBounds[1] = vMinBounds[2] = 999999.9f;
3688 vMaxBounds[0] = vMaxBounds[1] = vMaxBounds[2] = -999999.9f;
3690 int nSaveDrawn = drawn;
3691 bool bFixedSize =
false;
3697 if (brush->owner->eclass->fixedsize) {
3702 for (i = 0; i < 3; i++) {
3703 if (brush->mins[i] < vMinBounds[i]) {
3704 vMinBounds[
i] = brush->mins[
i];
3707 if (brush->maxs[i] > vMaxBounds[i]) {
3708 vMaxBounds[
i] = brush->maxs[
i];
3726 if (g_qeglobals.d_select_mode == sel_vertex) {
3730 for (i = 0; i < g_qeglobals.d_numpoints; i++) {
3737 else if (g_qeglobals.d_select_mode == sel_edge) {
3743 for (i = 0; i < g_qeglobals.d_numedges; i++) {
3744 v1 = g_qeglobals.d_points[g_qeglobals.d_edges[
i].p1].ToFloatPtr();
3745 v2 = g_qeglobals.d_points[g_qeglobals.d_edges[
i].p2].ToFloatPtr();
3746 qglVertex3f((v1[0] + v2[0]) * 0.5, (v1[1] + v2[1]) * 0.5, (v1[2] + v2[2]) * 0.5);
3753 g_splineList->
draw (static_cast<bool>(g_qeglobals.d_select_mode == sel_editpoint || g_qeglobals.d_select_mode == sel_addpoint));
3762 for (i = 0; i < 100; i++) {
3771 for (i = 0; i < maxage; i++) {
3783 -g_qeglobals.d_select_translate[0],
3784 -g_qeglobals.d_select_translate[1],
3785 -g_qeglobals.d_select_translate[2]
3793 if (g_qeglobals.d_select_mode == sel_area) {
3800 g_qeglobals.d_vAreaTL[nDim1],
3801 g_qeglobals.d_vAreaTL[nDim2],
3802 g_qeglobals.d_vAreaBR[nDim1],
3803 g_qeglobals.d_vAreaBR[nDim2]
3810 g_qeglobals.d_vAreaTL[nDim1],
3811 g_qeglobals.d_vAreaTL[nDim2],
3812 g_qeglobals.d_vAreaBR[nDim1],
3813 g_qeglobals.d_vAreaBR[nDim2]
3859 CWnd::OnSize(nType, cx, cy);
3862 GetClientRect(rect);
3865 InvalidateRect(
NULL,
false);
3888 if (pList->next != pList) {
3955 if (b && b->next != b) {
4000 char *
p =
"YZ Side";
4015 RedrawWindow(
NULL,
NULL, RDW_INVALIDATE | RDW_UPDATENOW);
4044 Select_GetTrueMid(g_vRotateOrigin);
4046 Select_GetMid(g_vRotateOrigin);
4049 Select_InitializeRotation();
4053 Sys_Status(
"Need a brush selected to turn on Mouse Rotation mode\n");
4057 Select_FinalizeRotation();
4088 while (pe !=
NULL && pe != &g_enClipboard) {
4113 g_enClipboard.
next =
n;
4127 int nSize = pList->GetSize();
4128 while (nSize-- > 0) {
4130 if (pEntity == pFind) {
4145 CWaitCursor WaitCursor;
4151 bool bClipped =
false;
4152 UINT nClipboard = ::RegisterClipboardFormat(
"RadiantClippings");
4153 if (nClipboard > 0) {
4154 if (OpenClipboard()) {
4158 HANDLE h = ::GlobalAlloc(GMEM_ZEROINIT | GMEM_MOVEABLE | GMEM_DDESHARE, lSize +
sizeof (
long));
4160 unsigned char *cp = reinterpret_cast <
unsigned char * > (::GlobalLock(h));
4161 memcpy(cp, &lSize,
sizeof (
long));
4162 cp +=
sizeof (long);
4166 ::SetClipboardData(nClipboard, h);
4174 common->
Printf(
"Unable to register Windows clipboard formats, copy/paste between editors will not be possible");
4183 CPtrArray holdArray;
4189 pClone->owner =
NULL;
4193 if (!
OnList(pBrush->owner, &holdArray)) {
4195 holdArray.Add(reinterpret_cast < void * > (e));
4198 for (brush_t * pEB = e->
brushes.onext; pEB != &e->
brushes; pEB = pEB->onext) {
4264 CWaitCursor WaitCursor;
4265 bool bPasted =
false;
4266 UINT nClipboard = ::RegisterClipboardFormat(
"RadiantClippings");
4267 if (nClipboard > 0 && OpenClipboard() && ::IsClipboardFormatAvailable(nClipboard)) {
4268 HANDLE h = ::GetClipboardData(nClipboard);
4272 unsigned char *cp = reinterpret_cast <
unsigned char * > (::GlobalLock(h));
4274 memcpy(&lSize, cp,
sizeof (
long));
4275 cp +=
sizeof (long);
4287 char *pBuffer =
new char[nLen + 1];
4288 memset(pBuffer, 0,
sizeof(pBuffer));
4290 pBuffer[nLen] =
'\0';
4300 char *pBuffer =
new char[nLen + 1];
4302 pBuffer[nLen] =
'\0';
4303 Patch_ReadBuffer(pBuffer,
true);
4315 if (pClone->owner ==
NULL) {
4326 pEntity !=
NULL && pEntity != &g_enClipboard;
4327 pEntity = pEntity->
next
4330 for (brush_t * pEB = pEntity->brushes.onext; pEB != &pEntity->brushes; pEB = pEB->onext) {
4370 if (nIDEvent == 100) {
4404 CWnd::OnNcCalcSize(bCalcValidRects, lpncsp);
4412 CWnd::OnKillFocus(pNewWnd);
4413 SendMessage(WM_NCACTIVATE,
FALSE, 0);
4421 CWnd::OnSetFocus(pOldWnd);
4422 SendMessage(WM_NCACTIVATE,
TRUE, 0);
4456 GetCursorPos(&point);
4486 common->
Printf(
"TODO: Make DrawPrecisionCrosshair work..." );
4512 idVec4 crossEndColor (1.0
f, 0.0
f, 1.0
f, 1.0
f);
4525 crossEndColor[0] = g_qeglobals.d_savedinfo.colors[ COLOR_PRECISION_CROSSHAIR ][0];
4526 crossEndColor[1] = g_qeglobals.d_savedinfo.colors[ COLOR_PRECISION_CROSSHAIR ][1];
4527 crossEndColor[2] = g_qeglobals.d_savedinfo.colors[ COLOR_PRECISION_CROSSHAIR ][2];
4528 crossEndColor[3] = 1.0f;
4530 crossMidColor = crossEndColor;
4533 crossMidColor[ 3 ] = 0.0f;
CMainFrame * g_pParentWnd
bool FilterBrush(brush_t *pb)
CClipPoint * g_pMovingPoint
void UpdateEntitySel(eclass_t *ent)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct)
void SetStatusText(int nPane, const char *pText)
void WINAPI Sys_UpdateWindows(int nBits)
void CyclePrecisionCrosshairMode()
type GetValue(const int index) const
void CleanList(brush_t *pList)
void cross(float a[], float b[], float c[])
afx_msg BOOL OnEraseBkgnd(CDC *pDC)
void DropPathPoint(UINT nFlags, CPoint point)
void ProduceSplits(brush_t **pFront, brush_t **pBack)
afx_msg void OnSize(UINT nType, int cx, int cy)
void ShowInfoDialog(const char *pText)
afx_msg void OnMButtonDown(UINT nFlags, CPoint point)
void SetActiveXY(CXYWnd *p)
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
void _SmartPointDone(bool b, int n)
void Entity_Free(entity_t *e)
CONST PIXELFORMATDESCRIPTOR UINT
afx_msg void OnViewZoomin()
afx_msg void OnSetFocus(CWnd *pOldWnd)
bool OnList(entity_t *pFind, CPtrArray *pList)
const char * g_pDimStrings[]
const float * ToFloatPtr(void) const
#define VectorSubtract(a, b, c)
GLenum GLenum GLenum GLenum GLenum scale
idMat3 Transpose(void) const
afx_msg BOOL OnCmdMsg(UINT nID, int nCode, void *pExtra, AFX_CMDHANDLERINFO *pHandlerInfo)
void PaintSizeInfo(int nDim1, int nDim2, idVec3 vMinBounds, idVec3 vMaxBounds)
bool SetDragPointCursor(idVec3 p, int nView)
void Map_ImportBuffer(char *buf, bool renameEntities)
typedef HANDLE(WINAPI *PFNWGLCREATEBUFFERREGIONARBPROC)(HDC hDC
IMPLEMENT_DYNCREATE(CXYWnd, CWnd)
void GLColoredBoxWithLabel(float x, float y, float size, idVec4 color, const char *text, idVec4 textColor, float xofs, float yofs, float lineSize)
bool MergeMenu(CMenu *pMenuDestination, const CMenu *pMenuAdd, bool bTopLevel)
void Sys_Status(const char *psz, int part)
const char * ValueForKey(entity_t *ent, const char *key)
const char * g_pOrgStrings[]
afx_msg void OnMouseMove(UINT nFlags, CPoint point)
static float Sqrt(float x)
void VectorToAngles(idVec3 vec, idVec3 angles)
void XY_MouseDown(int x, int y, int buttons)
void Brush_Free(brush_t *b, bool bRemoveNode)
afx_msg void OnMButtonUp(UINT nFlags, CPoint point)
CClipPoint * g_pMovingClip
#define VectorAdd(a, b, c)
static const float M_DEG2RAD
GLuint GLuint GLsizei GLenum type
afx_msg void OnSelectMouserotate()
brush_t * CreateEntityBrush(int x, int y, CXYWnd *pWnd)
void NewBrushDrag(int x, int y)
brush_t * Brush_Clone(brush_t *b)
void CreateRightClickEntity(CXYWnd *pWnd, int x, int y, char *pName)
CClipPoint * g_pMovingPath
idVec3 Cross(const idVec3 &a) const
void SetActiveDrag(CDragPoint *p)
void DropClipPoint(UINT nFlags, CPoint point)
LONG WINAPI XYWndProc(HWND, UINT, WPARAM, LPARAM)
#define ID_SELECT_MOUSEROTATE
int Cmpn(const char *text, int n) const
bool SetRotateMode(bool bMode)
void UpdateSelectablePoint(brush_t *b, idVec3 v, int type)
void XY_ToGridPoint(int x, int y, idVec3 &point)
void Brush_Build(brush_t *b, bool bSnap, bool bMarkMap, bool bConvert, bool updateLights)
idCurve_NURBS< idVec2 > * GetNurb()
CMemFile g_PatchClipboard(4096)
int Icmp(const char *text) const
afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR *lpncsp)
virtual void SetOrder(const int i)
void SetKeyValue(entity_t *ent, const char *key, const char *value, bool trackAngles)
void UpdatePatchInspector()
void( PFNPathCallback)(bool, int)
#define qglPolygonStipple
idVec3 region_maxs(MAX_WORLD_COORD, MAX_WORLD_COORD, MAX_WORLD_COORD)
void Error(const char *pFormat,...)
GLfloat GLfloat GLfloat v2
GLuint GLuint GLsizei count
afx_msg void OnKillFocus(CWnd *pNewWnd)
GLdouble GLdouble GLint GLint order
int GetNumPoints(void) const
GLubyte GLubyte GLubyte GLubyte w
idMat3 Brush_RotationMatrix(brush_t *b)
void Brush_SplitBrushByFace(brush_t *in, face_t *f, brush_t **front, brush_t **back)
void Brush_AddToList(brush_t *b, brush_t *list)
idVec3 vec3_origin(0.0f, 0.0f, 0.0f)
bool UpdateActiveDragPoint(const idVec3 &move)
afx_msg void OnLButtonUp(UINT nFlags, CPoint point)
CClipPoint g_PointPoints[512]
static float Fabs(float f)
void AddSelectablePoint(brush_t *b, idVec3 v, int type, bool priority)
void Brush_CopyList(brush_t *pFrom, brush_t *pTo)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point)
void OriginalButtonUp(UINT nFlags, CPoint point)
void SetScaleMode(bool bMode)
CDragPoint * PointRay(const idVec3 &org, const idVec3 &dir, float *dist)
idImageManager * globalImages
bool Select_OnlyModelsSelected()
void HandleKey(UINT nChar, UINT nRepCnt, UINT nFlags, bool bDown=true)
void Redraw(unsigned int nBits)
void OnEntityCreate(unsigned int nID)
virtual type GetCurrentValue(const float time) const
void DrawBrushEntityName(brush_t *b)
bool XY_MouseMoved(int x, int y, int buttons)
void Brush_RemoveFromList(brush_t *b)
entity_t * Entity_Clone(entity_t *e)
typedef HDC(WINAPI *PFNWGLGETCURRENTREADDCARBPROC)(void)
GLubyte GLubyte GLubyte a
void DeleteKey(entity_t *ent, const char *key)
virtual void Printf(const char *fmt,...) id_attribute((format(printf
entity_t * Entity_CopyClone(entity_t *e)
float Betwixt(float f1, float f2)
CInspectorDialog * g_Inspectors
void AcquirePath(int nCount, PFNPathCallback *pFunc)
void RetainClipMode(bool bMode)
const float * ToFloatPtr(void) const
idVec3 Brush_TransformedPoint(brush_t *b, const idVec3 &in)
PFNPathCallback * g_pPathFunc
void ProjectVector(const idVec3 &src, idVec3 &dst) const
void SetMode(int mode, bool updateTabs=true)
afx_msg void OnDropNewmodel()
afx_msg void OnViewZoomout()
void VectorCopyXY(const idVec3 &in, idVec3 &out)
GLfloat GLfloat GLfloat GLfloat v3
int Append(const type &obj)
GLdouble GLdouble GLdouble r
void DrawPrecisionCrosshair()
bool GetVectorForKey(entity_t *ent, const char *key, idVec3 &vec)
void Entity_LinkBrush(entity_t *e, brush_t *b)
void CreateEntityFromName(char *pName, brush_t *pBrush, bool forceFixed, idVec3 min, idVec3 max, idVec3 org)
virtual int AddValue(const float time, const type &value)
CClipPoint g_PathPoints[256]
bool DragDelta(int x, int y, idVec3 &move)
const idMat3 & ToMat3(void) const
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
void SnapToPoint(int x, int y, idVec3 &point)
void ClearSelectablePoints(brush_t *b)
void AddPointPoint(UINT nFlags, idVec3 *pVec)
brush_t * Brush_Create(idVec3 mins, idVec3 maxs, texdef_t *texdef)
afx_msg void OnRButtonDown(UINT nFlags, CPoint point)
idCVar radiant_entityMode("radiant_entityMode","0", CVAR_TOOL|CVAR_ARCHIVE,"")
const char * c_str(void) const
idVec3 region_mins(MIN_WORLD_COORD, MIN_WORLD_COORD, MIN_WORLD_COORD)
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
void SetOrigin(idVec3 org)
idCameraDef * g_splineList
void Brush_DrawXY(brush_t *b, int nViewType, bool bSelected, bool ignoreViewType)
void GL_State(int stateBits)
entity_t * Entity_Create(eclass_t *c, bool forceFixed)
float fDiff(float f1, float f2)
void XY_MouseUp(int x, int y, int buttons)
void XY_ToPoint(int x, int y, idVec3 &point)
void FinishSmartCreation()
void CreateSmartEntity(CXYWnd *pWnd, int x, int y, const char *pName)
char * va(const char *fmt,...)
int GetNumValues(void) const
static float ACos(float a)
brush_t * CreateSmartBrush(idVec3 v)
void SetKeyVec3(entity_t *ent, const char *key, idVec3 v)
afx_msg void OnTimer(UINT nIDEvent)
void Map_SaveSelected(char *fileName)
int m_precisionCrosshairMode
void SetPointMode(bool b)
void SetPointPtr(idVec3 *p)
CMemFile g_Clipboard(4096)
int sprintf(idStr &string, const char *fmt,...)
void OriginalButtonDown(UINT nFlags, CPoint point)
void SetClipMode(bool bMode)
eclass_t * Eclass_ForName(const char *name, bool has_brushes)
afx_msg void OnRButtonUp(UINT nFlags, CPoint point)
void VectorSnapGrid(idVec3 &v)