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


C++ CColor函数代码示例

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


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

示例1: defined

//=============================================================================
//レンダリング
//=============================================================================
void CPlayer::Rendering()
{
	#if defined ( DEBUG ) | ( _DEBUG )
	
		Collision::CBox Box[] =
		{
			m_CapChkBox,
			m_ShootChkBox,
		};
		
		CColor Color[] =
		{
			CColor( 255, 255, 255 ),
			CColor( 255, 0, 0 ),
		};
		
		const int BOX_NUM = 2;//ボックスの数
		
		/*デバッグ用の箱の描画*/
		m_pLine3D->Begin();
		
		for( int i = 0;i < BOX_NUM;++i )
		{
			m_pLine3D->PushBox( Box[i], Color[i] );
		}
		
		m_pLine3D->End();
		
	#endif
		
	CCharacter::Rendering();
	
	
}
开发者ID:Taka03,项目名称:Camerun2,代码行数:37,代码来源:player.cpp

示例2: CColor

CColor CVXS_SimGLView::GetCollisionBondColor(CVXS_BondCollision* pBond)
{
	if (!pSim->IsFeatureEnabled(VXSFEAT_COLLISIONS)) return CColor(0.0, 0.0, 0.0, 0.0); //Hide me
	vfloat Force = pBond->GetForce1().Length(); //check which force to use!
	if (Force == 0.0) return CColor(0.3, 0.3,1.0, 1.0);
	else return CColor(1.0, 0.0, 0.0, 1.0);
}
开发者ID:atsmsmr,项目名称:VoxFab,代码行数:7,代码来源:VXS_SimGLView.cpp

示例3: RotationY

// 武器の移動(ガン)
void CWeapon_Gun::Move() {
    //ブレード左手に持たせる
    CModelBone* b = Owner->GetBone(L"R_kobusi_Joint");
    //地上攻撃角度
    if (gun_hande_Angle == normal_on) {
        Rotation = RotationY(0.027f)*RotationX(0.245f)*RotationY(-0.02f)*b->Rotation;
        Position = b->Position + CVector(0.23f, -2.0f, 0.5f)*b->Rotation;
    }
    //空中攻撃角度
    if (gun_hande_Angle == air_on) {
        Rotation = RotationY(0.043f)*RotationX(0.22f)*RotationZ(0.0025f)*b->Rotation;
        Position = b->Position + CVector(0.23f, -2.0f, 0.5f)*b->Rotation;
    }

    if (gun != 0) {
        //ガン出現
        Color = CColor(1, 1, 1, 1.0f);
    }
    else if (gun == 0) {
        //ガン透明
        Color = CColor(1, 1, 1, 0.0f);
    }
    if (beam_launch == beam_on) {
        Weapon_GunList.Apply([&](CMover* g) {
            New<CBullet>(Position + CVector(0.0f, 0.0f, 5.2f)*g->Rotation);
        });
    }
}
开发者ID:owarisoranaki,项目名称:Homebrew-games,代码行数:29,代码来源:Weapon.cpp

示例4: RenderSubmit

	void RenderSubmit(SceneCollector& collector)
	{
		// (This is only called if a > 0)
		collector.Submit(&m_Overlay);

		if (ICmpSelectable::ms_EnableDebugOverlays)
		{
			// allocate debug overlays on-demand
			if (!m_DebugBoundingBoxOverlay) m_DebugBoundingBoxOverlay = new SOverlayLine;
			if (!m_DebugSelectionBoxOverlay) m_DebugSelectionBoxOverlay = new SOverlayLine;

			CmpPtr<ICmpVisual> cmpVisual(GetSimContext(), GetEntityId()); 
			if (cmpVisual) 
			{
				SimRender::ConstructBoxOutline(cmpVisual->GetBounds(), *m_DebugBoundingBoxOverlay);
				m_DebugBoundingBoxOverlay->m_Thickness = 2; 
				m_DebugBoundingBoxOverlay->m_Color = CColor(1.f, 0.f, 0.f, 1.f);

				SimRender::ConstructBoxOutline(cmpVisual->GetSelectionBox(), *m_DebugSelectionBoxOverlay);
				m_DebugSelectionBoxOverlay->m_Thickness = 2;
				m_DebugSelectionBoxOverlay->m_Color = CColor(0.f, 1.f, 0.f, 1.f);

				collector.Submit(m_DebugBoundingBoxOverlay);
				collector.Submit(m_DebugSelectionBoxOverlay);
			}
		}
		else
		{
			// reclaim debug overlay line memory when no longer debugging (and make sure to set to zero after deletion)
			if (m_DebugBoundingBoxOverlay) SAFE_DELETE(m_DebugBoundingBoxOverlay);
			if (m_DebugSelectionBoxOverlay) SAFE_DELETE(m_DebugSelectionBoxOverlay);
		}
	}
