mirror of
https://github.com/isledecomp/isle.git
synced 2025-12-09 23:53:02 +00:00
Backports of isle-portable x64 fixes (#1044)
* Introduce LPD3DRM_APPDATA typedef for setting d3drm appdata * Fix warning about assigning const string literals to variable char pointers * Don't cast pointers to integers on non-32-bit architectures * memset 2nd argument is int * Assume cpuid is available on x86_64, needs testing on i386 and unavailable on anything else * Store HFILE in its own member variable
This commit is contained in:
committed by
GitHub
parent
62307e1819
commit
8113a17167
@@ -5,6 +5,12 @@
|
||||
|
||||
#include <d3drm.h>
|
||||
|
||||
#ifdef DIRECTX5_SDK
|
||||
typedef DWORD LPD3DRM_APPDATA;
|
||||
#else
|
||||
typedef LPVOID LPD3DRM_APPDATA;
|
||||
#endif
|
||||
|
||||
// Forward declare D3D types
|
||||
struct IDirect3DRM2;
|
||||
struct IDirect3DRMDevice2;
|
||||
|
||||
@@ -15,16 +15,16 @@ void TextureDestroyCallback(IDirect3DRMObject* pObject, void* pArg);
|
||||
// FUNCTION: LEGO1 0x100a12a0
|
||||
Result TextureImpl::SetImage(IDirect3DRMTexture* pSelf, TglD3DRMIMAGE* pImage)
|
||||
{
|
||||
unsigned long appData;
|
||||
void* appData;
|
||||
Result result;
|
||||
|
||||
appData = reinterpret_cast<unsigned long>(pImage);
|
||||
appData = pImage;
|
||||
|
||||
// This is here because in the original code they asserted
|
||||
// on the return value being NULL.
|
||||
TextureGetImage(pSelf);
|
||||
|
||||
result = ResultVal(pSelf->SetAppData(appData));
|
||||
result = ResultVal(pSelf->SetAppData((LPD3DRM_APPDATA) appData));
|
||||
if (Succeeded(result) && pImage) {
|
||||
result = ResultVal(pSelf->AddDestroyCallback(TextureDestroyCallback, NULL));
|
||||
if (!Succeeded(result)) {
|
||||
|
||||
@@ -50,7 +50,7 @@ Result ViewImpl::ViewportCreateAppData(IDirect3DRM2* pDevice, IDirect3DRMViewpor
|
||||
{
|
||||
ViewportAppData* data = new ViewportAppData(pDevice);
|
||||
data->m_pCamera = pCamera;
|
||||
Result result = ResultVal(pView->SetAppData(reinterpret_cast<unsigned long>(data)));
|
||||
Result result = ResultVal(pView->SetAppData(reinterpret_cast<LPD3DRM_APPDATA>(data)));
|
||||
if (Succeeded(result)) {
|
||||
result = ResultVal(pView->AddDestroyCallback(ViewportDestroyCallback, data));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user