mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-22 23:48:12 -05:00
659a54b221
Some checks are pending
Build / Current ${{ matrix.toolchain.name }} (map[clang-tidy:true d3drm-from-wine:true dx5-libs:false msys-env:mingw-w64-i686 msystem:mingw32 name:msys2 mingw32 shell:msys2 {0} werror:true]) (push) Waiting to run
Build / Current ${{ matrix.toolchain.name }} (map[clang-tidy:true d3drm-from-wine:true dx5-libs:false msys-env:mingw-w64-x86_64 msystem:mingw64 name:msys2 mingw64 shell:msys2 {0} werror:true]) (push) Waiting to run
Build / Current ${{ matrix.toolchain.name }} (map[d3drm-from-wine:false dx5-libs:true name:MSVC (32-bit) setup-cmake:true setup-msvc:true setup-ninja:true shell:sh vc-arch:amd64_x86]) (push) Waiting to run
Build / Current ${{ matrix.toolchain.name }} (map[d3drm-from-wine:true dx5-libs:false name:MSVC (64-bit) setup-cmake:true setup-msvc:true setup-ninja:true shell:sh vc-arch:amd64]) (push) Waiting to run
Format / C++ (push) Waiting to run
Naming / C++ (push) Waiting to run
* 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
32 lines
972 B
C
32 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);
|
|
}
|