Skip to content

Commit 9531878

Browse files
committed
Massive D3DCOLOR_XRGB() -> color_xrgb() change.
Author: Jules Blok <[email protected]> Author: Alexandr Akulich <[email protected]> Based on commit 46c36e6 from Armada651/xray repository.
1 parent 8150b0d commit 9531878

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+389
-389
lines changed

src/Layers/xrRender/SkeletonCustom.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ void CKinematics::DebugRender(Fmatrix& XFORM)
6969
Fvector P1,P2;
7070
M1.transform_tiny(P1,Z);
7171
M2.transform_tiny(P2,Z);
72-
RCache.dbg_DrawLINE(XFORM,P1,P2,D3DCOLOR_XRGB(0,255,0));
72+
RCache.dbg_DrawLINE(XFORM,P1,P2,color_xrgb(0,255,0));
7373

7474
Fmatrix M;
7575
M.mul_43(XFORM,M2);
76-
RCache.dbg_DrawOBB(M,H1,D3DCOLOR_XRGB(255,255,255));
77-
RCache.dbg_DrawOBB(M,H2,D3DCOLOR_XRGB(255,255,255));
76+
RCache.dbg_DrawOBB(M,H1,color_xrgb(255,255,255));
77+
RCache.dbg_DrawOBB(M,H2,color_xrgb(255,255,255));
7878
}
7979

8080
for (u32 b=0; b<bones->size(); b++)
@@ -84,7 +84,7 @@ void CKinematics::DebugRender(Fmatrix& XFORM)
8484
Fmatrix Mbox; obb.xform_get(Mbox);
8585
Fmatrix X; X.mul(Mbone,Mbox);
8686
Fmatrix W; W.mul(XFORM,X);
87-
RCache.dbg_DrawOBB(W,obb.m_halfsize,D3DCOLOR_XRGB(0,0,255));
87+
RCache.dbg_DrawOBB(W,obb.m_halfsize,color_xrgb(0,0,255));
8888
}
8989
}
9090
#endif

src/Layers/xrRender/dxConsoleRender.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@ void dxConsoleRender::OnRender(bool bGame)
2626
u32 vOffset = 0;
2727
// TODO: DX10: Implement console background clearing for DX10
2828
FVF::TL* verts = (FVF::TL*)RCache.Vertex.Lock(4, m_Geom->vb_stride, vOffset);
29-
verts->set ( R.x1, R.y2, D3DCOLOR_XRGB(32,32,32), 0, 0 ); verts++;
30-
verts->set ( R.x1, R.y1, D3DCOLOR_XRGB(32,32,32), 0, 0 ); verts++;
31-
verts->set ( R.x2, R.y2, D3DCOLOR_XRGB(32,32,32), 0, 0 ); verts++;
32-
verts->set ( R.x2, R.y1, D3DCOLOR_XRGB(32,32,32), 0, 0 ); verts++;
29+
verts->set ( R.x1, R.y2, color_xrgb(32,32,32), 0, 0 ); verts++;
30+
verts->set ( R.x1, R.y1, color_xrgb(32,32,32), 0, 0 ); verts++;
31+
verts->set ( R.x2, R.y2, color_xrgb(32,32,32), 0, 0 ); verts++;
32+
verts->set ( R.x2, R.y1, color_xrgb(32,32,32), 0, 0 ); verts++;
3333
RCache.Vertex.Unlock(4,m_Geom->vb_stride);
3434

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

3838
RCache.Render (D3DPT_TRIANGLELIST, vOffset, 0, 4, 0, 2);
3939
#else // USE_DX10
40-
CHK_DX (HW.pDevice->Clear(1,&R,D3DCLEAR_TARGET,D3DCOLOR_XRGB(32,32,32),1,0));
40+
CHK_DX (HW.pDevice->Clear(1,&R,D3DCLEAR_TARGET,color_xrgb(32,32,32),1,0));
4141
#endif // USE_DX10
4242
}

src/Layers/xrRender/dxObjectSpaceRender.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ void dxObjectSpaceRender::dbgRender()
3434
Fobb& obb = q_debug.boxes[i];
3535
Fmatrix X,S,R;
3636
obb.xform_get(X);
37-
RCache.dbg_DrawOBB(X,obb.m_halfsize,D3DCOLOR_XRGB(255,0,0));
37+
RCache.dbg_DrawOBB(X,obb.m_halfsize,color_xrgb(255,0,0));
3838
S.scale (obb.m_halfsize);
3939
R.mul (X,S);
40-
RCache.dbg_DrawEllipse(R,D3DCOLOR_XRGB(0,0,255));
40+
RCache.dbg_DrawEllipse(R,color_xrgb(0,0,255));
4141
}
4242
q_debug.boxes.clear();
4343

src/Layers/xrRender/occRasterizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ void occRasterizer::on_dbg_render()
177177
Device.SetNearer(TRUE);
178178

179179
RCache.set_Shader (RImplementation.m_SelectionShader);
180-
RCache.dbg_DrawOBB( Transform, tmp.radius, D3DCOLOR_XRGB(u32(255*pow(tmp.z,20.f)),u32(255*(1-pow(tmp.z,20.f))),0) );
180+
RCache.dbg_DrawOBB( Transform, tmp.radius, color_xrgb(u32(255*pow(tmp.z,20.f)),u32(255*(1-pow(tmp.z,20.f))),0) );
181181
Device.SetNearer(FALSE);
182182
}
183183
}

