Skip to content

Commit

Permalink
Massive D3DCOLOR_XRGB() -> color_xrgb() change.
Browse files Browse the repository at this point in the history
Author: Jules Blok <[email protected]>
Author: Alexandr Akulich <[email protected]>

Based on commit 46c36e6 from Armada651/xray repository.
  • Loading branch information
Kaffeine committed Nov 10, 2015
1 parent 8150b0d commit 9531878
Show file tree
Hide file tree
Showing 70 changed files with 389 additions and 389 deletions.
8 changes: 4 additions & 4 deletions src/Layers/xrRender/SkeletonCustom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ void CKinematics::DebugRender(Fmatrix& XFORM)
Fvector P1,P2;
M1.transform_tiny(P1,Z);
M2.transform_tiny(P2,Z);
RCache.dbg_DrawLINE(XFORM,P1,P2,D3DCOLOR_XRGB(0,255,0));
RCache.dbg_DrawLINE(XFORM,P1,P2,color_xrgb(0,255,0));

Fmatrix M;
M.mul_43(XFORM,M2);
RCache.dbg_DrawOBB(M,H1,D3DCOLOR_XRGB(255,255,255));
RCache.dbg_DrawOBB(M,H2,D3DCOLOR_XRGB(255,255,255));
RCache.dbg_DrawOBB(M,H1,color_xrgb(255,255,255));
RCache.dbg_DrawOBB(M,H2,color_xrgb(255,255,255));
}

for (u32 b=0; b<bones->size(); b++)
Expand All @@ -84,7 +84,7 @@ void CKinematics::DebugRender(Fmatrix& XFORM)
Fmatrix Mbox; obb.xform_get(Mbox);
Fmatrix X; X.mul(Mbone,Mbox);
Fmatrix W; W.mul(XFORM,X);
RCache.dbg_DrawOBB(W,obb.m_halfsize,D3DCOLOR_XRGB(0,0,255));
RCache.dbg_DrawOBB(W,obb.m_halfsize,color_xrgb(0,0,255));
}
}
#endif
Expand Down
10 changes: 5 additions & 5 deletions src/Layers/xrRender/dxConsoleRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ void dxConsoleRender::OnRender(bool bGame)
u32 vOffset = 0;
// TODO: DX10: Implement console background clearing for DX10
FVF::TL* verts = (FVF::TL*)RCache.Vertex.Lock(4, m_Geom->vb_stride, vOffset);
verts->set ( R.x1, R.y2, D3DCOLOR_XRGB(32,32,32), 0, 0 ); verts++;
verts->set ( R.x1, R.y1, D3DCOLOR_XRGB(32,32,32), 0, 0 ); verts++;
verts->set ( R.x2, R.y2, D3DCOLOR_XRGB(32,32,32), 0, 0 ); verts++;
verts->set ( R.x2, R.y1, D3DCOLOR_XRGB(32,32,32), 0, 0 ); verts++;
verts->set ( R.x1, R.y2, color_xrgb(32,32,32), 0, 0 ); verts++;
verts->set ( R.x1, R.y1, color_xrgb(32,32,32), 0, 0 ); verts++;
verts->set ( R.x2, R.y2, color_xrgb(32,32,32), 0, 0 ); verts++;
verts->set ( R.x2, R.y1, color_xrgb(32,32,32), 0, 0 ); verts++;
RCache.Vertex.Unlock(4,m_Geom->vb_stride);

RCache.set_Element (m_Shader->E[0]);
RCache.set_Geometry (m_Geom);

RCache.Render (D3DPT_TRIANGLELIST, vOffset, 0, 4, 0, 2);
#else // USE_DX10
CHK_DX (HW.pDevice->Clear(1,&R,D3DCLEAR_TARGET,D3DCOLOR_XRGB(32,32,32),1,0));
CHK_DX (HW.pDevice->Clear(1,&R,D3DCLEAR_TARGET,color_xrgb(32,32,32),1,0));
#endif // USE_DX10
}
4 changes: 2 additions & 2 deletions src/Layers/xrRender/dxObjectSpaceRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ void dxObjectSpaceRender::dbgRender()
Fobb& obb = q_debug.boxes[i];
Fmatrix X,S,R;
obb.xform_get(X);
RCache.dbg_DrawOBB(X,obb.m_halfsize,D3DCOLOR_XRGB(255,0,0));
RCache.dbg_DrawOBB(X,obb.m_halfsize,color_xrgb(255,0,0));
S.scale (obb.m_halfsize);
R.mul (X,S);
RCache.dbg_DrawEllipse(R,D3DCOLOR_XRGB(0,0,255));
RCache.dbg_DrawEllipse(R,color_xrgb(0,0,255));
}
q_debug.boxes.clear();

Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/occRasterizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void occRasterizer::on_dbg_render()
Device.SetNearer(TRUE);

