Пример #1
0
void DoCaulkSelection( void ) {
	DEntity world;

	float fScale[2] = { 0.5f, 0.5f };
	float fShift[2] = { 0.0f, 0.0f };

	int bResetScale[2] = { false, false };
	int bResetShift[2] = { false, false };

	world.LoadSelectedBrushes();
	world.LoadSelectedPatches();
	world.ResetTextures( NULL, fScale, fShift, 0, "textures/common/caulk", true, bResetScale, bResetShift, false, true );
}
Пример #2
0
void DoIntersect(){
	IntersectRS rs;

	if ( DoIntersectBox( &rs ) == IDCANCEL ) {
		return;
	}

	if ( rs.nBrushOptions == BRUSH_OPT_SELECTED ) {
		if ( g_FuncTable.m_pfnSelectedBrushCount() < 2 ) {
			DoMessageBox( "Invalid number of brushes selected, choose at least 2", "Error", MB_OK );
			return;
		}
	}

	DEntity world;

	switch ( rs.nBrushOptions )
	{
	case BRUSH_OPT_SELECTED:
	{
		world.LoadSelectedBrushes();
		break;
	}
	case BRUSH_OPT_WHOLE_MAP:
	{
		world.LoadFromEntity( 0, FALSE );
		break;
	}
	}

	world.RemoveNonCheckBrushes( &exclusionList, rs.bUseDetail );

	bool* pbSelectList;
	if ( rs.bDuplicateOnly ) {
		pbSelectList = world.BuildDuplicateList();
	}
	else{
		pbSelectList = world.BuildIntersectList();
	}

	world.SelectBrushes( pbSelectList );

	delete[] pbSelectList;
}
Пример #3
0
void DoResetTextures(){
	static ResetTextureRS rs;

	const char* texName;
	if ( g_SelectedFaceTable.m_pfnGetSelectedFaceCount() != 1 ) {
		texName = NULL;
	}
	else
	{
		texName = GetCurrentTexture();
		strcpy( rs.textureName, GetCurrentTexture() );
	}

	int ret;
	if ( ( ret = DoResetTextureBox( &rs ) ) == IDCANCEL ) {
		return;
	}

	if ( rs.bResetTextureName ) {
		texName = rs.textureName;
	}

	if ( ret == IDOK ) {
		DEntity world;
		world.LoadSelectedBrushes();
		world.ResetTextures( texName,              rs.fScale,      rs.fShift,      rs.rotation, rs.newTextureName,
							 rs.bResetTextureName, rs.bResetScale, rs.bResetShift, rs.bResetRotation, TRUE );
	}
	else
	{
		DMap world;
		world.LoadAll( TRUE );
		world.ResetTextures( texName,              rs.fScale,      rs.fShift,      rs.rotation, rs.newTextureName,
							 rs.bResetTextureName, rs.bResetScale, rs.bResetShift, rs.bResetRotation );
	}
}