src/Layers/xrRender/r__dsgraph_build.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -941,15 +941,15 @@ void D3DXRenderBase::overdrawEnd()
941941
CHK_DX(HW.pDevice->SetRenderState(D3DRS_STENCILFUNC, D3DCMP_EQUAL));
942942
CHK_DX(HW.pDevice->SetRenderState(D3DRS_STENCILMASK, 0xff));
943943
// Set the background to black
944-
CHK_DX(HW.pDevice->Clear(0, 0, D3DCLEAR_TARGET,D3DCOLOR_XRGB(255, 0, 0), 0, 0));
944+
CHK_DX(HW.pDevice->Clear(0, 0, D3DCLEAR_TARGET,color_xrgb(255, 0, 0), 0, 0));
945945
// Draw a rectangle wherever the count equal I
946946
RCache.OnFrameEnd();
947947
CHK_DX(HW.pDevice->SetFVF(FVF::F_TL));
948948
// Render gradients
949949
for (int I=0; I<12; I++)
950950
{
951951
u32 _c = I*256/13;
952-
u32 c = D3DCOLOR_XRGB(_c, _c, _c);
952+
u32 c = color_xrgb(_c, _c, _c);
953953
FVF::TL pv[4];
954954
pv[0].set(float(0), float(Device.dwHeight), c, 0, 0);
955955
pv[1].set(float(0), float(0), c, 0, 0);
@@ -1031,7 +1031,7 @@ void D3DXRenderBase::Clear()
10311031
}
10321032
#else
10331033
CHK_DX(HW.pDevice->Clear(0, 0, D3DCLEAR_ZBUFFER|(psDeviceFlags.test(rsClearBB)?D3DCLEAR_TARGET:0)|
1034-
(HW.Caps.bStencil?D3DCLEAR_STENCIL:0), D3DCOLOR_XRGB(0, 0, 0), 1, 0));
1034+
(HW.Caps.bStencil?D3DCLEAR_STENCIL:0), color_xrgb(0, 0, 0), 1, 0));
10351035
#endif
10361036
}
10371037

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

src/Layers/xrRenderPC_R1/LightShadows.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ void CLightShadows::calculate ()
172172
bRTS = TRUE;
173173
RCache.set_RT (RT_temp->pRT);
174174
RCache.set_ZB (RImplementation.Target->pTempZB);
175-
HW.pDevice->Clear (0,0,D3DCLEAR_TARGET,D3DCOLOR_XRGB(255,255,255),1,0);
175+
HW.pDevice->Clear (0,0,D3DCLEAR_TARGET,color_xrgb(255,255,255),1,0);
176176
}
177177

178178
// calculate light center

src/editors/ECore/Engine/Image.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ bool CImage::LoadTGA(LPCSTR name)
281281
// u32 R = RGBA_GETRED (pixel)/2;
282282
// u32 G = RGBA_GETGREEN (pixel)/2;
283283
// u32 B = RGBA_GETBLUE (pixel)/2;
284-
// *ptr++ = D3DCOLOR_XRGB(R,G,B);
284+
// *ptr++ = color_xrgb(R,G,B);
285285
}
286286
}
287287
}

src/xrCDB/xr_area.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ void CObjectSpace::dbgRender()
146146
Fobb& obb = q_debug.boxes[i];
147147
Fmatrix X,S,R;
148148
obb.xform_get(X);
149-
RCache.dbg_DrawOBB(X,obb.m_halfsize,D3DCOLOR_XRGB(255,0,0));
149+
RCache.dbg_DrawOBB(X,obb.m_halfsize,color_xrgb(255,0,0));
150150
S.scale (obb.m_halfsize);
151151
R.mul (X,S);
152-
RCache.dbg_DrawEllipse(R,D3DCOLOR_XRGB(0,0,255));
152+
RCache.dbg_DrawEllipse(R,color_xrgb(0,0,255));
153153
}
154154
q_debug.boxes.clear();
155155

src/xrCDB/xr_area_raypick.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,10 @@ BOOL CObjectSpace::_RayPick ( const Fvector &start, const Fvector &dir, float ra
130130
if (collidable==ignore_object) continue;
131131
ECollisionFormType tp = collidable->collidable.model->Type();
132132
if (((tgt&(rqtObject|rqtObstacle))&&(tp==cftObject))||((tgt&rqtShape)&&(tp==cftShape))){
133-
u32 C = D3DCOLOR_XRGB (64,64,64);
133+
u32 C = color_xrgb (64,64,64);
134134
Q.range = R.range;
135135
if (collidable->collidable.model->_RayQuery(Q,r_temp)){
136-
C = D3DCOLOR_XRGB(128,128,196);
136+
C = color_xrgb(128,128,196);
137137
R.set_if_less (r_temp.r_begin());
138138
}
139139
#ifdef DEBUG

src/xrGame/ActivatingCharCollisionDelay.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bool activating_character_delay::do_position_correct()
5959
Fmatrix m = obj->XFORM();
6060
m.c = sv_pos;
6161
DBG_DrawMatrix( m, 0.5f );
62-
DBG_DrawLine( obj->Position(), m.c, D3DCOLOR_XRGB( 255, 255, 255 ) );
62+
DBG_DrawLine( obj->Position(), m.c, color_xrgb( 255, 255, 255 ) );
6363
DBG_ClosedCashedDraw(50000);
6464
}
6565
#endif

0 commit comments

Comments
 (0)