Minor code formatting:

First step to bring a level of consistency between the video plug-ins - variable names, spacing, function names, function order, comments, file names.  This will help us identify common code for VideoMerge.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6235 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
skidau
2010-09-28 02:15:02 +00:00
parent 73f4bc4598
commit 88cd9f3df1
50 changed files with 1713 additions and 1555 deletions

View File

@ -73,7 +73,7 @@ GFXConfigDialogOGL *m_ConfigFrame = NULL;
#include "GLUtil.h"
#include "Fifo.h"
#include "OpcodeDecoding.h"
#include "TextureMngr.h"
#include "TextureCache.h"
#include "BPStructs.h"
#include "VertexLoader.h"
#include "VertexLoaderManager.h"
@ -109,6 +109,16 @@ static volatile u32 s_doStateRequested = FALSE;
static u32 s_efbAccessRequested = FALSE;
static volatile u32 s_FifoShuttingDown = FALSE;
static volatile struct
{
u32 xfbAddr;
FieldType field;
u32 fbWidth;
u32 fbHeight;
} s_beginFieldArgs;
static volatile EFBAccessType s_AccessEFBType;
bool IsD3D()
{
return false;
@ -191,7 +201,8 @@ void Initialize(void *init)
// Now the window handle is written
_pVideoInitialize->pWindowHandle = g_VideoInitialize.pWindowHandle;
OSD::AddMessage("Dolphin OpenGL Video Plugin", 5000);
OSD::AddMessage("Dolphin Direct3D9 Video Plugin.", 5000);
s_PluginInitialized = true;
}
static volatile struct
@ -207,7 +218,7 @@ static void check_DoState() {
{
#endif
// Clear all caches that touch RAM
TextureMngr::Invalidate(false);
TextureCache::Invalidate(false);
VertexLoaderManager::MarkAllDirty();
PointerWrap p(s_doStateArgs.ptr, s_doStateArgs.mode);
@ -259,14 +270,14 @@ void Video_Prepare(void)
exit(1);
}
s_swapRequested = FALSE;
s_efbAccessRequested = FALSE;
s_FifoShuttingDown = FALSE;
s_swapRequested = FALSE;
CommandProcessor::Init();
PixelEngine::Init();
TextureMngr::Init();
TextureCache::Init();
BPInit();
VertexManager::Init();
@ -289,14 +300,13 @@ void Video_Prepare(void)
INFO_LOG(VIDEO, "Video plugin initialized.");
}
void Shutdown(void)
void Shutdown()
{
s_PluginInitialized = false;
s_PluginInitialized = false;
s_efbAccessRequested = FALSE;
s_swapRequested = FALSE;
s_FifoShuttingDown = FALSE;
s_swapRequested = FALSE;
DLCache::Shutdown();
Fifo_Shutdown();
PostProcessing::Shutdown();
@ -310,7 +320,7 @@ void Shutdown(void)
PixelShaderManager::Shutdown();
PixelShaderCache::Shutdown();
VertexManager::Shutdown();
TextureMngr::Shutdown();
TextureCache::Shutdown();
OpcodeDecoder_Shutdown();
Renderer::Shutdown();
OpenGL_Shutdown();
@ -325,35 +335,14 @@ void Video_EnterLoop()
void Video_ExitLoop()
{
Fifo_ExitLoop();
s_FifoShuttingDown = TRUE;
}
// Screenshot and screen message
void Video_Screenshot(const char *_szFilename)
{
Renderer::SetScreenshot(_szFilename);
}
void Video_AddMessage(const char* pstr, u32 milliseconds)
{
OSD::AddMessage(pstr, milliseconds);
}
void Video_SetRendering(bool bEnabled)
{
Fifo_SetRendering(bEnabled);
}
static volatile struct
{
u32 xfbAddr;
FieldType field;
u32 fbWidth;
u32 fbHeight;
} s_beginFieldArgs;
// Run from the graphics thread (from Fifo.cpp)
void VideoFifo_CheckSwapRequest()
{
@ -388,14 +377,14 @@ void VideoFifo_CheckSwapRequestAt(u32 xfbAddr, u32 fbWidth, u32 fbHeight)
if (addrRangesOverlap(aLower, aUpper, bLower, bUpper))
VideoFifo_CheckSwapRequest();
}
}
}
}
// Run from the CPU thread (from VideoInterface.cpp)
void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
{
if (s_PluginInitialized && g_ActiveConfig.bUseXFB)
{
{
if (g_VideoInitialize.bOnThread)
{
while (Common::AtomicLoadAcquire(s_swapRequested) && !s_FifoShuttingDown)
@ -403,7 +392,7 @@ void Video_BeginField(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
Common::YieldCPU();
}
else
VideoFifo_CheckSwapRequest();
VideoFifo_CheckSwapRequest();
s_beginFieldArgs.xfbAddr = xfbAddr;
s_beginFieldArgs.field = field;
s_beginFieldArgs.fbWidth = fbWidth;
@ -418,6 +407,17 @@ void Video_EndField()
{
}
void Video_AddMessage(const char* pstr, u32 milliseconds)
{
OSD::AddMessage(pstr, milliseconds);
}
// Screenshot
void Video_Screenshot(const char *_szFilename)
{
Renderer::SetScreenshot(_szFilename);
}
static struct
{
EFBAccessType type;
@ -446,6 +446,7 @@ u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData)
s_accessEFBArgs.x = x;
s_accessEFBArgs.y = y;
s_accessEFBArgs.Data = InputData;
Common::AtomicStoreRelease(s_efbAccessRequested, TRUE);
if (g_VideoInitialize.bOnThread)
@ -496,7 +497,7 @@ void Video_PixelEngineWrite32(const u32 _Data, const u32 _Address)
PixelEngine::Write32(_Data, _Address);
}
void Video_GatherPipeBursted(void)
inline void Video_GatherPipeBursted(void)
{
CommandProcessor::GatherPipeBursted();
}