开发者ID:Gallaecio,项目名称:0ad,代码行数:33,代码来源:CCmpSelectable.cpp

示例5: GetColorAtPoint

 virtual CColor GetColorAtPoint(Real f_x,
                                Real f_y) {
    /* Compute coordinates on the image */
    UInt32 x = (f_x + m_cHalfArenaSize.GetX()) * m_fArenaToImageCoordinateXFactor;
    UInt32 y = (f_y + m_cHalfArenaSize.GetY()) * m_fArenaToImageCoordinateYFactor;
    /* Check the bit depth */
    if(m_cImage.getBitsPerPixel() <= 8) {
       RGBQUAD* ptColorPalette;
       BYTE tPixelIndex;
       /* 1, 4 or 8 bits per pixel */
       if(! m_cImage.getPixelIndex(x, y, &tPixelIndex)) {
          THROW_ARGOSEXCEPTION("Unable to access image pixel at (" << x << "," << y <<
                               "). Image size (" << m_cImage.getWidth() << "," <<
                               m_cImage.getHeight() << ")");
       }
       ptColorPalette = m_cImage.getPalette();
       return CColor(ptColorPalette[tPixelIndex].rgbRed,
                     ptColorPalette[tPixelIndex].rgbGreen,
                     ptColorPalette[tPixelIndex].rgbBlue);
    }
    else {
       /* 16, 24 or 32 bits per pixel */
       RGBQUAD tColorPixel;
       if(! m_cImage.getPixelColor(x, y, &tColorPixel)) {
          THROW_ARGOSEXCEPTION("Unable to access image pixel at (" << x << "," << y <<
                               "). Image size (" << m_cImage.getWidth() << "," <<
                               m_cImage.getHeight() << ")");
       }
       return CColor(tColorPixel.rgbRed,
                     tColorPixel.rgbGreen,
                     tColorPixel.rgbBlue);
    }
 }
开发者ID:EduardoFF,项目名称:argos2-RoboNetSim,代码行数:33,代码来源:floor_entity.cpp

示例6: TOBJMaterial

 /// Constructeur par défaut.
 TOBJMaterial(const CString& mname = CString()) :
     name         (mname),
     ambient      (CColor(102, 102, 102)),
     diffuse      (CColor(204, 204, 204)),
     specular     (CColor(76, 76, 76)),
     transparency (1.0f),
     shininess    (60.0f),
     illumination (false) { }
开发者ID:teddy-michel,项目名称:TEngine,代码行数:9,代码来源:CModelDataOBJ.hpp

示例7: CColor

void CWidget_Button::Draw() {
	CColor color = isMouseHovered ? CColor(255, 255, 255) : CColor(128, 128, 128);
	if(isMouseHovered) {
		CVector2f textSize = font->GetTextSize(text);
		float selectWidth = textSize.x * 2.0f;
		graphics->DrawRect(CRect(CVector2f(pos.x - selectWidth / 2, pos.y - (textSize.y / 2)), (int)selectWidth, 32), CColor(0, 0, 0, 128));
	}
	graphics->DrawText(font, pos, color, text, true);
}
开发者ID:Nuke928,项目名称:PonyTerra,代码行数:9,代码来源:Widget_Button.cpp

示例8: DEFAULT

