当前位置: 首页>>代码示例>>C++>>正文


C++ Brush_Build函数代码示例

本文整理汇总了C++中Brush_Build函数的典型用法代码示例。如果您正苦于以下问题:C++ Brush_Build函数的具体用法?C++ Brush_Build怎么用?C++ Brush_Build使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Brush_Build函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Select_ScaleTexture

void Select_ScaleTexture(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.scale[0] += x;
			f->texdef.scale[1] += y;
		}
		Brush_Build(b);
    if (b->patchBrush)
      Patch_ScaleTexture(b->nPatchID, x, y);
	}

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

	Sys_UpdateWindows (W_CAMERA);
}
开发者ID:Hasimir,项目名称:jedi-outcast-1,代码行数:31,代码来源:select.cpp

示例2: Select_FitTexture

void Select_FitTexture( int nHeight, int nWidth )
{
	brush_s*        b;
	
	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 )
	{
		Brush_FitTexture( b, nHeight, nWidth );
		Brush_Build( b );
	}
	
	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 ) );
			Face_FitTexture( selFace, nHeight, nWidth );
			Brush_Build( selBrush );
		}
	}
	
	Sys_UpdateWindows( W_CAMERA );
}
开发者ID:OnlyTheGhosts,项目名称:OWEngine,代码行数:28,代码来源:Select.cpp

示例3: Select_RotateTexture

void Select_RotateTexture(int amt)
{
	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.rotate += amt;
      f->texdef.rotate = static_cast<int>(f->texdef.rotate) % 360;
		}
		Brush_Build(b);
    if (b->patchBrush)
      Patch_RotateTexture(b->nPatchID, amt);
	}
	
  if (selected_face)
	{
		selected_face->texdef.rotate += amt;
    selected_face->texdef.rotate = static_cast<int>(selected_face->texdef.rotate) % 360;
		Brush_Build(selected_face_brush);
	}

	Sys_UpdateWindows (W_CAMERA);
}
开发者ID:Hasimir,项目名称:jedi-outcast-1,代码行数:29,代码来源:select.cpp

示例4: Select_ShiftTexture

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 );
}
开发者ID:OnlyTheGhosts,项目名称:OWEngine,代码行数:58,代码来源:Select.cpp

示例5: RotateTextures

