Example #1
0
void Select_ShiftTexture(int x, int y)
{
	brush_t		*b;
	face_t		*f;

	if(selected_brushes.next == &selected_brushes && selected_face == NULL)
		return;

  for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
	{
		for (f=b->brush_faces ; f ; f=f->next)
		{
			f->texdef.shift[0] += x;
			f->texdef.shift[1] += y;
		}
		Brush_Build(b);
    if (b->patchBrush)
      Patch_ShiftTexture(b->nPatchID, x, y);
	}

	if (selected_face)
	{
		selected_face->texdef.shift[0] += x;
		selected_face->texdef.shift[1] += y;
		Brush_Build(selected_face_brush);
	}

	Sys_UpdateWindows (W_CAMERA);
}
Example #2
0
void Select_ShiftTexture( int x, int y )
{
	brush_s*        b;
	face_s*     f;
	
	int nFaceCount = g_ptrSelectedFaces.GetSize();
	
	if ( selected_brushes.next == &selected_brushes && nFaceCount == 0 )
		return;
		
	for ( b = selected_brushes.next ; b != &selected_brushes ; b = b->next )
	{
		for ( f = b->brush_faces ; f ; f = f->next )
		{
			if ( g_qeglobals.m_bBrushPrimitMode )
			{
				// use face normal to compute a true translation
				Select_ShiftTexture_BrushPrimit( f, x, y );
			}
			else
			{
				f->texdef.shift[0] += x;
				f->texdef.shift[1] += y;
			}
		}
		Brush_Build( b );
		if ( b->patchBrush )
		{
			//Patch_ShiftTexture(b->nPatchID, x, y);
			Patch_ShiftTexture( b->pPatch, x, y );
		}
	}
	
	if ( nFaceCount > 0 )
	{
		for ( int i = 0; i < nFaceCount; i++ )
		{
			face_s* selFace = reinterpret_cast<face_s*>( g_ptrSelectedFaces.GetAt( i ) );
			brush_s* selBrush = reinterpret_cast<brush_s*>( g_ptrSelectedFaceBrushes.GetAt( i ) );
			if ( g_qeglobals.m_bBrushPrimitMode )
			{
			
				// use face normal to compute a true translation
				// Select_ShiftTexture_BrushPrimit( selected_face, x, y );
				// use camera view to compute texture shift
				g_pParentWnd->GetCamera()->ShiftTexture_BrushPrimit( selFace, x, y );
			}
			else
			{
				selFace->texdef.shift[0] += x;
				selFace->texdef.shift[1] += y;
			}
			Brush_Build( selBrush );
		}
	}
	
	Sys_UpdateWindows( W_CAMERA );
}