RCache.set_Shader (RImplementation.m_SelectionShader);
RCache.dbg_DrawOBB( Transform, tmp.radius, D3DCOLOR_XRGB(u32(255*pow(tmp.z,20.f)),u32(255*(1-pow(tmp.z,20.f))),0) );
RCache.dbg_DrawOBB( Transform, tmp.radius, color_xrgb(u32(255*pow(tmp.z,20.f)),u32(255*(1-pow(tmp.z,20.f))),0) );
Device.SetNearer(FALSE);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/Layers/xrRender/r__dsgraph_build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -941,15 +941,15 @@ void D3DXRenderBase::overdrawEnd()
CHK_DX(HW.pDevice->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_EQUAL));
CHK_DX(HW.pDevice->SetRenderState(D3DRS_STENCILMASK, 0xff));
// Set the background to black
CHK_DX(HW.pDevice->Clear(0, 0, D3DCLEAR_TARGET,D3DCOLOR_XRGB(255, 0, 0), 0, 0));
CHK_DX(HW.pDevice->Clear(0, 0, D3DCLEAR_TARGET,color_xrgb(255, 0, 0), 0, 0));
// Draw a rectangle wherever the count equal I
RCache.OnFrameEnd();
CHK_DX(HW.pDevice->SetFVF(FVF::F_TL));
// Render gradients
for (int I=0; I<12; I++)
{
u32 _c = I*256/13;
u32 c = D3DCOLOR_XRGB(_c, _c, _c);
u32 c = color_xrgb(_c, _c, _c);
FVF::TL pv[4];
pv[0].set(float(0), float(Device.dwHeight), c, 0, 0);
pv[1].set(float(0), float(0), c, 0, 0);
Expand Down Expand Up @@ -1031,7 +1031,7 @@ void D3DXRenderBase::Clear()
}
#else
CHK_DX(HW.pDevice->Clear(0, 0, D3DCLEAR_ZBUFFER|(psDeviceFlags.test(rsClearBB)?D3DCLEAR_TARGET:0)|
(HW.Caps.bStencil?D3DCLEAR_STENCIL:0), D3DCOLOR_XRGB(0, 0, 0), 1, 0));
(HW.Caps.bStencil?D3DCLEAR_STENCIL:0), color_xrgb(0, 0, 0), 1, 0));
#endif
}

Expand Down Expand Up @@ -1064,7 +1064,7 @@ void D3DXRenderBase::ClearTarget()
FLOAT ColorRGBA[4] = {0.0f, 0.0f, 0.0f, 0.0f};
HW.pContext->ClearRenderTargetView(RCache.get_RT(), ColorRGBA);
#else
CHK_DX(HW.pDevice->Clear(0,0,D3DCLEAR_TARGET,D3DCOLOR_XRGB(0, 0, 0), 1, 0));
CHK_DX(HW.pDevice->Clear(0,0,D3DCLEAR_TARGET,color_xrgb(0, 0, 0), 1, 0));
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRenderPC_R1/LightShadows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void CLightShadows::calculate ()
bRTS = TRUE;
RCache.set_RT (RT_temp->pRT);
RCache.set_ZB (RImplementation.Target->pTempZB);
HW.pDevice->Clear (0,0,D3DCLEAR_TARGET,D3DCOLOR_XRGB(255,255,255),1,0);
HW.pDevice->Clear (0,0,D3DCLEAR_TARGET,color_xrgb(255,255,255),1,0);
}