void CClientVariables::LoadDefaults ( void )
{
    #define DEFAULT(__x,__y)    if(!Exists(__x)) \
                                Set(__x,__y)
    #define _S(__x)             std::string(__x)

    if(!Exists("nick")) 
    {
        DEFAULT ( "nick",                       _S(GenerateNickname()) );       // nickname
        CCore::GetSingleton ().RequestNewNickOnStart();  // Request the user to set a new nickname
    }

    DEFAULT ( "host",                       _S("127.0.0.1") );              // hostname
    DEFAULT ( "port",                       22003 );                        // port
    DEFAULT ( "password",                   _S("") );                       // password
    DEFAULT ( "qc_host",                    _S("127.0.0.1") );              // quick connect hostname
    DEFAULT ( "qc_port",                    22003 );                        // quick connect port
    DEFAULT ( "qc_password",                _S("") );                       // quick connect password
    DEFAULT ( "debugfile",                  _S("") );                       // debug filename
    DEFAULT ( "console_pos",                CVector2D ( 0, 0 ) );           // console position
    DEFAULT ( "console_size",               CVector2D ( 200, 200 ) );       // console size
    DEFAULT ( "serverbrowser_size",         CVector2D ( 720.0f, 495.0f ) ); // serverbrowser size
    DEFAULT ( "fps_limit",                  100 );                          // frame limiter
    DEFAULT ( "chat_font",                  0 );                            // chatbox font type
    DEFAULT ( "chat_lines",                 7 );                            // chatbox lines
    DEFAULT ( "chat_color",                 CColor (0,0,128,100) );         // chatbox color
    DEFAULT ( "chat_input_color",           CColor (0,0,191,110) );         // chatbox input color
    DEFAULT ( "chat_input_prefix_color",    CColor (172,213,254,255) );     // chatbox prefix input color
    DEFAULT ( "chat_input_text_color",      CColor (172,213,254,255) );     // chatbox text input color
    DEFAULT ( "chat_scale",                 CVector2D ( 1.0f, 1.0f ) );     // chatbox scale
    DEFAULT ( "chat_width",                 1.0f );                         // chatbox width
    DEFAULT ( "chat_css_style_text",        false );                        // chatbox css/hl style text
    DEFAULT ( "chat_css_style_background",  false );                        // chatbox css/hl style background
    DEFAULT ( "chat_line_life",             12000 );                        // chatbox line life time
    DEFAULT ( "chat_line_fade_out",         3000 );                         // chatbox line fade out time
    DEFAULT ( "chat_use_cegui",             false );                        // chatbox uses cegui
    DEFAULT ( "text_scale",                 1.0f );                         // text scale
    DEFAULT ( "invert_mouse",               false );                        // mouse inverting
    DEFAULT ( "fly_with_mouse",             false );                        // flying with mouse controls
    DEFAULT ( "steer_with_mouse",           false );                        // steering with mouse controls
    DEFAULT ( "classic_controls",           false );                        // classic/standard controls
    DEFAULT ( "mtavolume",                  1.0f );                         // custom sound's volume
    DEFAULT ( "voicevolume",                1.0f );                         // voice chat output volume
    DEFAULT ( "async_loading",              1 );                            // loading while crashing
    DEFAULT ( "mapalpha",                   155 );                          // map alpha
    DEFAULT ( "browser_speed",              2 );                            // Browser speed
    DEFAULT ( "single_download",            0 );                            // Single connection for downloads
    DEFAULT ( "code_path",                  0 );                            // Code path
    DEFAULT ( "update_build_type",          0 );                            // 0-stable 1-test 2-nightly
    DEFAULT ( "volumetric_shadows",         0 );                            // Enable volumetric shadows
    DEFAULT ( "aspect_ratio",               0 );                            // Display aspect ratio

    // We will default this one at CClientGame.cpp, because we need a valid direct3d device to give a proper default value.
#if 0
    DEFAULT ( "streaming_memory",           50 );                           // Streaming memory
#endif
}
开发者ID:qaisjp,项目名称:green-candy,代码行数:57,代码来源:CClientVariables.cpp

示例9: qDebug

