Example #1
0
//=============================================================================
//レンダリング
//=============================================================================
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();
	
	
}
Example #2
0
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);
}
Example #3
0
// 武器の移動(ガン)
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);
        });
    }
}
Example #4
0
	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);
		}
	}
 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);
    }
 }
Example #6
0
 /// 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) { }
Example #7
0
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);
}
Example #8
0
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
}
Example #9
0
///////////////////////////////////////////////////////////////////
// Construction/Destruction
WaterManager::WaterManager()
{
	// water
	m_RenderWater = false; // disabled until textures are successfully loaded
	m_WaterHeight = 5.0f;
	m_WaterColor = CColor(0.3f, 0.35f, 0.7f, 1.0f);
	m_WaterFullDepth = 5.0f;
	m_WaterMaxAlpha = 1.0f;
	m_WaterAlphaOffset = -0.05f;
	m_SWaterTrans = 0;
	m_TWaterTrans = 0;
	m_SWaterSpeed = 0.0015f;
	m_TWaterSpeed = 0.0015f;
	m_SWaterScrollCounter = 0;
	m_TWaterScrollCounter = 0;
	m_WaterCurrentTex = 0;
	m_ReflectionTexture = 0;
	m_RefractionTexture = 0;
	m_ReflectionTextureSize = 0;
	m_RefractionTextureSize = 0;
	m_WaterTexTimer = 0.0;
	m_SpecularStrength = 0.6f;
	m_Waviness = 8.0f;
	m_ReflectionTint = CColor(0.28f, 0.3f, 0.59f, 1.0f);
	m_ReflectionTintStrength = 0.0f;
	m_WaterTint = CColor(0.28f, 0.3f, 0.59f, 1.0f);
	m_Murkiness = 0.45f;
	m_RepeatPeriod = 16.0f;
	m_WaveX = NULL;
	m_WaveZ = NULL;
	m_DistanceToShore = NULL;
	m_FoamFactor = NULL;

	m_WaterNormal = false;
	m_WaterRealDepth = false;
	m_WaterFoam = false;
	m_WaterCoastalWaves = false;
	m_WaterRefraction = false;
	m_WaterReflection = false;
	m_WaterShadows = false;
	
	m_NeedsReloading = false;
	m_NeedInfoUpdate = true;
	
	m_VBWaves = NULL;
	m_VBWavesIndices = NULL;

	m_depthTT = 0;
	m_waveTT = 0;

	m_MapSize = 0;
	
	m_updatei0 = 0;
	m_updatej0 = 0;
	m_updatei1 = 0;
	m_updatej1 = 0;
}
Example #10
0
/*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;
}
Example #11
0
///////////////////////////////////////////////////////////////////
// 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;
}
Example #12
0
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));

}
ActorWithAlphaAnimation::ActorWithAlphaAnimation():
m_alpha_animation()
{
	m_pActor = NULL;
	m_vertex_color = CColor(0xff,0xff,0xff);
	m_position = Math::Vector3D(0,0,0);
}
Example #14
0
//BOSS顔判定
void CEnemy10::Reset() {

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

}
Example #15
0
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();
}
Example #16
0
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;
}
Example #17
0
//BOSS顔判定(側面・上面)
void CEnemy9::Reset() {
	
	Texture = GetTexture(L"kaohit_L.png");
	Color = CColor(1, 1, 1, 0.8f);
	//Scale = CVector(1, 1, 1)*0.1f;

}
Example #18
0
  /** TestScreen, OnDraw:
   *  Detailed description.
   *  @return TODO
   */
  void TestScreen::OnDraw(){
      static int coldelta = 0;

      CMainCanvas* m_pMainCanvas = Master()->GetMainCanvas();
      m_pMainCanvas->Lock();

      m_pMainCanvas->Blit( m_pMainCanvas->GetDimension(), *m_pBackground, m_pBackground->GetDimension() );
      CRectangle frect(700, 500, 185, 185);
      SDL_Color* wavemap = ColorData::Instance()->Wavemap();
      int index = (coldelta * 2 & 63);

      //m_pMainCanvas->FillRect( frect, mcol );
      SDL_Color& fcol = wavemap[index];
      m_pMainCanvas->FillRect( frect, CColor(fcol.r, fcol.g, fcol.b) );
      m_pMainCanvas->AddUpdateRect(frect);

      CRectangle dstDims( 0, 0, 200, 200);
      m_pScrollText->Put(m_pBackground.get(), dstDims, dstDims );
      m_pMainCanvas->AddUpdateRect(dstDims);

      coldelta++;

      if (coldelta > 64) {
          coldelta = 0;
      }

      m_pMainCanvas->Unlock();
  } // OnDraw
Example #19
0
void Template::OnDraw(){
    static int coldelta = 0;

    CMainCanvas* m_pMainCanvas = Master()->GetMainCanvas();
    m_pMainCanvas->Lock();

    //m_pMainCanvas->Blit( m_pMainCanvas->GetDimension(), *m_pBackground,
    // m_pBackground->GetDimension() );
    m_pBackground->RenderCopy();
    CRectangle frect(700, 500, 185, 185);
    SDL_Color* wavemap = ColorData::Instance()->Wavemap();
    int index = (coldelta * 2 & 63);

    //m_pMainCanvas->FillRect( frect, mcol );
    SDL_Color& fcol = wavemap[index];
    CColor color = CColor(fcol.r, fcol.g, fcol.b);
    m_pMainCanvas->RenderFillRect( frect, &color );
    //m_pMainCanvas->AddUpdateRect(frect);

    CRectangle dstDims( 0, 0, 200, 200);
    //m_pScrollText->RenderPut(m_pBackground.get(), dstDims, dstDims );
    //m_pMainCanvas->AddUpdateRect(dstDims);
    m_pScroller->Render();

    coldelta++;

    if (coldelta > 64) {
        coldelta = 0;
    }

    //controls::CControl::Redraw();
    m_pOverlay->Draw();
    m_pMainCanvas->Unlock();
}   // OnDraw
Example #20
0
// setVehicleColour ( vehicleid, r, g, b, r, g, b );
SQInteger CSharedVehicleNatives::SetColour( SQVM * pVM )
{
	// Get the vehicle id
	SQInteger vehicleId;
	sq_getinteger( pVM, -7, &vehicleId );

	// Get the vehicle secondary colour
	SQInteger r_1, g_1, b_1;
	sq_getinteger( pVM, -6, &r_1 );
	sq_getinteger( pVM, -5, &g_1 );
	sq_getinteger( pVM, -4, &b_1 );

	// Get the vehicle secondary colour
	SQInteger r_2, g_2, b_2;
	sq_getinteger( pVM, -3, &r_2 );
	sq_getinteger( pVM, -2, &g_2 );
	sq_getinteger( pVM, -1, &b_2 );

	// Is the vehicle active?
	if( pCore->GetVehicleManager()->IsActive( vehicleId ) )
	{
		// Set the vehicle colour
		pCore->GetVehicleManager()->Get( vehicleId )->SetColour( CColor ( r_1, g_1, b_1, 255 ), CColor ( r_2, g_2, b_2, 255 ) );

		sq_pushbool( pVM, true );
		return 1;
	}

	sq_pushbool( pVM, false );
	return 1;
}
    const void* CColorParticleAnimation::GetCurrentAnimationValue( float currentTime, float totalTime )
    {
        if ( totalTime > 0 )
        {
            float delta = currentTime / totalTime;
            if ( delta <= 1.0f )
            {
                float fCurrentIndex = 0.0f;
                float nextIndex = 1.0f;
                auto iter = m_colorSpline.m_mapColors.begin();
                for ( ; iter != m_colorSpline.m_mapColors.end(); ++iter )
                {
                    if ( iter->first > delta )
                    {
                        nextIndex = iter->first;
                        fCurrentIndex = (--iter)->first;
                        break;
                    }
                }
                fBeginTime = fCurrentIndex;
                fEndTime = nextIndex;

                float r = CalcCurrentValue( m_colorSpline.m_mapColors[fBeginTime].r, m_colorSpline.m_mapColors[fEndTime].r, delta - fBeginTime / totalTime);
                float g = CalcCurrentValue( m_colorSpline.m_mapColors[fBeginTime].g,  m_colorSpline.m_mapColors[fEndTime].g, delta - fBeginTime / totalTime);
                float b = CalcCurrentValue( m_colorSpline.m_mapColors[fBeginTime].b,  m_colorSpline.m_mapColors[fEndTime].b, delta - fBeginTime / totalTime);
                float a = CalcCurrentValue( m_colorSpline.m_mapColors[fBeginTime].a,  m_colorSpline.m_mapColors[fEndTime].a, delta - fBeginTime / totalTime);
                //Temporarily divided by 255, change it after editor complate
                m_currentColor = CColor( r / 255.0f , g / 255.0f , b / 255.0f , a / 255.0f );
            }
        }
        return &m_currentColor;
    }
 CColorParticleAnimation::CColorParticleAnimation()
     : fBeginTime(0.0f)
     , fEndTime(0.0f)
     , m_currentColor(CColor( 0.0f, 0.0f, 0.0f, 0.0f ))
 {
     m_animationType = eAT_COLOR;
 }