// calculate light center
Expand Down
2 changes: 1 addition & 1 deletion src/editors/ECore/Engine/Image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ bool CImage::LoadTGA(LPCSTR name)
// u32 R = RGBA_GETRED (pixel)/2;
// u32 G = RGBA_GETGREEN (pixel)/2;
// u32 B = RGBA_GETBLUE (pixel)/2;
// *ptr++ = D3DCOLOR_XRGB(R,G,B);
// *ptr++ = color_xrgb(R,G,B);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/xrCDB/xr_area.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ void CObjectSpace::dbgRender()
Fobb& obb = q_debug.boxes[i];
Fmatrix X,S,R;
obb.xform_get(X);
RCache.dbg_DrawOBB(X,obb.m_halfsize,D3DCOLOR_XRGB(255,0,0));
RCache.dbg_DrawOBB(X,obb.m_halfsize,color_xrgb(255,0,0));
S.scale (obb.m_halfsize);
R.mul (X,S);
RCache.dbg_DrawEllipse(R,D3DCOLOR_XRGB(0,0,255));
RCache.dbg_DrawEllipse(R,color_xrgb(0,0,255));
}
q_debug.boxes.clear();
Expand Down
4 changes: 2 additions & 2 deletions src/xrCDB/xr_area_raypick.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ BOOL CObjectSpace::_RayPick ( const Fvector &start, const Fvector &dir, float ra
if (collidable==ignore_object) continue;
ECollisionFormType tp = collidable->collidable.model->Type();
if (((tgt&(rqtObject|rqtObstacle))&&(tp==cftObject))||((tgt&rqtShape)&&(tp==cftShape))){
u32 C = D3DCOLOR_XRGB (64,64,64);
u32 C = color_xrgb (64,64,64);
Q.range = R.range;
if (collidable->collidable.model->_RayQuery(Q,r_temp)){
C = D3DCOLOR_XRGB(128,128,196);
C = color_xrgb(128,128,196);
R.set_if_less (r_temp.r_begin());
}
#ifdef DEBUG
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/ActivatingCharCollisionDelay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bool activating_character_delay::do_position_correct()
Fmatrix m = obj->XFORM();
m.c = sv_pos;
DBG_DrawMatrix( m, 0.5f );
DBG_DrawLine( obj->Position(), m.c, D3DCOLOR_XRGB( 255, 255, 255 ) );
DBG_DrawLine( obj->Position(), m.c, color_xrgb( 255, 255, 255 ) );
DBG_ClosedCashedDraw(50000);
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ void CActor::Hit(SHit* pHDS)
if(ph_dbg_draw_mask.test(phDbgCharacterControl)) {
DBG_OpenCashedDraw();
Fvector to;to.add(Position(),Fvector().mul(HDS.dir,HDS.phys_impulse()));
DBG_DrawLine(Position(),to,D3DCOLOR_XRGB(124,124,0));
DBG_DrawLine(Position(),to,color_xrgb(124,124,0));
DBG_ClosedCashedDraw(500);
}
#endif // DEBUG
Expand Down
18 changes: 9 additions & 9 deletions src/xrGame/ActorCameras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ void dbg_draw_viewport( const T &cam_info, float _viewport_near )
const Fvector bottom_left = Fvector().sub( near_plane_center, right ).sub( up );
const Fvector bottom_right = Fvector().add( near_plane_center, right ).sub( up );

DBG_DrawLine( cam_info.Position(), top_left, D3DCOLOR_XRGB(255, 0, 0 ) );
DBG_DrawLine( cam_info.Position(), top_right, D3DCOLOR_XRGB(255, 0, 0 ) );
DBG_DrawLine( cam_info.Position(), bottom_left, D3DCOLOR_XRGB(255, 0, 0 ) );
DBG_DrawLine( cam_info.Position(), bottom_right, D3DCOLOR_XRGB(255, 0, 0 ) );

DBG_DrawLine( top_right, top_left, D3DCOLOR_XRGB(255, 0, 0 ) );
DBG_DrawLine( bottom_right, top_right, D3DCOLOR_XRGB(255, 0, 0 ) );
DBG_DrawLine( top_left, bottom_left, D3DCOLOR_XRGB(255, 0, 0 ) );
DBG_DrawLine( bottom_left, bottom_right, D3DCOLOR_XRGB(255, 0, 0 ) );
DBG_DrawLine( cam_info.Position(), top_left, color_xrgb(255, 0, 0 ) );
DBG_DrawLine( cam_info.Position(), top_right, color_xrgb(255, 0, 0 ) );
DBG_DrawLine( cam_info.Position(), bottom_left, color_xrgb(255, 0, 0 ) );
DBG_DrawLine( cam_info.Position(), bottom_right, color_xrgb(255, 0, 0 ) );

DBG_DrawLine( top_right, top_left, color_xrgb(255, 0, 0 ) );
DBG_DrawLine( bottom_right, top_right, color_xrgb(255, 0, 0 ) );
DBG_DrawLine( top_left, bottom_left, color_xrgb(255, 0, 0 ) );
DBG_DrawLine( bottom_left, bottom_right, color_xrgb(255, 0, 0 ) );

}
#endif
Expand Down
38 changes: 19 additions & 19 deletions src/xrGame/CharacterPhysicsSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ void dbg_draw_geoms(xr_vector<CODEGeom*>& m_weapon_geoms)
{
CODEGeom *g =(*ii);

g->dbg_draw( 0.01f, D3DCOLOR_XRGB( 0, 255, 100 ), Flags32() );
g->dbg_draw( 0.01f, color_xrgb( 0, 255, 100 ), Flags32() );
}
}
#endif
Expand Down Expand Up @@ -888,13 +888,13 @@ void CCharacterPhysicsSupport::on_child_shell_activate ( CPhysicsShellHolder* o
VERIFY(obj->PPhysicsShell());
#if 0
// DBG_OpenCashedDraw();
//m_pPhysicsShell->dbg_draw_geometry( 0.2f, D3DCOLOR_XRGB( 255, 100, 0 ) );
m_pPhysicsShell->dbg_draw_velocity( 0.01f, D3DCOLOR_XRGB( 100, 255, 0 ) );
m_pPhysicsShell->dbg_draw_force( 0.1f, D3DCOLOR_XRGB( 100, 0, 255 ) );
//m_pPhysicsShell->dbg_draw_geometry( 0.2f, color_xrgb( 255, 100, 0 ) );
m_pPhysicsShell->dbg_draw_velocity( 0.01f, color_xrgb( 100, 255, 0 ) );
m_pPhysicsShell->dbg_draw_force( 0.1f, color_xrgb( 100, 0, 255 ) );
DBG_ClosedCashedDraw( 50000 );
#endif
//DBG_OpenCashedDraw();
//obj->PPhysicsShell()->dbg_draw_geometry( 0.2f, D3DCOLOR_XRGB( 255, 100, 0 ) );
//obj->PPhysicsShell()->dbg_draw_geometry( 0.2f, color_xrgb( 255, 100, 0 ) );

RemoveActiveWeaponCollision ();

Expand Down Expand Up @@ -931,15 +931,15 @@ void CCharacterPhysicsSupport:: RemoveActiveWeaponCollision ()
{
CODEGeom *g =(*ii);

//g->dbg_draw( 0.01f, D3DCOLOR_XRGB( 0, 0, 255 ), Flags32() );
//g->dbg_draw( 0.01f, color_xrgb( 0, 0, 255 ), Flags32() );

m_weapon_attach_bone->remove_geom( g );
g->destroy();
xr_delete(g);
}


//m_active_item_obj->PPhysicsShell()->dbg_draw_geometry( 0.2f, D3DCOLOR_XRGB( 255, 0, 100 ) );
//m_active_item_obj->PPhysicsShell()->dbg_draw_geometry( 0.2f, color_xrgb( 255, 0, 100 ) );

Fvector a_vel, l_vel;
const Fvector& mc = root->mass_Center();
Expand Down Expand Up @@ -1045,19 +1045,19 @@ void CCharacterPhysicsSupport:: AddActiveWeaponCollision ()
for( ;ii!=ee; ++ii )
{
CODEGeom *g =(*ii);
//g->dbg_draw( 0.01f, D3DCOLOR_XRGB( 255, 0, 0 ), Flags32() );
//g->dbg_draw( 0.01f, color_xrgb( 255, 0, 0 ), Flags32() );
weapon_element->remove_geom( g );
g->set_bone_id( weapon_attach_bone->m_SelfID );
weapon_attach_bone->add_geom( g );
//g->dbg_draw( 0.01f, D3DCOLOR_XRGB( 0, 255, 0 ), Flags32() );
//g->dbg_draw( 0.01f, color_xrgb( 0, 255, 0 ), Flags32() );
}
m_weapon_attach_bone = weapon_attach_bone;
m_active_item_obj = &(active_weapon_item->object());


destroy_physics_shell( weapon_shell );

//m_pPhysicsShell->dbg_draw_geometry( 1, D3DCOLOR_XRGB( 0, 0, 255 ) );
//m_pPhysicsShell->dbg_draw_geometry( 1, color_xrgb( 0, 0, 255 ) );
//DBG_ClosedCashedDraw( 50000 );
}

