Skip to content

Commit

Permalink
Format cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ayuanx committed Apr 7, 2022
1 parent 5a8c8e8 commit eb2aea9
Show file tree
Hide file tree
Showing 16 changed files with 321 additions and 368 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ Tip: If the game is not utilizing DirectDraw 8-bit (256 colors) palette mode, th

# Revisions:

v.2022.04.06:
- Configurable flip and throttle.
v.2022.04.07:
- Configurable flip, buffer and throttle.
- Improve performance.
- Improve compatibility.
- Proper release sequence.
Expand Down
26 changes: 13 additions & 13 deletions classfactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@ namespace classfactory
{
struct XVTBL
{
HRESULT (__stdcall * QueryInterface)( WRAP* This, const IID& riid, void** ppvObject );
ULONG (__stdcall * AddRef)( WRAP* This );
ULONG (__stdcall * Release)( WRAP* This );
HRESULT (__stdcall * QueryInterface)( WRAP* This, const IID& riid, void** ppvObject );
ULONG (__stdcall * AddRef)( WRAP* This );
ULONG (__stdcall * Release)( WRAP* This );
HRESULT (__stdcall * CreateInstance)( WRAP* This, IUnknown *pUnkOuter, REFIID riid, void **ppvObject );
HRESULT (__stdcall * LockServer)( WRAP* This, BOOL fLock );
};

HRESULT __stdcall QueryInterface( WRAP* This, const IID& riid, void** ppvObject )
{
HRESULT __stdcall QueryInterface( WRAP* This, const IID& riid, void** ppvObject )
{
PROLOGUE;
HRESULT hResult = This->cf->lpVtbl->QueryInterface( This->cf, riid, ppvObject );
if( SUCCEEDED( hResult ) ) Wrap( This->dd_parent, iid_to_vtbl( riid ), ppvObject );
EPILOGUE( hResult );
}

ULONG __stdcall AddRef( WRAP* This )
{
ULONG __stdcall AddRef( WRAP* This )
{
PROLOGUE;
ULONG dwCount = This->cf->lpVtbl->AddRef( This->cf );
EPILOGUE( dwCount );
}

ULONG __stdcall Release( WRAP* This )
ULONG __stdcall Release( WRAP* This )
{
PROLOGUE;
ULONG dwCount = WrapRelease( This );
Expand All @@ -46,14 +46,14 @@ namespace classfactory
PROLOGUE;
HRESULT hResult = This->cf->lpVtbl->LockServer( This->cf, fLock );
EPILOGUE( hResult );
}
}

const XVTBL xVtbl =
{
const XVTBL xVtbl =
{
QueryInterface, // 0x00
AddRef, // 0x04
Release, // 0x08
CreateInstance, // 0x0C
LockServer // 0x10
LockServer, // 0x10
};
};
};
34 changes: 17 additions & 17 deletions clipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ namespace clipper
{
struct XVTBL
{
HRESULT (__stdcall * QueryInterface)( WRAP* This, const IID& riid, void** ppvObject );
ULONG (__stdcall * AddRef)( WRAP* This );
ULONG (__stdcall * Release)( WRAP* This );
HRESULT (__stdcall * QueryInterface)( WRAP* This, const IID& riid, void** ppvObject );
ULONG (__stdcall * AddRef)( WRAP* This );
ULONG (__stdcall * Release)( WRAP* This );
HRESULT (__stdcall * GetClipList)( WRAP* This, LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSize );
HRESULT (__stdcall * GetHWnd)( WRAP* This, HWND* lphWnd );
HRESULT (__stdcall * Initialize)( WRAP* This, LPDIRECTDRAW lpDD, DWORD dwFlags );
Expand All @@ -15,72 +15,72 @@ namespace clipper
HRESULT (__stdcall * SetHWnd)( WRAP* This, DWORD dwFlags, HWND hWnd );
};

HRESULT __stdcall QueryInterface( WRAP* This, const IID& riid, void** ppvObject )
{
HRESULT __stdcall QueryInterface( WRAP* This, const IID& riid, void** ppvObject )
{
PROLOGUE;
HRESULT hResult = This->clip->lpVtbl->QueryInterface( This->clip, riid, ppvObject );
if( SUCCEEDED( hResult ) ) Wrap( This->dd_parent, iid_to_vtbl( riid ), ppvObject );
EPILOGUE( hResult );
}

ULONG __stdcall AddRef( WRAP* This )
{
ULONG __stdcall AddRef( WRAP* This )
{
PROLOGUE;
ULONG dwCount = This->clip->lpVtbl->AddRef( This->clip );
EPILOGUE( dwCount );
}

ULONG __stdcall Release( WRAP* This )
ULONG __stdcall Release( WRAP* This )
{
PROLOGUE;
ULONG dwCount = WrapRelease( This );
EPILOGUE( dwCount );
}

HRESULT __stdcall GetClipList( WRAP* This, LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSize )
HRESULT __stdcall GetClipList( WRAP* This, LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSize )
{
PROLOGUE;
HRESULT hResult = This->clip->lpVtbl->GetClipList( This->clip, lpRect, lpClipList, lpdwSize );
EPILOGUE( hResult );
}

HRESULT __stdcall GetHWnd( WRAP* This, HWND* lphWnd )
HRESULT __stdcall GetHWnd( WRAP* This, HWND* lphWnd )
{
PROLOGUE;
HRESULT hResult = This->clip->lpVtbl->GetHWnd( This->clip, lphWnd );
EPILOGUE( hResult );
}

HRESULT __stdcall Initialize( WRAP* This, LPDIRECTDRAW lpDD, DWORD dwFlags )
HRESULT __stdcall Initialize( WRAP* This, LPDIRECTDRAW lpDD, DWORD dwFlags )
{
PROLOGUE;
HRESULT hResult = This->clip->lpVtbl->Initialize( This->clip, GetInnerInterface( lpDD ), dwFlags );
EPILOGUE( hResult );
}

HRESULT __stdcall IsClipListChanged( WRAP* This, BOOL* lpbChanged )
HRESULT __stdcall IsClipListChanged( WRAP* This, BOOL* lpbChanged )
{
PROLOGUE;
HRESULT hResult = This->clip->lpVtbl->IsClipListChanged( This->clip, lpbChanged );
EPILOGUE( hResult );
}

HRESULT __stdcall SetClipList( WRAP* This, LPRGNDATA lpClipList, DWORD dwFlags )
HRESULT __stdcall SetClipList( WRAP* This, LPRGNDATA lpClipList, DWORD dwFlags )
{
PROLOGUE;
HRESULT hResult = This->clip->lpVtbl->SetClipList( This->clip, lpClipList, dwFlags );
EPILOGUE( hResult );
}

HRESULT __stdcall SetHWnd( WRAP* This, DWORD dwFlags, HWND hWnd )
HRESULT __stdcall SetHWnd( WRAP* This, DWORD dwFlags, HWND hWnd )
{
PROLOGUE;
HRESULT hResult = This->clip->lpVtbl->SetHWnd( This->clip, dwFlags, hWnd );
EPILOGUE( hResult );
}

const XVTBL xVtbl =
{
const XVTBL xVtbl =
{
QueryInterface, // 0x00
AddRef, // 0x04
Release, // 0x08
Expand All @@ -89,6 +89,6 @@ namespace clipper
Initialize, // 0x14
IsClipListChanged, // 0x18
SetClipList, // 0x1C
SetHWnd // 0x20
SetHWnd, // 0x20
};
};
28 changes: 14 additions & 14 deletions color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,55 +4,55 @@ namespace color
{
struct XVTBL
{
HRESULT (__stdcall * QueryInterface)( WRAP* This, const IID& riid, void** ppvObject );
ULONG (__stdcall * AddRef)( WRAP* This );
ULONG (__stdcall * Release)( WRAP* This );
HRESULT (__stdcall * QueryInterface)( WRAP* This, const IID& riid, void** ppvObject );
ULONG (__stdcall * AddRef)( WRAP* This );
ULONG (__stdcall * Release)( WRAP* This );
HRESULT (__stdcall * GetColorControls)( WRAP* This, LPDDCOLORCONTROL lpColorControl );
HRESULT (__stdcall * SetColorControls)( WRAP* This, LPDDCOLORCONTROL lpColorControl );
};

HRESULT __stdcall QueryInterface( WRAP* This, const IID& riid, void** ppvObject )
{
HRESULT __stdcall QueryInterface( WRAP* This, const IID& riid, void** ppvObject )
{
PROLOGUE;
HRESULT hResult = This->color->lpVtbl->QueryInterface( This->color, riid, ppvObject );
if( SUCCEEDED( hResult ) ) Wrap( This->dd_parent, iid_to_vtbl( riid ), ppvObject );
EPILOGUE( hResult );
}

ULONG __stdcall AddRef( WRAP* This )
{
ULONG __stdcall AddRef( WRAP* This )
{
PROLOGUE;
ULONG dwCount = This->color->lpVtbl->AddRef( This->color );
EPILOGUE( dwCount );
}

ULONG __stdcall Release( WRAP* This )
ULONG __stdcall Release( WRAP* This )
{
PROLOGUE;
ULONG dwCount = WrapRelease( This );
EPILOGUE( dwCount );
}

HRESULT __stdcall GetColorControls( WRAP* This, LPDDCOLORCONTROL lpColorControl )
{
{
PROLOGUE;
HRESULT hResult = This->color->lpVtbl->GetColorControls( This->color, lpColorControl );
EPILOGUE( hResult );
}

HRESULT __stdcall SetColorControls( WRAP* This, LPDDCOLORCONTROL lpColorControl )
{
{
PROLOGUE;
HRESULT hResult = This->color->lpVtbl->SetColorControls( This->color, lpColorControl );
EPILOGUE( hResult );
}

const XVTBL xVtbl =
{
const XVTBL xVtbl =
{
QueryInterface, // 0x00
AddRef, // 0x04
Release, // 0x08
GetColorControls, // 0x0C
SetColorControls, // 0x10
};
};
};
Loading

0 comments on commit eb2aea9

Please sign in to comment.