void RotateTextures(int nAxis, float fDeg, vec3_t vOrigin)
{
	for (brush_t* b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
	{
    for (face_t* f=b->brush_faces ; f ; f=f->next)
		{
      RotateFaceTexture(f, nAxis, fDeg);
      Brush_Build(b, false);
    }
    Brush_Build(b, false);
	}
}
开发者ID:Hasimir,项目名称:jedi-outcast-1,代码行数:12,代码来源:select.cpp

示例6: Select_Ungroup

/*	Turn the currently selected entity back into normal brushes
*/
void  Select_Ungroup (void)
{
	entity_t	*e;
	brush_t		*b;

	e = selected_brushes.next->owner;

	if (!e || e == world_entity || e->eclass->fixedsize)
	{
		Sys_Status ("Not a grouped entity.", 0);
		return;
	}

	for (b=e->brushes.onext ; b != &e->brushes ; b=e->brushes.onext)
	{
		Brush_RemoveFromList (b);
		Brush_AddToList (b, &active_brushes);
		Entity_UnlinkBrush (b);
		Entity_LinkBrush (world_entity, b);
		Brush_Build( b );
		b->owner = world_entity;
	}

	Entity_Free (e);
	Sys_UpdateWindows (W_ALL);
}
开发者ID:Acidburn0zzz,项目名称:KatanaEngine,代码行数:28,代码来源:select.c

示例7: SI_FaceList_FitTexture

void SI_FaceList_FitTexture(texdef_to_face_t* si_texdef_face_list, int nHeight, int nWidth)
{
    texdef_to_face_t* temp_texdef_face_list;
    brushprimit_texdef_t bp;

    if (!si_texdef_face_list)
        return;

    for (temp_texdef_face_list = si_texdef_face_list; temp_texdef_face_list; temp_texdef_face_list = temp_texdef_face_list->next)
    {
        Face_FitTexture(temp_texdef_face_list->face, nHeight, nWidth);
        Brush_Build(temp_texdef_face_list->brush,true,true,false,false);
        // Write changes to our working Texdef list

        if(g_qeglobals.m_bBrushPrimitMode)
        {
            ConvertTexMatWithQTexture(&temp_texdef_face_list->face->brushprimit_texdef, QERApp_Shader_ForName( temp_texdef_face_list->face->texdef.GetName() )->getTexture(), &bp, NULL);
            TexMatToFakeTexCoords(bp.coords, temp_texdef_face_list->face->texdef.shift, &temp_texdef_face_list->face->texdef.rotate, temp_texdef_face_list->face->texdef.scale);
        }
        temp_texdef_face_list->texdef = temp_texdef_face_list->face->texdef;
    }

    Sys_UpdateWindows (W_CAMERA);

}
开发者ID:AEonZR,项目名称:GtkRadiant,代码行数:25,代码来源:surfaceplugin.cpp

示例8: Select_AplyMatrix

void Select_AplyMatrix (void)
{
	brush_t	*b;
	face_t	*f;
	int		i, j;
	vec3_t	temp;

	for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
	{
		for (f=b->brush_faces ; f ; f=f->next)
		{
			for (i=0 ; i<3 ; i++)
			{
				Math_VectorSubtract(f->planepts[i],select_origin, temp);
				for (j=0 ; j<3 ; j++)
					f->planepts[i][j] = Math_DotProduct(temp,select_matrix[j])
						+ select_origin[j];
			}

			if (select_fliporder)
			{
				Math_VectorCopy(f->planepts[0],temp);
				Math_VectorCopy(f->planepts[2],f->planepts[0]);
				Math_VectorCopy(temp,f->planepts[2]);
			}
		}
		Brush_Build( b );
	}
	Sys_UpdateWindows (W_ALL);
}
开发者ID:Acidburn0zzz,项目名称:KatanaEngine,代码行数:30,代码来源:select.c

示例9: FindReplaceTextures

void FindReplaceTextures( const char* pFind, const char* pReplace, bool bSelected, bool bForce )
{
	brush_s* pList = ( bSelected ) ? &selected_brushes : &active_brushes;
	if ( !bSelected )
	{
		Select_Deselect();
	}
	
	for ( brush_s* pBrush = pList->next ; pBrush != pList; pBrush = pBrush->next )
	{
		if ( pBrush->patchBrush )
		{
			Patch_FindReplaceTexture( pBrush, pFind, pReplace, bForce );
		}
		
		for ( face_s* pFace = pBrush->brush_faces; pFace; pFace = pFace->next )
		{
			if ( bForce || strcmpi( pFace->texdef.name, pFind ) == 0 )
			{
				pFace->d_texture = Texture_ForName( pReplace );
				//strcpy(pFace->texdef.name, pReplace);
				pFace->texdef.SetName( pReplace );
			}
		}
		Brush_Build( pBrush );
	}
	Sys_UpdateWindows( W_CAMERA );
}
开发者ID:OnlyTheGhosts,项目名称:OWEngine,代码行数:28,代码来源:Select.cpp

示例10: brush

/*
============
Select_SetTexture
Timo : bFitScale to compute scale on the plane and counteract plane / axial plane snapping
Timo :  brush primitive texturing
        the brushprimit_texdef given must be understood as a qtexture_t width=2 height=2 ( HiRes )
Timo :  texture plugin, added an IPluginTexdef* parameter
        must be casted to an IPluginTexdef!
        if not NULL, get ->Copy() of it into each face or brush ( and remember to hook )
        if NULL, means we have no information, ask for a default
============
*/
void WINAPI Select_SetTexture( texdef_t* texdef, brushprimit_texdef_s* brushprimit_texdef, bool bFitScale, void* pPlugTexdef )
{
	brush_s*    b;
	int nCount = g_ptrSelectedFaces.GetSize();
	if ( nCount > 0 )
	{
		Undo_Start( "set face textures" );
		ASSERT( g_ptrSelectedFaces.GetSize() == g_ptrSelectedFaceBrushes.GetSize() );
		for ( int i = 0; i < nCount; i++ )
		{
			face_s* selFace = reinterpret_cast<face_s*>( g_ptrSelectedFaces.GetAt( i ) );
			brush_s* selBrush = reinterpret_cast<brush_s*>( g_ptrSelectedFaceBrushes.GetAt( i ) );
			Undo_AddBrush( selBrush );
			SetFaceTexdef( selBrush, selFace, texdef, brushprimit_texdef, bFitScale, static_cast<IPluginTexdef*>( pPlugTexdef ) );
			Brush_Build( selBrush, bFitScale );
			Undo_EndBrush( selBrush );
		}
		Undo_End();
	}
	else if ( selected_brushes.next != &selected_brushes )
	{
		Undo_Start( "set brush textures" );
		for ( b = selected_brushes.next ; b != &selected_brushes ; b = b->next )
			if ( !b->owner->eclass->fixedsize )
			{
				Undo_AddBrush( b );
				Brush_SetTexture( b, texdef, brushprimit_texdef, bFitScale, static_cast<IPluginTexdef*>( pPlugTexdef ) );
				Undo_EndBrush( b );
			}
		Undo_End();
	}
	Sys_UpdateWindows( W_ALL );
}
开发者ID:OnlyTheGhosts,项目名称:OWEngine,代码行数:45,代码来源:Select.cpp

示例11: Select_AplyMatrix

void Select_AplyMatrix (bool bSnap)
{
	brush_t	*b;
	face_t	*f;
	int		i, j;
	vec3_t	temp;

	for (b=selected_brushes.next ; b != &selected_brushes ; b=b->next)
	{
    for (f=b->brush_faces ; f ; f=f->next)
	  {
		  for (i=0 ; i<3 ; i++)
			{
			  VectorSubtract (f->planepts[i], select_origin, temp);
				for (j=0 ; j<3 ; j++)
				  f->planepts[i][j] = DotProduct(temp, select_matrix[j]) + select_origin[j];
			}
			if (select_fliporder)
			{
			  VectorCopy (f->planepts[0], temp);
				VectorCopy (f->planepts[2], f->planepts[0]);
				VectorCopy (temp, f->planepts[2]);
			}
    }
		Brush_Build(b, bSnap);
    if (b->patchBrush)
    {
      Patch_ApplyMatrix(b->nPatchID, select_origin, select_matrix);
    }
	}
}
开发者ID:Hasimir,项目名称:jedi-outcast-1,代码行数:31,代码来源:select.cpp

示例12: AddRegionBrushes

/*
 =======================================================================================================================
    AddRegionBrushes a regioned map will have temp walls put up at the region boundary
 =======================================================================================================================
 */
void AddRegionBrushes(void)
{
	idVec3		mins, maxs;
	int			i;
	texdef_t	td;

	if (!region_active) {
		return;
	}

	memset(&td, 0, sizeof(td));
	td = g_qeglobals.d_texturewin.texdef;

	// strcpy (td.name, "REGION");
	td.SetName("textures/REGION");

	const int REGION_WIDTH = 1024;


	mins[0] = region_mins[0] - REGION_WIDTH;
	maxs[0] = region_mins[0] + 1;
	mins[1] = region_mins[1] - REGION_WIDTH;
	maxs[1] = region_maxs[1] + REGION_WIDTH;
	mins[2] = MIN_WORLD_COORD;
	maxs[2] = MAX_WORLD_COORD;
	region_sides[0] = Brush_Create(mins, maxs, &td);


	mins[0] = region_maxs[0] - 1;
	maxs[0] = region_maxs[0] + REGION_WIDTH;
	region_sides[1] = Brush_Create(mins, maxs, &td);

	mins[0] = region_mins[0] - REGION_WIDTH;
	maxs[0] = region_maxs[0] + REGION_WIDTH;
	mins[1] = region_mins[1] - REGION_WIDTH;
	maxs[1] = region_mins[1] + 1;
	region_sides[2] = Brush_Create(mins, maxs, &td);

	mins[1] = region_maxs[1] - 1;
	maxs[1] = region_maxs[1] + REGION_WIDTH;
	region_sides[3] = Brush_Create(mins, maxs, &td);

	mins = region_mins;
	maxs = region_maxs;
	maxs[2] = mins[2] + REGION_WIDTH;
	region_sides[4] = Brush_Create(mins, maxs, &td);

	mins = region_mins;
	maxs = region_maxs;
	mins[2] = maxs[2] - REGION_WIDTH;
	region_sides[5] = Brush_Create(mins, maxs, &td);

	for (i = 0; i < 6; i++) {
		Brush_AddToList(region_sides[i], &selected_brushes);
		Entity_LinkBrush(world_entity, region_sides[i]);
		Brush_Build(region_sides[i]);
	}
}
开发者ID:AreaScout,项目名称:dante-doom3-odroid,代码行数:63,代码来源:EditorMap.cpp

示例13: Brush_SetTexture

void Brush_SetTexture(brush_t *b,texdef_t *texdef)
{
	face_t	*f;

	for (f=b->brush_faces ; f ; f=f->next)
		f->texdef = *texdef;

	Brush_Build(b);
}
开发者ID:Acidburn0zzz,项目名称:KatanaEngine,代码行数:9,代码来源:brush.c

示例14: QERApp_BuildBrush2

//Timo : another version with bConvert flag
//++timo since 1.7 is not compatible with earlier plugin versions, remove this one and update QERApp_BuildBrush
void WINAPI QERApp_BuildBrush2 (LPVOID pv, int bConvert)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	brush_t *pBrush = g_pParentWnd->GetPlugInMgr().FindBrushHandle(pv);
	if (pBrush != NULL)
	{
		Brush_Build( pBrush, true, true, bConvert );
		Sys_UpdateWindows(W_ALL);
	}
}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:12,代码来源:PlugInManager.cpp

示例15: QERApp_CreateBrush

// creates a dummy brush in the active brushes list
// FIXME : is this one really USED ?
void WINAPI QERApp_CreateBrush(vec3_t vMin, vec3_t vMax)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	
	brush_t* pBrush = Brush_Create(vMin, vMax, &g_qeglobals.d_texturewin.texdef);
	Entity_LinkBrush (world_entity, pBrush);
	Brush_Build(pBrush);
	Brush_AddToList (pBrush, &active_brushes);
	Select_Brush(pBrush);
	Sys_UpdateWindows(W_ALL);
}
开发者ID:AHPlankton,项目名称:Quake-III-Arena,代码行数:13,代码来源:PlugInManager.cpp


注:本文中的Brush_Build函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。