Expand Down Expand Up @@ -1182,7 +1182,7 @@ void CCharacterPhysicsSupport:: EndActivateFreeShell ( CObject* who, const Fve
if( dbg_draw_ragdoll_spawn )
{
DBG_OpenCashedDraw();
m_pPhysicsShell->dbg_draw_geometry( 0.2f, D3DCOLOR_XRGB( 255, 100, 0 ) );
m_pPhysicsShell->dbg_draw_geometry( 0.2f, color_xrgb( 255, 100, 0 ) );
DBG_ClosedCashedDraw( 50000 );
}
#endif
Expand All @@ -1194,7 +1194,7 @@ if( dbg_draw_ragdoll_spawn )
if( dbg_draw_ragdoll_spawn )
{
DBG_OpenCashedDraw();
m_pPhysicsShell->dbg_draw_geometry( 0.2f, D3DCOLOR_XRGB( 255, 0, 100 ) );
m_pPhysicsShell->dbg_draw_geometry( 0.2f, color_xrgb( 255, 0, 100 ) );
DBG_ClosedCashedDraw( 50000 );
}
#endif
Expand All @@ -1205,7 +1205,7 @@ if( dbg_draw_ragdoll_spawn )
if( dbg_draw_ragdoll_spawn )
{
DBG_OpenCashedDraw();
m_pPhysicsShell->dbg_draw_geometry( 0.2f, D3DCOLOR_XRGB( 100, 255, 100 ) );
m_pPhysicsShell->dbg_draw_geometry( 0.2f, color_xrgb( 100, 255, 100 ) );
DBG_ClosedCashedDraw( 50000 );
}
#endif
Expand Down Expand Up @@ -1374,17 +1374,17 @@ void CCharacterPhysicsSupport::FlyTo(const Fvector &disp)
m_pPhysicsShell->set_LinearVel(vel);
#if 0
DBG_OpenCashedDraw();
//m_pPhysicsShell->dbg_draw_geometry( 0.2f, D3DCOLOR_XRGB( 255, 100, 0 ) );
m_pPhysicsShell->dbg_draw_velocity( 0.01f, D3DCOLOR_XRGB( 0, 255, 0 ) );
m_pPhysicsShell->dbg_draw_force( 0.1f, D3DCOLOR_XRGB( 0, 0, 255 ) );
//m_pPhysicsShell->dbg_draw_geometry( 0.2f, color_xrgb( 255, 100, 0 ) );
m_pPhysicsShell->dbg_draw_velocity( 0.01f, color_xrgb( 0, 255, 0 ) );
m_pPhysicsShell->dbg_draw_force( 0.1f, color_xrgb( 0, 0, 255 ) );
// DBG_ClosedCashedDraw( 50000 );
#endif
physics_world()->Step();
#if 0
// DBG_OpenCashedDraw();
//m_pPhysicsShell->dbg_draw_geometry( 0.2f, D3DCOLOR_XRGB( 255, 100, 0 ) );
m_pPhysicsShell->dbg_draw_velocity( 0.01f, D3DCOLOR_XRGB( 100, 255, 0 ) );
m_pPhysicsShell->dbg_draw_force( 0.1f, D3DCOLOR_XRGB( 100, 0, 255 ) );
//m_pPhysicsShell->dbg_draw_geometry( 0.2f, color_xrgb( 255, 100, 0 ) );
m_pPhysicsShell->dbg_draw_velocity( 0.01f, color_xrgb( 100, 255, 0 ) );
m_pPhysicsShell->dbg_draw_force( 0.1f, color_xrgb( 100, 0, 255 ) );
DBG_ClosedCashedDraw( 50000 );
#endif
}
Expand Down
8 changes: 4 additions & 4 deletions src/xrGame/ClimableObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,22 +349,22 @@ void CClimableObject ::OnRender()