/*static*/ bool CSubTriangle::IntersectSubdevidedTriangles(const CRay &ray, CIntersactionInfo &intersectionInfo, const std::vector<CSubTriangle*>& aSubTriangles, bool bDebug)
{    
    int nSize = aSubTriangles.size();

    float fModifier = 8.0f / static_cast<float>(nSize);

    if (bDebug)
    {
        qDebug()<<"Checking " << nSize << " patches";
    }

    bool bIntersected = false;

    for (int i = 0; i < nSize; i++)
    {
        if( aSubTriangles[i]->Intersect(ray, intersectionInfo,bDebug) )
        {
            int nId = aSubTriangles[i]->m_nSubtriangleID;

            if (false)
            {
                int nSubtriangleId = aSubTriangles[i]->m_nSubtriangleID;
                bool bR = ((nSubtriangleId / 4) > 0);
                bool bG = (((nSubtriangleId % 4) / 2) > 0);
                bool bB = (((nSubtriangleId % 4) % 2) > 0);

                float fR = bR ? fModifier * static_cast<float>(nSubtriangleId) * 0.125f : 0.0f;
                float fG = bG ? fModifier * static_cast<float>(nSubtriangleId) * 0.125f : 0.0f;
                float fB = bB ? fModifier * static_cast<float>(nSubtriangleId) * 0.125f : 0.0f;

                intersectionInfo.color = CColor(fR, fG, fB);
            }

            if (false)
            {
                int nSubtriangleId = aSubTriangles[i]->m_nSubtriangleID;
                bool bR = ((nSubtriangleId % 3) == 0);
                bool bG = ((nSubtriangleId % 3) == 1);
                bool bB = ((nSubtriangleId % 3) == 2);

                float fR = bR ? 1.0f : 0.0f;
                float fG = bG ? 1.0f : 0.0f;
                float fB = bB ? 1.0f : 0.0f;

                intersectionInfo.color = CColor(fR, fG, fB);
            }

            intersectionInfo.pSubTriangle = aSubTriangles[i];

            intersectionInfo.m_nSubTriangleId = nId;

            bIntersected = true;
        }
    }
    return bIntersected;
}
开发者ID:georgidunchev,项目名称:RTBezier,代码行数:56,代码来源:SubTriangle.cpp

示例10: CColor

///////////////////////////////////////////////////////////////////
// Construction/Destruction
WaterManager::WaterManager()
{
	// water
	m_RenderWater = false; // disabled until textures are successfully loaded
	m_WaterHeight = 5.0f;

	m_WaterCurrentTex = 0;
	
	m_ReflectionTexture = 0;
	m_RefractionTexture = 0;
	m_RefTextureSize = 0;
	
	m_ReflectionFbo = 0;
	m_RefractionFbo = 0;
	m_FancyEffectsFBO = 0;
	
	m_WaterTexTimer = 0.0;

	m_WindAngle = 0.0f;
	m_Waviness = 8.0f;
	m_WaterColor = CColor(0.3f, 0.35f, 0.7f, 1.0f);
	m_WaterTint = CColor(0.28f, 0.3f, 0.59f, 1.0f);
	m_Murkiness = 0.45f;
	m_RepeatPeriod = 16.0f;

	m_DistanceHeightmap = NULL;
	m_BlurredNormalMap = NULL;
	m_WindStrength = NULL;

	m_ShoreWaves_VBIndices = NULL;
	
	m_WaterUgly = false;
	m_WaterFancyEffects = false;
	m_WaterRealDepth = false;
	m_WaterRefraction = false;
	m_WaterReflection = false;
	m_WaterShadows = false;
	m_WaterType = L"ocean";
	
	m_NeedsReloading = false;
	m_NeedInfoUpdate = true;
	
	m_depthTT = 0;
	m_FancyTextureNormal = 0;
	m_FancyTextureOther = 0;
	m_FancyTextureDepth = 0;
	m_ReflFboDepthTexture = 0;
	m_RefrFboDepthTexture = 0;

	m_MapSize = 0;
	
	m_updatei0 = 0;
	m_updatej0 = 0;
	m_updatei1 = 0;
	m_updatej1 = 0;
}
开发者ID:krichter722,项目名称:0ad,代码行数:58,代码来源:WaterManager.cpp

示例11: CColor

