mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-11 18:41:14 +00:00
* d3drm: store LPVOID data instead of DWORD * m_extraCharacterId is an integer, not a pointer * cmake: look for iniparser using config file first, then try our custom module file Our custom module file is still useful. My linux distro does not package the cmake files. * x86's stdcall becomes MS's x64 calling canvention * Fix 64-bit mxdsbuffer pointer arithmetic * Casting from void* to a smaller-sized integer needs an intermediate equally-sized integer * Don't cast address to scalar (this is fishy) * Add mingw64 build to the ci matrix * Ignore -Wdiscarded-qualifiers warning with const vtables * Ignore different 'const' qualifiers with MSVC * Create d3dxof import library for MSVC * DESCRIPTION in .def file(s) is deprecated * Assume mmx is supported on x64, require a test for x86 and disabled on other archs * 32- and 64-bit LEGO1.dll export different symbol names * Introduce d3drm_guid containing the guids of d3drm * Disable __wine_dbg_cdecl * Include d3drm directory with EXCLUDE_FROM_ALL * lego1 leaks d3drm headers * Add dxfile.h * Add 64-bit MSVC to the build matrix * cmake: using ISLE_USE_DX5 means going all-in * Load d3dxof.dll dynamically * cmake: don't emit a warning about bitness anymore
33 lines
972 B
C
33 lines
972 B
C
#include "dyn_d3dxof.h"
|
|
|
|
static enum {
|
|
DYN_D3DXOF_INIT = 0,
|
|
DYN_D3DXOF_SUCCESS = 1,
|
|
} g_dyn_d3dxof_state = DYN_D3DXOF_INIT;
|
|
static HMODULE g_d3dxof;
|
|
static HRESULT (STDAPICALLTYPE * g_DynamicDirectXFileCreate)(LPDIRECTXFILE *lplpDirectXFile);
|
|
|
|
static void init_dyn_d3d(void) {
|
|
if (g_dyn_d3dxof_state == DYN_D3DXOF_SUCCESS) {
|
|
return;
|
|
}
|
|
g_d3dxof = LoadLibraryA("d3dxof.dll");
|
|
if (g_d3dxof == NULL) {
|
|
MessageBoxA(NULL, "Cannot find d3dxof.dll", "Cannot find d3dxof.dll", MB_ICONERROR);
|
|
abort();
|
|
}
|
|
g_DynamicDirectXFileCreate = (void*)GetProcAddress(g_d3dxof, "DirectXFileCreate");
|
|
if (g_d3dxof == NULL) {
|
|
MessageBoxA(NULL, "Missing symbols", "d3dxof.dll misses DirectXFileCreate", MB_ICONERROR);
|
|
abort();
|
|
}
|
|
g_dyn_d3dxof_state = DYN_D3DXOF_SUCCESS;
|
|
}
|
|
|
|
|
|
STDAPI DynamicDirectXFileCreate(LPDIRECTXFILE *lplpDirectXFile)
|
|
{
|
|
init_dyn_d3d();
|
|
return g_DynamicDirectXFileCreate(lplpDirectXFile);
|
|
}
|