Skip to content
Browse files

Rename [un]clock => [un]cycle.

Naming conflicted with time.h.
  • Loading branch information...
1 parent f9db901 commit 9a8e7acc9ba3acc31192d33884f2c37203c63652 @stephank committed May 13, 2012
Showing with 61 additions and 61 deletions.
  1. +3 −3 Core/Inc/UnCache.h
  2. +6 −6 Core/Inc/UnFile.h
  3. +18 −18 D3D9Drv/Src/D3D9.cpp
  4. +8 −8 D3DDrv/Src/Direct3D7.cpp
  5. +8 −8 D3DDrv/Src/und3d.cpp
  6. +18 −18 OpenGLDrv/Src/OpenGL.cpp
View
6 Core/Inc/UnCache.h
@@ -108,7 +108,7 @@ class CORE_API FMemCache
BYTE* Get( QWORD Id, FCacheItem*& Item, INT Alignment=DEFAULT_ALIGNMENT )
{
guardSlow(FMemCache::Get);
- clockSlow(GetCycles);
+ cycleSlow(GetCycles);
#if DO_SLOW_CLOCK
NumGets++;
#endif
@@ -128,11 +128,11 @@ class CORE_API FMemCache
Item = HashItem;
HashItem->Time = Time;
HashItem->Cost += COST_INFINITE;
- unclockSlow(GetCycles);
+ uncycleSlow(GetCycles);
return Align( HashItem->Data, Alignment );
}
}
- unclockSlow(GetCycles);
+ uncycleSlow(GetCycles);
return NULL;
unguardSlow;
}
View
12 Core/Inc/UnFile.h
@@ -179,18 +179,18 @@ CORE_API void VARARGS appThrowf( const TCHAR* Fmt, ... );
//
// Normal timing.
//
-#define clock(Timer) {Timer -= appCycles();}
-#define unclock(Timer) {Timer += appCycles()-34;}
+#define cycle(Timer) {Timer -= appCycles();}
+#define uncycle(Timer) {Timer += appCycles()-34;}
//
// Performance critical timing.
//
#if DO_CLOCK_SLOW
- #define clockSlow(Timer) {Timer-=appCycles();}
- #define unclockSlow(Timer) {Timer+=appCycles();}
+ #define cycleSlow(Timer) {Timer-=appCycles();}
+ #define uncycleSlow(Timer) {Timer+=appCycles();}
#else
- #define clockSlow(Timer)
- #define unclockSlow(Timer)
+ #define cycleSlow(Timer)
+ #define uncycleSlow(Timer)
#endif
/*-----------------------------------------------------------------------------
View
36 D3D9Drv/Src/D3D9.cpp
@@ -3961,7 +3961,7 @@ void UD3D9RenderDevice::DrawComplexSurface(FSceneNode* Frame, FSurfaceInfo& Surf
check(Surface.Texture);
- clock(ComplexCycles);
+ cycle(ComplexCycles);
//Calculate UDot and VDot intermediates for complex surface
m_csUDot = Facet.MapCoords.XAxis | Facet.MapCoords.Origin;
@@ -4153,7 +4153,7 @@ void UD3D9RenderDevice::DrawComplexSurface(FSceneNode* Frame, FSurfaceInfo& Surf
m_d3dDevice->SetRenderState(D3DRS_ZFUNC, D3DCMP_LESSEQUAL);
}
- unclock(ComplexCycles);
+ uncycle(ComplexCycles);
unguard;
}
@@ -4352,7 +4352,7 @@ void UD3D9RenderDevice::DrawGouraudPolygonOld(FSceneNode* Frame, FTextureInfo& I
}
#endif
guard(UD3D9RenderDevice::DrawGouraudPolygonOld);
- clock(GouraudCycles);
+ cycle(GouraudCycles);
//Decide if should request near Z range hack projection
bool requestNearZRangeHackProjection = false;
@@ -4475,7 +4475,7 @@ void UD3D9RenderDevice::DrawGouraudPolygonOld(FSceneNode* Frame, FTextureInfo& I
m_d3dDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
#endif
- unclock(GouraudCycles);
+ uncycle(GouraudCycles);
unguard;
}
@@ -4880,7 +4880,7 @@ void UD3D9RenderDevice::DrawTile(FSceneNode* Frame, FTextureInfo& Info, FLOAT X,
EndTileBuffering();
- clock(TileCycles);
+ cycle(TileCycles);
if (NoAATiles) {
SetDisabledAAState();
@@ -4980,7 +4980,7 @@ void UD3D9RenderDevice::DrawTile(FSceneNode* Frame, FTextureInfo& Info, FLOAT X,
//Advance vertex buffer position
m_curVertexBufferPos += 4;
- unclock(TileCycles);
+ uncycle(TileCycles);
}
unguard;
@@ -5735,7 +5735,7 @@ void UD3D9RenderDevice::SetNoTextureNoCheck(INT Multi) {
guard(UD3D9RenderDevice::SetNoTexture);
// Set small white texture.
- clock(BindCycles);
+ cycle(BindCycles);
//Set texture
m_d3dDevice->SetTexture(Multi, m_pNoTexObj);
@@ -5746,7 +5746,7 @@ void UD3D9RenderDevice::SetNoTextureNoCheck(INT Multi) {
TexInfo[Multi].CurrentCacheID = TEX_CACHE_ID_NO_TEX;
TexInfo[Multi].pBind = NULL;
- unclock(BindCycles);
+ uncycle(BindCycles);
unguard;
}
@@ -5755,7 +5755,7 @@ void UD3D9RenderDevice::SetAlphaTextureNoCheck(INT Multi) {
guard(UD3D9RenderDevice::SetAlphaTexture);
// Set alpha gradient texture.
- clock(BindCycles);
+ cycle(BindCycles);
//Set texture
m_d3dDevice->SetTexture(Multi, m_pAlphaTexObj);
@@ -5766,7 +5766,7 @@ void UD3D9RenderDevice::SetAlphaTextureNoCheck(INT Multi) {
TexInfo[Multi].CurrentCacheID = TEX_CACHE_ID_ALPHA_TEX;
TexInfo[Multi].pBind = NULL;
- unclock(BindCycles);
+ uncycle(BindCycles);
unguard;
}
@@ -5777,7 +5777,7 @@ void UD3D9RenderDevice::SetTextureNoCheck(DWORD texNum, FTexInfo& Tex, FTextureI
guard(UD3D9RenderDevice::SetTexture);
// Make current.
- clock(BindCycles);
+ cycle(BindCycles);
bool isZeroPrefixCacheID = ((Tex.CurrentCacheID & 0xFFFFFFFF00000000) == 0) ? true : false;
@@ -5960,7 +5960,7 @@ void UD3D9RenderDevice::SetTextureNoCheck(DWORD texNum, FTexInfo& Tex, FTextureI
//Set texture
m_d3dDevice->SetTexture(texNum, pBind->pTexObj);
- unclock(BindCycles);
+ uncycle(BindCycles);
// Account for all the impact on scale normalization.
Tex.UMult = pBind->UMult;
@@ -6021,7 +6021,7 @@ void UD3D9RenderDevice::SetTextureNoCheck(DWORD texNum, FTexInfo& Tex, FTextureI
}
// Download the texture.
- clock(ImageCycles);
+ cycle(ImageCycles);
if (pBind->texType == TEX_TYPE_PALETTED) {
// glColorTableEXT(GL_TEXTURE_2D, GL_RGBA, 256, GL_RGBA, GL_UNSIGNED_BYTE, Info.Palette);
@@ -6182,7 +6182,7 @@ void UD3D9RenderDevice::SetTextureNoCheck(DWORD texNum, FTexInfo& Tex, FTextureI
}
unguard;
- unclock(ImageCycles);
+ uncycle(ImageCycles);
//Restore palette index 0 for masked paletted textures
if (Info.Palette && (PolyFlags & PF_Masked)) {
@@ -8411,7 +8411,7 @@ void UD3D9RenderDevice::EndGouraudPolygonBufferingNoCheck(void) {
//Stream state set when start buffering
//Default texture state set when start buffering
- clock(GouraudCycles);
+ cycle(GouraudCycles);
//Set projection state
SetProjectionState(m_requestNearZRangeHackProjection);
@@ -8441,7 +8441,7 @@ void UD3D9RenderDevice::EndGouraudPolygonBufferingNoCheck(void) {
BufferedVerts = 0;
- unclock(GouraudCycles);
+ uncycle(GouraudCycles);
}
void UD3D9RenderDevice::EndTileBufferingNoCheck(void) {
@@ -8455,7 +8455,7 @@ void UD3D9RenderDevice::EndTileBufferingNoCheck(void) {
//Stream state set when start buffering
//Default texture state set when start buffering
- clock(TileCycles);
+ cycle(TileCycles);
//Unlock vertexColor and texCoord0 buffers
UnlockVertexColorBuffer();
@@ -8469,7 +8469,7 @@ void UD3D9RenderDevice::EndTileBufferingNoCheck(void) {
BufferedTileVerts = 0;
- unclock(TileCycles);
+ uncycle(TileCycles);
}
View
16 D3DDrv/Src/Direct3D7.cpp
@@ -740,7 +740,7 @@ class DLL_EXPORT UD3DRenderDevice : public URenderDevice
void DrawComplexSurface( FSceneNode* Frame, FSurfaceInfo& Surface, FSurfaceFacet& Facet )
{
guard(UD3DRenderDevice::DrawComplexSurface);
- clock(Stats.SurfTime);
+ cycle(Stats.SurfTime);
Stats.Surfs++;
// Mutually exclusive effects.
@@ -1098,14 +1098,14 @@ class DLL_EXPORT UD3DRenderDevice : public URenderDevice
if( Surface.PolyFlags & PF_Masked )
Direct3DDevice7->SetRenderState( D3DRENDERSTATE_ZFUNC, D3DCMP_LESSEQUAL );
- unclock(Stats.SurfTime);
+ uncycle(Stats.SurfTime);
unguard;
}
void DrawGouraudPolygon( FSceneNode* Frame, FTextureInfo& Info, FTransTexture** Pts, INT NumPts, DWORD PolyFlags, FSpanBuffer* Span )
{
guard(UD3DRenderDevice::DrawGouraudPolygon);
- clock(Stats.PolyTime);
+ cycle(Stats.PolyTime);
Stats.Polys++;
PolyFlags &= ~PF_Memorized;
@@ -1147,15 +1147,15 @@ class DLL_EXPORT UD3DRenderDevice : public URenderDevice
}
Direct3DDevice7->DrawPrimitiveVB( D3DPT_TRIANGLEFAN, VertsTLWindow.VertexBuffer7, VertsTLWindow.Unlock(), NumPts, 0 );
- unclock(Stats.PolyTime);
+ uncycle(Stats.PolyTime);
unguard;
}
void DrawTile( FSceneNode* Frame, FTextureInfo& Info, FLOAT X, FLOAT Y, FLOAT XL, FLOAT YL, FLOAT U, FLOAT V, FLOAT UL, FLOAT VL, class FSpanBuffer* Span, FLOAT Z, FPlane Color, FPlane Fog, DWORD PolyFlags )
{
guard(UD3DRenderDevice::DrawTile);
- clock(Stats.TileTime);
+ cycle(Stats.TileTime);
Stats.Tiles++;
PolyFlags &= ~PF_Memorized;
@@ -1177,7 +1177,7 @@ class DLL_EXPORT UD3DRenderDevice : public URenderDevice
VB[3].dvSX = X+XL; VB[3].dvSY = Y; VB[3].dvRHW=RZ; VB[3].dvSZ=SZ; VB[3].dvTU[u]=(U + UL)*Stages[0].UScale; VB[3].dvTU[v]=(V )*Stages[0].VScale; VB[3].dcColor=Clr;
Direct3DDevice7->DrawPrimitiveVB( D3DPT_TRIANGLEFAN, VertsTLWindow.VertexBuffer7, VertsTLWindow.Unlock(), 4, 0 );
- unclock(Stats.TileTime);
+ uncycle(Stats.TileTime);
unguard;
}
static HRESULT CALLBACK EnumModesCallback( DDSURFACEDESC2* Desc, void* Context )
@@ -1997,7 +1997,7 @@ class DLL_EXPORT UD3DRenderDevice : public URenderDevice
// Update texture data.
DWORD Cycles=0;
- clock(Cycles);
+ cycle(Cycles);
ti->Filler->PixelFormat->Uploads++;
ti->Filler->BeginUpload( this, ti, Info, PolyFlags );
INT Count = Min(Info.NumMips-ti->FirstMip,ti->Surfaces7.Num());
@@ -2032,7 +2032,7 @@ class DLL_EXPORT UD3DRenderDevice : public URenderDevice
}
if( Info.NumMips!=1 && FAILED(h=Direct3DDevice7->Load(ti->Surfaces7(0),NULL,ti->Pool->SystemSurfaces7(0),NULL,0)) )
appErrorf(TEXT("Failed Load: %s"),*D3DError(h));
- unclock(Cycles);
+ uncycle(Cycles);
ti->Filler->PixelFormat->UploadCycles += Cycles;
if( Thrash )
{
View
16 D3DDrv/Src/und3d.cpp
@@ -588,7 +588,7 @@ class DLL_EXPORT UD3DRenderDevice : public URenderDevice
void DrawComplexSurface( FSceneNode* Frame, FSurfaceInfo& Surface, FSurfaceFacet& Facet )
{
guard(UD3DRenderDevice::DrawComplexSurface);
- clock(Stats.SurfTime);
+ cycle(Stats.SurfTime);
Stats.Surfs++;
// Mutually exclusive effects.
@@ -828,13 +828,13 @@ class DLL_EXPORT UD3DRenderDevice : public URenderDevice
if( Surface.PolyFlags & PF_Masked )
Direct3DDevice->SetRenderState( D3DRENDERSTATE_ZFUNC, D3DCMP_LESSEQUAL );
- unclock(Stats.SurfTime);
+ uncycle(Stats.SurfTime);
unguard;
}
void DrawGouraudPolygon( FSceneNode* Frame, FTextureInfo& Info, FTransTexture** Pts, INT NumPts, DWORD PolyFlags, FSpanBuffer* Span )
{
guard(UD3DRenderDevice::DrawGouraudPolygon);
- clock(Stats.PolyTime);
+ cycle(Stats.PolyTime);
Stats.Polys++;
// Set up verts.
@@ -876,13 +876,13 @@ class DLL_EXPORT UD3DRenderDevice : public URenderDevice
Direct3DDevice->DrawPrimitive( D3DPT_TRIANGLEFAN, D3DFVF_TLVERTEX, Verts, NumPts, D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT | D3DDP_DONOTUPDATEEXTENTS );
Direct3DDevice->SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_MODULATE );
}
- unclock(Stats.PolyTime);
+ uncycle(Stats.PolyTime);
unguard;
}
void DrawTile( FSceneNode* Frame, FTextureInfo& Info, FLOAT X, FLOAT Y, FLOAT XL, FLOAT YL, FLOAT U, FLOAT V, FLOAT UL, FLOAT VL, class FSpanBuffer* Span, FLOAT Z, FPlane Color, FPlane Fog, DWORD PolyFlags )
{
guard(UD3DRenderDevice::DrawTile);
- clock(Stats.TileTime);
+ cycle(Stats.TileTime);
Stats.Tiles++;
if( Info.Palette && Info.Palette[128].A!=255 && !(PolyFlags&PF_Translucent) )
PolyFlags |= PF_Highlighted;
@@ -901,7 +901,7 @@ class DLL_EXPORT UD3DRenderDevice : public URenderDevice
Verts[3].dvSX = X + XL; Verts[3].dvSY = Y; Verts[3].dvRHW = RZ; Verts[3].dvSZ = ProjectionMatrix._33 + ProjectionMatrix._43 * Verts[3].dvRHW; Verts[3].dvTU[u] = (U + UL) * Stages[0].UScale; Verts[3].dvTU[v] = (V ) * Stages[0].VScale; Verts[3].dcColor = Clr;
Direct3DDevice->DrawPrimitive( D3DPT_TRIANGLEFAN, D3DFVF_TLVERTEX, Verts, 4, D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT | D3DDP_DONOTUPDATEEXTENTS );
- unclock(Stats.TileTime);
+ uncycle(Stats.TileTime);
unguard;
}
static HRESULT CALLBACK EnumModesCallback( DDSURFACEDESC2* Desc, void* Context )
@@ -1484,7 +1484,7 @@ class DLL_EXPORT UD3DRenderDevice : public URenderDevice
// Update texture data.
DWORD Cycles=0;
- clock(Cycles);
+ cycle(Cycles);
IDirectDrawSurface4* LockSurface = ti->Pool->SystemSurface ? ti->Pool->SystemSurface : ti->Surface;
IDirectDrawSurface4* BltSurface = ti->Surface;//Info.NumMips==1 ? ti->Surface : NULL;
ti->Filler->PixelFormat->Uploads++;
@@ -1519,7 +1519,7 @@ class DLL_EXPORT UD3DRenderDevice : public URenderDevice
if( ti->Pool->SystemSurface && !BltSurface && FAILED(h=ti->Texture->Load(ti->Pool->SystemTexture)) )
appErrorf(TEXT("Failed Load: %s"),*D3DError(h));
ti->Filler->EndUpload( this, ti, Info, PolyFlags );
- unclock(Cycles);
+ uncycle(Cycles);
ti->Filler->PixelFormat->UploadCycles += Cycles;
if( Thrash )
{
View
36 OpenGLDrv/Src/OpenGL.cpp
@@ -3061,7 +3061,7 @@ void UOpenGLRenderDevice::DrawComplexSurface(FSceneNode* Frame, FSurfaceInfo& Su
return;
}
- clock(ComplexCycles);
+ cycle(ComplexCycles);
//Calculate UDot and VDot intermediates for complex surface
m_csUDot = Facet.MapCoords.XAxis | Facet.MapCoords.Origin;
@@ -3240,7 +3240,7 @@ void UOpenGLRenderDevice::DrawComplexSurface(FSceneNode* Frame, FSurfaceInfo& Su
glDepthFunc((GLenum)ZTrickFunc);
}
- unclock(ComplexCycles);
+ uncycle(ComplexCycles);
unguard;
}
@@ -3346,7 +3346,7 @@ void UOpenGLRenderDevice::PostDrawGouraud(FLOAT FogDistance) {
void UOpenGLRenderDevice::DrawGouraudPolygonOld(FSceneNode* Frame, FTextureInfo& Info, FTransTexture** Pts, INT NumPts, DWORD PolyFlags, FSpanBuffer* Span) {
guard(UOpenGLRenderDevice::DrawGouraudPolygonOld);
UTGLR_DEBUG_CALL_COUNT(DrawGouraudPolygonOld);
- clock(GouraudCycles);
+ cycle(GouraudCycles);
//Decide if should request near Z range hack projection
bool requestNearZRangeHackProjection = false;
@@ -3431,7 +3431,7 @@ void UOpenGLRenderDevice::DrawGouraudPolygonOld(FSceneNode* Frame, FTextureInfo&
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
#endif
- unclock(GouraudCycles);
+ uncycle(GouraudCycles);
unguard;
}
@@ -3864,7 +3864,7 @@ void UOpenGLRenderDevice::DrawTile(FSceneNode* Frame, FTextureInfo& Info, FLOAT
else {
EndTileBuffering();
- clock(TileCycles);
+ cycle(TileCycles);
if (NoAATiles) {
SetDisabledAAState();
@@ -3936,7 +3936,7 @@ void UOpenGLRenderDevice::DrawTile(FSceneNode* Frame, FTextureInfo& Info, FLOAT
glEnd();
- unclock(TileCycles);
+ uncycle(TileCycles);
}
unguard;
@@ -4486,15 +4486,15 @@ void UOpenGLRenderDevice::SetNoTextureNoCheck(INT Multi) {
guard(UOpenGLRenderDevice::SetNoTexture);
// Set small white texture.
- clock(BindCycles);
+ cycle(BindCycles);
//Set texture
glBindTexture(GL_TEXTURE_2D, m_noTextureId);
TexInfo[Multi].CurrentCacheID = TEX_CACHE_ID_NO_TEX;
TexInfo[Multi].pBind = NULL;
- unclock(BindCycles);
+ uncycle(BindCycles);
unguard;
}
@@ -4503,15 +4503,15 @@ void UOpenGLRenderDevice::SetAlphaTextureNoCheck(INT Multi) {
guard(UOpenGLRenderDevice::SetAlphaTexture);
// Set alpha gradient texture.
- clock(BindCycles);
+ cycle(BindCycles);
//Set texture
glBindTexture(GL_TEXTURE_2D, m_alphaTextureId);
TexInfo[Multi].CurrentCacheID = TEX_CACHE_ID_ALPHA_TEX;
TexInfo[Multi].pBind = NULL;
- unclock(BindCycles);
+ uncycle(BindCycles);
unguard;
}
@@ -4650,7 +4650,7 @@ void UOpenGLRenderDevice::SetTextureNoCheck(FTexInfo& Tex, FTextureInfo& Info, D
guard(UOpenGLRenderDevice::SetTexture);
// Make current.
- clock(BindCycles);
+ cycle(BindCycles);
//Search for texture in cache
FCachedTexture *pBind;
@@ -4800,7 +4800,7 @@ void UOpenGLRenderDevice::SetTextureNoCheck(FTexInfo& Tex, FTextureInfo& Info, D
//Set texture
glBindTexture(GL_TEXTURE_2D, pBind->Id);
- unclock(BindCycles);
+ uncycle(BindCycles);
// Account for all the impact on scale normalization.
Tex.UMult = pBind->UMult;
@@ -4855,7 +4855,7 @@ void UOpenGLRenderDevice::UploadTextureExec(FTextureInfo& Info, DWORD PolyFlags,
}
// Download the texture.
- clock(ImageCycles);
+ cycle(ImageCycles);
if (pBind->texType == TEX_TYPE_PALETTED) {
glColorTableEXT(GL_TEXTURE_2D, GL_RGBA, 256, GL_RGBA, GL_UNSIGNED_BYTE, Info.Palette);
@@ -5114,7 +5114,7 @@ void UOpenGLRenderDevice::UploadTextureExec(FTextureInfo& Info, DWORD PolyFlags,
m_texComposeMemMark.Pop();
}
- unclock(ImageCycles);
+ uncycle(ImageCycles);
//Restore palette index 0 for masked paletted textures
if (Info.Palette && (PolyFlags & PF_Masked)) {
@@ -7266,7 +7266,7 @@ void UOpenGLRenderDevice::EndGouraudPolygonBufferingNoCheck(void) {
//Shader state set when start buffering
//Default texture state set when start buffering
- clock(GouraudCycles);
+ cycle(GouraudCycles);
//Set projection state
SetProjectionState(m_requestNearZRangeHackProjection);
@@ -7287,7 +7287,7 @@ void UOpenGLRenderDevice::EndGouraudPolygonBufferingNoCheck(void) {
BufferedVerts = 0;
- unclock(GouraudCycles);
+ uncycle(GouraudCycles);
}
void UOpenGLRenderDevice::EndTileBufferingNoCheck(void) {
@@ -7302,7 +7302,7 @@ void UOpenGLRenderDevice::EndTileBufferingNoCheck(void) {
//Shader state set when start buffering
//Default texture state set when start buffering
- clock(TileCycles);
+ cycle(TileCycles);
//Set color state
SetColorState();
@@ -7312,7 +7312,7 @@ void UOpenGLRenderDevice::EndTileBufferingNoCheck(void) {
BufferedTileVerts = 0;
- unclock(TileCycles);
+ uncycle(TileCycles);
}

0 comments on commit 9a8e7ac

Please sign in to comment.
Something went wrong with that request. Please try again.