Fmatrix form;m_box.xform_get(form);
//form.mulA(XFORM());
Level().debug_renderer().draw_obb(XFORM(),m_box.m_halfsize,D3DCOLOR_XRGB(0,0,255));
Level().debug_renderer().draw_obb(XFORM(),m_box.m_halfsize,color_xrgb(0,0,255));
Fvector p1,p2,d;
d.set(m_axis);
p1.add(XFORM().c,d);
p2.sub(XFORM().c,d);
Level().debug_renderer().draw_line(Fidentity,p1,p2,D3DCOLOR_XRGB(255,0,0));
Level().debug_renderer().draw_line(Fidentity,p1,p2,color_xrgb(255,0,0));

d.set(m_side);
p1.add(XFORM().c,d);
p2.sub(XFORM().c,d);
Level().debug_renderer().draw_line(Fidentity,p1,p2,D3DCOLOR_XRGB(255,0,0));
Level().debug_renderer().draw_line(Fidentity,p1,p2,color_xrgb(255,0,0));

d.set(m_norm);
d.mul(10.f);
p1.add(XFORM().c,d);
p2.set(XFORM().c);
Level().debug_renderer().draw_line(Fidentity,p1,p2,D3DCOLOR_XRGB(0,255,0));
Level().debug_renderer().draw_line(Fidentity,p1,p2,color_xrgb(0,255,0));
}
#endif
Loading

0 comments on commit 9531878

Please sign in to comment.