Example #23
0
// 武器の初期化(ブレード)
void CWeapon::Reset() {
    //Model = GetModel(L"WEAPON\\blade.x");
    //Scale = CVector(1.0f, 1, 1)*0.6f;//0.6f
    Model = GetModel(L"WEAPON\\sword.x");
    Scale = CVector(1.5f, 1, 1)*2.7f;//0.6f
    Color = CColor(1, 1, 1, 0.0f);//0.0
}
Example #24
0
void CHUD_FPS::update()
{
    T_ASSERT(m_buffer != nullptr);

    const float fps = CApplication::getApp()->getFPS();

    m_buffer->clear();

    m_buffer->addRectangle(m_rec, CColor(127, 127, 127, 127));


    // Texte
    TTextParams params;
    params.text  = CString("FPS : ") + CString::fromNumber(fps);
    params.font  = Game::fontManager->getFontId("Arial");
    params.size  = 16;
    params.color = CColor::White;
    params.rec.setX(m_rec.getX() + 5);
    params.rec.setY(m_rec.getY() + 5);
    params.rec.setWidth(m_rec.getWidth());
    params.rec.setHeight(m_rec.getHeight());

    Game::fontManager->drawText(m_buffer, params);


    m_buffer->update();
}
Example #25
0
CTextRenderer::CTextRenderer(const CShaderProgramPtr& shader) :
	m_Shader(shader)
{
	ResetTransform();
	Color(CColor(1.0f, 1.0f, 1.0f, 1.0f));
	Font(str_sans_10);
}
Example #26
0
void CWorldEditor::CreateBaseAxis()
{
	auto sceneRoot = m_overlayViewport->GetSceneRoot();

	static const CVector3 g_arrowScale(0.075f, 0.25f, 0.075f);
	
	{
		auto baseAxisNode = Palleon::CSceneNode::Create();
		baseAxisNode->SetPosition(CVector3(289.2f, 5.00f, -563.f));
		sceneRoot->AppendChild(baseAxisNode);

		{
			auto axisMesh = Palleon::CAxisMesh::Create();
			axisMesh->SetScale(CVector3(1, 1, 1));
			baseAxisNode->AppendChild(axisMesh);
		}

		//X arrow
		{
			auto coneMesh = Palleon::CConeMesh::Create();
			coneMesh->SetPosition(CVector3(1, 0, 0));
			coneMesh->SetRotation(CQuaternion(CVector3(0, 0, 1), M_PI / 2.f));
			coneMesh->SetScale(g_arrowScale);
			coneMesh->GetMaterial()->SetColor(CColor(1, 0, 0, 1));
			baseAxisNode->AppendChild(coneMesh);
		}

		//Y arrow
		{
			auto coneMesh = Palleon::CConeMesh::Create();
			coneMesh->SetPosition(CVector3(0, 1, 0));
			coneMesh->SetScale(g_arrowScale);
			coneMesh->GetMaterial()->SetColor(CColor(0, 1, 0, 1));
			baseAxisNode->AppendChild(coneMesh);
		}

		//Z arrow
		{
			auto coneMesh = Palleon::CConeMesh::Create();
			coneMesh->SetPosition(CVector3(0, 0, 1));
			coneMesh->SetRotation(CQuaternion(CVector3(1, 0, 0), -M_PI / 2.f));
			coneMesh->SetScale(g_arrowScale);
			coneMesh->GetMaterial()->SetColor(CColor(0, 0, 1, 1));
			baseAxisNode->AppendChild(coneMesh);
		}
	}
}
Example #27
0
void SQRChartHistogram::AppendData(float v, uint32 colorFill, uint32 colorText)
{
	m_data.push_back(v);
	if(colorText == 0)
		colorText = CColor(colorFill).Reverse();
	m_color.push_back(make_pair(colorFill, colorText));
	Ast(m_data.size() == m_color.size());
}
Example #28
0
CIntersectionInfo::CIntersectionInfo() : m_vecNormal(0,0,0), m_vecIncoming(0,0,0)
{
	m_colObject		= CColor (0,0,0);
	m_ptIntersection= CPoint3D (0,0,0);
	m_pShapeObject	= 0;
	m_texIntersection	= CTexCoords(0,0);
	m_eIntersectionType=ENTRY;
}
Example #29
0
	CCmpSelectable()
		: m_DebugBoundingBoxOverlay(NULL), m_DebugSelectionBoxOverlay(NULL), 
		  m_BuildingOverlay(NULL), m_UnitOverlay(NULL),
		  m_FadeBaselineAlpha(0.f), m_FadeDeltaAlpha(0.f), m_FadeProgress(0.f),
		  m_Selected(false), m_Cached(false), m_Visible(false)
	{
		m_Color = CColor(0, 0, 0, m_FadeBaselineAlpha);
	}
// ПоХсХ`Йж
void DrawInfoBeforeGame::run( void )
{
	Renderer::Object::IFontSprite2D *font = GameSystem::pFonts[GameSystem::FONT_NUMBERS];

	char str[512];

	sprintf( str , "WORLD %d - %d" , m_world , m_course );
	font->DrawString( str , m_worldStringPos , CColor(0xff,0xff,0xff) );

	m_pUdongePrimitive->Begin();
	m_pUdongePrimitive->Push( m_udonge_vertex , 2 );
	m_pUdongePrimitive->End();
	GameSystem::pPrimitive2D.push_back( m_set );

	sprintf( str , "  X  %02d" , Character::udonge->GetRestLife() );
	font->DrawString( str , m_restLifeStringPos , CColor(0xff,0xff,0xff) );
}