entity_t and brush_t now converted to idEditorEntity and idEditorBrush

This commit is contained in:
Justin Marshall
2026-05-24 11:33:16 -07:00
parent d6d01e1faf
commit 3242531044
41 changed files with 1598 additions and 1540 deletions
+18 -20
View File
@@ -220,12 +220,12 @@ static void Drag_Setup( int x, int y, int buttons,
if (buttons == (MK_LBUTTON | MK_CONTROL)) {
Sys_Status("Shear dragging face\n");
Brush_SelectFaceForDragging(t.brush, t.face, true);
t.brush->Brush_SelectFaceForDragging(t.face, true);
}
else if (buttons == (MK_LBUTTON | MK_CONTROL | MK_SHIFT)) {
Sys_Status("Sticky dragging brush\n");
for (f = t.brush->brush_faces; f; f = f->next) {
Brush_SelectFaceForDragging(t.brush, f, false);
t.brush->Brush_SelectFaceForDragging(f, false);
}
}
else {
@@ -248,12 +248,12 @@ static void Drag_Setup( int x, int y, int buttons,
// yes, special handling
bool bOK = ( g_PrefsDlg.m_bALTEdge ) ? ( ::GetAsyncKeyState( VK_MENU ) != 0 ) : true;
if (bOK) {
for (brush_t * pBrush = selected_brushes.next; pBrush != &selected_brushes; pBrush = pBrush->next) {
for (idEditorBrush * pBrush = selected_brushes.next; pBrush != &selected_brushes; pBrush = pBrush->next) {
if (buttons & MK_CONTROL) {
Brush_SideSelect(pBrush, origin, dir, true);
pBrush->Brush_SideSelect(origin, dir, true);
}
else {
Brush_SideSelect(pBrush, origin, dir, false);
pBrush->Brush_SideSelect(origin, dir, false);
}
}
}
@@ -265,10 +265,10 @@ static void Drag_Setup( int x, int y, int buttons,
else {
// single select.. trying to drag fixed entities handle themselves and just move
if (buttons & MK_CONTROL) {
Brush_SideSelect(selected_brushes.next, origin, dir, true);
selected_brushes.next->Brush_SideSelect(origin, dir, true);
}
else {
Brush_SideSelect(selected_brushes.next, origin, dir, false);
selected_brushes.next->Brush_SideSelect(origin, dir, false);
}
}
@@ -374,10 +374,7 @@ void Drag_Begin( int x, int y, int buttons,
Sys_Status("Can't change an entity texture\n");
}
else {
Brush_SetTexture
(
t.brush,
&g_qeglobals.d_texturewin.texdef,
t.brush->Brush_SetTexture(&g_qeglobals.d_texturewin.texdef,
&g_qeglobals.d_texturewin.brushprimit_texdef,
false
);
@@ -406,7 +403,7 @@ void Drag_Begin( int x, int y, int buttons,
&g_qeglobals.d_texturewin.texdef,
&g_qeglobals.d_texturewin.brushprimit_texdef
);
Brush_Build(t.brush);
t.brush->Brush_Build();
Sys_UpdateWindows(W_ALL);
}
}
@@ -447,7 +444,7 @@ void Drag_Begin( int x, int y, int buttons,
}
strBuff.Format("%f %f %f", pTex->getColor().x, pTex->getColor().y, pTex->getColor().z);
SetKeyValue(t.brush->owner, "_color", strBuff.GetBuffer(0));
t.brush->owner->SetKeyValue("_color", strBuff.GetBuffer(0));
Sys_UpdateWindows(W_ALL);
}
}
@@ -460,7 +457,7 @@ void Drag_Begin( int x, int y, int buttons,
*/
// strcpy(t.face->texdef.name,g_qeglobals.d_texturewin.texdef.name);
t.face->texdef.SetName(g_qeglobals.d_texturewin.texdef.name);
Brush_Build(t.brush);
t.brush->Brush_Build();
Sys_UpdateWindows(W_ALL);
// }
}
@@ -473,7 +470,8 @@ void Drag_Begin( int x, int y, int buttons,
}
void Brush_GetBounds(brush_t *b, idVec3 &mins, idVec3 &maxs) {
void idEditorBrush::Brush_GetBounds(idVec3 &mins, idVec3 &maxs) {
idEditorBrush *b = this;
int i;
for (i = 0; i < 3; i++) {
@@ -500,7 +498,7 @@ MoveSelection
*/
static void MoveSelection( const idVec3 &orgMove ) {
int i, success;
brush_t *b;
idEditorBrush *b;
CString strStatus;
idVec3 vTemp, vTemp2, end, move;
@@ -601,7 +599,7 @@ static void MoveSelection( const idVec3 &orgMove ) {
if (g_qeglobals.d_select_mode == sel_vertex) {
success = true;
for (b = selected_brushes.next; b != &selected_brushes; b = b->next) {
success &= Brush_MoveVertex(selected_brushes.next, *g_qeglobals.d_move_points[0], move, end, true);
success &= selected_brushes.next->Brush_MoveVertex(*g_qeglobals.d_move_points[0], move, end, true);
}
// if (success)
@@ -625,7 +623,7 @@ static void MoveSelection( const idVec3 &orgMove ) {
for (b = selected_brushes.next; b != &selected_brushes; b = b->next) {
VectorCopy(b->maxs, vTemp);
VectorSubtract(vTemp, b->mins, vTemp);
Brush_Build(b);
b->Brush_Build();
for (i = 0; i < 3; i++) {
if
(
@@ -662,7 +660,7 @@ static void MoveSelection( const idVec3 &orgMove ) {
}
for (b = selected_brushes.next; b != &selected_brushes; b = b->next) {
Brush_Build(b);
b->Brush_Build();
}
}
}
@@ -672,7 +670,7 @@ static void MoveSelection( const idVec3 &orgMove ) {
// necessary because Brush_Build can remove windings
//
for (b = selected_brushes.next; b != &selected_brushes; b = b->next) {
Brush_ResetFaceOriginals(b);
b->Brush_ResetFaceOriginals();
}
Select_Move(move);