DXGL r392 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r391‎ | r392 | r393 >
Date:15:18, 1 July 2013
Author:admin
Status:new
Tags:
Comment:
First attempt at GetScanLine and GetVerticalBlankStatus emulation.
Modified paths:
  • /ddraw/glDirectDraw.cpp (modified) (history)
  • /ddraw/glRenderer.cpp (modified) (history)
  • /ddraw/glRenderer.h (modified) (history)

Diff [purge]

Index: ddraw/glDirectDraw.cpp
@@ -1097,9 +1097,13 @@
10981098 TRACE_ENTER(2,14,this,14,lpdwScanLine);
10991099 if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11001100 if(!lpdwScanLine) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
1101 - FIXME("IDirectDraw::GetScanLine: stub\n");
1102 - TRACE_EXIT(23,DDERR_GENERIC);
1103 - ERR(DDERR_GENERIC);
 1101+ if(!renderer) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
 1102+ if(!primary) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
 1103+ if(!initialized) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
 1104+ *lpdwScanLine = renderer->GetScanLine();
 1105+ if(*lpdwScanLine > primary->fakey) TRACE_RET(HRESULT,23,DDERR_VERTICALBLANKINPROGRESS);
 1106+ TRACE_EXIT(23,DD_OK);
 1107+ return DD_OK;
11041108 }
11051109 HRESULT WINAPI glDirectDraw7::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
11061110 {
@@ -1106,9 +1110,13 @@
11071111 TRACE_ENTER(2,14,this,14,lpbIsInVB);
11081112 if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
11091113 if(!lpbIsInVB) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
1110 - FIXME("IDirectDraw::GetVerticalBlankStatus: stub\n");
1111 - TRACE_EXIT(23,DDERR_GENERIC);
1112 - ERR(DDERR_GENERIC);
 1114+ if(!renderer) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
 1115+ if(!primary) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
 1116+ if(!initialized) TRACE_RET(HRESULT,23,DDERR_NOTINITIALIZED);
 1117+ if(renderer->GetScanLine() > primary->fakey) *lpbIsInVB = TRUE;
 1118+ else *lpbIsInVB = FALSE;
 1119+ TRACE_EXIT(23,DD_OK);
 1120+ return DD_OK;
11131121 }
11141122 HRESULT WINAPI glDirectDraw7::Initialize(GUID FAR *lpGUID)
11151123 {
Index: ddraw/glRenderer.cpp
@@ -608,6 +608,11 @@
609609 LeaveCriticalSection(&cs);
610610 }
611611
 612+unsigned int glRenderer::GetScanLine()
 613+{
 614+ return timer.GetScanLine();
 615+}
 616+
612617 /**
613618 * Main loop for glRenderer class
614619 * @return
Index: ddraw/glRenderer.h
@@ -107,6 +107,7 @@
108108 HRESULT DrawPrimitives(glDirect3DDevice7 *device, GLenum mode, GLVERTEX *vertices, int *texformats, DWORD count, LPWORD indices,
109109 DWORD indexcount, DWORD flags);
110110 void DeleteFBO(FBO *fbo);
 111+ unsigned int GetScanLine();
111112 HGLRC hRC;
112113 GLCAPS gl_caps;
113114 private: