Build d3drm-wine with 32-bit mingw

This commit is contained in:
Anonymous Maarten 2024-06-23 01:08:55 +02:00
parent ca73187412
commit 6cb0b2fad5
5 changed files with 73 additions and 3 deletions

30
3rdparty/d3drm/CMakeLists.txt vendored Normal file
View File

@ -0,0 +1,30 @@
enable_language(C)
enable_language(RC)
add_library(d3drm-wine SHARED
d3drm.c
d3drm_main.c
d3drm_private.h
d3drm.spec
device.c
face.c
frame.c
light.c
material.c
math.c
meshbuilder.c
texture.c
version.rc
viewport.c
d3drm.def
)
target_link_libraries(d3drm-wine PRIVATE d3dxof ddraw)
set_property(TARGET d3drm-wine PROPERTY PREFIX "")
set_property(TARGET d3drm-wine PROPERTY OUTPUT_NAME "d3drm")
target_compile_definitions(d3drm-wine PRIVATE "__WINESRC__")
target_compile_definitions(d3drm-wine PRIVATE "WINE_NO_TRACE_MSGS")
target_compile_definitions(d3drm-wine PRIVATE "WINE_NO_DEBUG_MSGS")
target_compile_definitions(d3drm-wine PRIVATE "DECLSPEC_EXPORT=")

View File

@ -1400,7 +1400,7 @@ static HRESULT WINAPI d3drm3_CreateObject(IDirect3DRM3 *iface,
return E_NOTIMPL;
}
for (i = 0; i < ARRAY_SIZE(object_table); ++i)
for (i = 0; i < ARRAYSIZE(object_table); ++i)
{
if (IsEqualGUID(clsid, object_table[i].clsid))
{
@ -1412,7 +1412,7 @@ static HRESULT WINAPI d3drm3_CreateObject(IDirect3DRM3 *iface,
break;
}
}
if (i == ARRAY_SIZE(object_table))
if (i == ARRAYSIZE(object_table))
{
FIXME("%s not implemented. Returning CLASSFACTORY_E_FIRST.\n", debugstr_guid(clsid));
*out = NULL;

22
3rdparty/d3drm/d3drm.def vendored Normal file
View File

@ -0,0 +1,22 @@
EXPORTS
D3DRMColorGetAlpha@4
D3DRMColorGetBlue@4
D3DRMColorGetGreen@4
D3DRMColorGetRed@4
D3DRMCreateColorRGB@12
D3DRMCreateColorRGBA@16
D3DRMMatrixFromQuaternion@8
D3DRMQuaternionFromRotation@12
D3DRMQuaternionMultiply@12
D3DRMQuaternionSlerp@16
D3DRMVectorAdd@12
D3DRMVectorCrossProduct@12
D3DRMVectorDotProduct@8
D3DRMVectorModulus@4
D3DRMVectorNormalize@4
D3DRMVectorRandom@4
D3DRMVectorReflect@12
D3DRMVectorRotate@16
D3DRMVectorScale@12
D3DRMVectorSubtract@12
Direct3DRMCreate@4

View File

@ -129,6 +129,7 @@ extern DECLSPEC_EXPORT int __cdecl __wine_dbg_header( enum __wine_debug_class cl
# define __wine_dbg_cdecl
#endif
#if 0
static const char * __wine_dbg_cdecl wine_dbg_vsprintf( const char *format, va_list args ) __WINE_PRINTF_ATTR(1,0);
static inline const char * __wine_dbg_cdecl wine_dbg_vsprintf( const char *format, va_list args )
{
@ -475,6 +476,7 @@ static inline const char *wine_dbgstr_variant( const VARIANT *v )
return wine_dbg_sprintf( "%p {vt %s}", v, wine_dbgstr_vt(V_VT(v)) );
}
}
#endif
#endif /* defined(__oaidl_h__) && defined(V_VT) */
@ -513,6 +515,7 @@ static inline const char *wine_dbgstr_variant( const VARIANT *v )
#ifdef __WINESRC__
/* Wine uses shorter names that are very likely to conflict with other software */
#if 0
static inline const char *debugstr_an( const char * s, int n ) { return wine_dbgstr_an( s, n ); }
static inline const char *debugstr_wn( const WCHAR *s, int n ) { return wine_dbgstr_wn( s, n ); }
static inline const char *debugstr_guid( const struct _GUID *id ) { return wine_dbgstr_guid(id); }
@ -528,6 +531,7 @@ static inline const char *debugstr_hstring( struct HSTRING__ *s ) { return wine_
static inline const char *debugstr_vt( VARTYPE vt ) { return wine_dbgstr_vt( vt ); }
static inline const char *debugstr_variant( const VARIANT *v ) { return wine_dbgstr_variant( v ); }
#endif
#endif
#define TRACE WINE_TRACE
#define TRACE_(ch) WINE_TRACE_(ch)
@ -541,10 +545,16 @@ static inline const char *debugstr_variant( const VARIANT *v ) { return wine_dbg
#define FIXME_(ch) WINE_FIXME_(ch)
#define FIXME_ON(ch) WINE_FIXME_ON(ch)
#if 0
#undef ERR /* Solaris got an 'ERR' define in <sys/reg.h> */
#define ERR WINE_ERR
#define ERR_(ch) WINE_ERR_(ch)
#define ERR_ON(ch) WINE_ERR_ON(ch)
#else
static void ERR(const char *msg) {
/* Do something */
}
#endif
#define MESSAGE WINE_MESSAGE

View File

@ -111,6 +111,8 @@ if(ISLE_USE_DX5_LIBS)
target_link_directories(DirectX5::DirectX5 INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/dx5/lib")
endif()
add_subdirectory(3rdparty/d3drm)
add_library(Vec::Vec INTERFACE IMPORTED)
target_include_directories(Vec::Vec INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/vec")
@ -157,7 +159,13 @@ add_library(tglrl STATIC
register_lego1_target(tglrl)
set_property(TARGET tglrl PROPERTY ARCHIVE_OUTPUT_NAME "tglrl40$<$<CONFIG:Debug>:d>")
target_include_directories(tglrl PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util")
target_link_libraries(tglrl PRIVATE d3drm)
option(D3DRM_FROM_WINE "Use d3drm from wine" OFF)
if(D3DRM_FROM_WINE)
target_link_libraries(tglrl PRIVATE d3drm-wine)
else()
target_link_libraries(tglrl PRIVATE d3drm)
endif()
add_library(realtime STATIC
LEGO1/realtime/matrix.cpp