void CQOpenGL::GLDrawAxes() //draws axes
{
    if (!GLGetDim(&CurEnv, &CurEnvOff))
        return;

    float AxisScale = (float)((CurEnv.x+CurEnv.y+CurEnv.z)/15);
    float AxisRad = AxisScale*0.02f;

//	glColor3d(0.6,0.6,0.6);
    CGL_Utils::DrawSphere(Vec3D<>(0,0, 0), AxisScale*0.04, Vec3D<>(1,1,1), CColor(0.6, 0.6, 0.6));
    CGL_Utils::DrawArrowD(Vec3D<>(0,0,AxisScale*0.0305), Vec3D<>(0, 0, AxisScale), CColor(0.4,0.4,0.8));
    CGL_Utils::DrawArrowD(Vec3D<>(0,AxisScale*0.0305,0), Vec3D<>(0, AxisScale, 0), CColor(0.25,0.5,0.25));
    CGL_Utils::DrawArrowD(Vec3D<>(AxisScale*0.0305, 0,0), Vec3D<>(AxisScale, 0, 0), CColor(0.7,0.3,0.3));

}
开发者ID:atsmsmr,项目名称:VoxFab,代码行数:15,代码来源:QOpenGL.cpp

示例12: m_alpha_animation

ActorWithAlphaAnimation::ActorWithAlphaAnimation():
m_alpha_animation()
{
	m_pActor = NULL;
	m_vertex_color = CColor(0xff,0xff,0xff);
	m_position = Math::Vector3D(0,0,0);
}
开发者ID:omochi64,项目名称:Hashireisen2D,代码行数:7,代码来源:ActorWithAlphaAnimation.cpp

示例13: GetTexture

//BOSS顔判定
void CEnemy10::Reset() {

	Texture = GetTexture(L"Boss_kao.png");
	Color = CColor(1, 0, 1, 0.0f);
	//Scale = CVector(1, 1, 1)*0.1f;

}
开发者ID:owarisoranaki,项目名称:Homebrew-games,代码行数:8,代码来源:Enemy.cpp

示例14: cLamber

QRgb CShader::Shade(const CRay &ray, CIntersactionInfo &intersectionInfo)
{
    CColor cLamber(0.3f, 0.3f, 0.3f);
    const float fLow = 0.05f;
    const float fHigh = 1.0f - fLow;
    if (GetSettings()->m_bWireframe)
    {
        if (intersectionInfo.m_vBarCoordsLocal.X() < fLow || intersectionInfo.m_vBarCoordsLocal.X() > fHigh ||
            intersectionInfo.m_vBarCoordsLocal.Y() < fLow || intersectionInfo.m_vBarCoordsLocal.Y() > fHigh ||
            intersectionInfo.m_vBarCoordsLocal.Z() < fLow || intersectionInfo.m_vBarCoordsLocal.Z() > fHigh)
        {
            cLamber = CColor(0.0f, 1.0f, 0.5f);
        }
        else
        {
            cLamber += ShadeLambert(ray, intersectionInfo);
  //          cLamber += ShadeGloss(ray, intersectionInfo);
        }
    }
    else
    {
        cLamber += ShadeLambert(ray, intersectionInfo);
//        cLamber += ShadeGloss(ray, intersectionInfo);
    }

    return cLamber.GetRGB();
}
开发者ID:georgidunchev,项目名称:RTBezier,代码行数:27,代码来源:shader.cpp

示例15: CString

BOOL CCmdColor::execute(CString& params)
{
	//Decode parameters
	CStringList paramStrList;
	CScriptParser::StringSplit(paramStrList, params, CString(' '));

	//Need at least 3 params for r, g, b
	const int kNumParams = 3;
	if(paramStrList.GetCount() < kNumParams)
	{
		return FALSE;
	}

	float channels[kNumParams];
	POSITION pos = paramStrList.GetHeadPosition();
	for(int i = 0; i < kNumParams; ++i)
	{
		CString paramStr = paramStrList.GetNext(pos);
		channels[i] = (float)wcstod(paramStr, NULL);
	}

	CStateManager::GetInstance()->SetColor(CColor(channels[0], channels[1], channels[2]));

	return TRUE;
}
开发者ID:Khillasaurus,项目名称:School,代码行数:25,代码来源:CmdColor.cpp


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