port 2A step 2: copy the 40250 header closure into the port mirror
76 closure headers (EterBase, EterLocale, EterPack, EterLib, GameLib, MilesLib, EffectLib, SphereLib, EterImageLib) copied by the new port_copy.py (CP949->UTF-8, LF, include-path case only); platform-class headers go to the mirror path too, as the interface platform/ implements. Six manual `// PORT:` edits (Random, Singleton, Pool, Stl, Utils, FlyTarget). - common/D3D8Types.h: D3D8 value types with SDK values/layout, opaque COM interfaces - common/shim/sdk (d3d8/d3dx8/mss) on every platform, common/shim/win32 off Windows - Win32Types/Win32Crt: HRESULT, GUID, LARGE_INTEGER, LOGFONT/TEXTMETRIC, _atoi64, CRITICAL_SECTION on std::recursive_mutex - header gate prepends each library's StdAfx.h (40250's precompiled header) port_gate: macOS, Android, iOS, Windows (mingw) PASS; Linux BLOCKED (no toolchain). ScriptLib/EterPythonLib/UserInterface wait for 2P (their StdAfx includes Python). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,315 @@
|
||||
#pragma once
|
||||
// The Direct3D 8 value types (d3d8types.h, d3d8caps.h) that 40250 headers name: enums with the
|
||||
// SDK's values, structs with the SDK's layout, and the COM interfaces as opaque types. Nothing
|
||||
// here renders; platform/ implements the 40250 classes that own devices and resources.
|
||||
// Added on demand as copied headers need them.
|
||||
|
||||
#include "Win32Types.h"
|
||||
|
||||
#ifndef MAKEFOURCC
|
||||
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
|
||||
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24))
|
||||
#endif
|
||||
|
||||
typedef DWORD D3DCOLOR;
|
||||
|
||||
typedef struct _D3DVECTOR
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
} D3DVECTOR;
|
||||
|
||||
typedef struct _D3DCOLORVALUE
|
||||
{
|
||||
float r;
|
||||
float g;
|
||||
float b;
|
||||
float a;
|
||||
} D3DCOLORVALUE;
|
||||
|
||||
typedef struct _D3DMATRIX
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
float _11, _12, _13, _14;
|
||||
float _21, _22, _23, _24;
|
||||
float _31, _32, _33, _34;
|
||||
float _41, _42, _43, _44;
|
||||
};
|
||||
float m[4][4];
|
||||
};
|
||||
} D3DMATRIX;
|
||||
|
||||
typedef enum _D3DFORMAT
|
||||
{
|
||||
D3DFMT_UNKNOWN = 0,
|
||||
|
||||
D3DFMT_R8G8B8 = 20,
|
||||
D3DFMT_A8R8G8B8 = 21,
|
||||
D3DFMT_X8R8G8B8 = 22,
|
||||
D3DFMT_R5G6B5 = 23,
|
||||
D3DFMT_X1R5G5B5 = 24,
|
||||
D3DFMT_A1R5G5B5 = 25,
|
||||
D3DFMT_A4R4G4B4 = 26,
|
||||
D3DFMT_R3G3B2 = 27,
|
||||
D3DFMT_A8 = 28,
|
||||
D3DFMT_A8R3G3B2 = 29,
|
||||
D3DFMT_X4R4G4B4 = 30,
|
||||
D3DFMT_A2B10G10R10 = 31,
|
||||
D3DFMT_G16R16 = 34,
|
||||
|
||||
D3DFMT_A8P8 = 40,
|
||||
D3DFMT_P8 = 41,
|
||||
|
||||
D3DFMT_L8 = 50,
|
||||
D3DFMT_A8L8 = 51,
|
||||
D3DFMT_A4L4 = 52,
|
||||
|
||||
D3DFMT_V8U8 = 60,
|
||||
D3DFMT_L6V5U5 = 61,
|
||||
D3DFMT_X8L8V8U8 = 62,
|
||||
D3DFMT_Q8W8V8U8 = 63,
|
||||
D3DFMT_V16U16 = 64,
|
||||
D3DFMT_W11V11U10 = 65,
|
||||
D3DFMT_A2W10V10U10 = 67,
|
||||
|
||||
D3DFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'),
|
||||
D3DFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'),
|
||||
D3DFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'),
|
||||
D3DFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'),
|
||||
D3DFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'),
|
||||
D3DFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'),
|
||||
D3DFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'),
|
||||
|
||||
D3DFMT_D16_LOCKABLE = 70,
|
||||
D3DFMT_D32 = 71,
|
||||
D3DFMT_D15S1 = 73,
|
||||
D3DFMT_D24S8 = 75,
|
||||
D3DFMT_D16 = 80,
|
||||
D3DFMT_D24X8 = 77,
|
||||
D3DFMT_D24X4S4 = 79,
|
||||
|
||||
D3DFMT_VERTEXDATA = 100,
|
||||
D3DFMT_INDEX16 = 101,
|
||||
D3DFMT_INDEX32 = 102,
|
||||
|
||||
D3DFMT_FORCE_DWORD = 0x7fffffff
|
||||
} D3DFORMAT;
|
||||
|
||||
typedef enum _D3DDEVTYPE
|
||||
{
|
||||
D3DDEVTYPE_HAL = 1,
|
||||
D3DDEVTYPE_REF = 2,
|
||||
D3DDEVTYPE_SW = 3,
|
||||
D3DDEVTYPE_FORCE_DWORD = 0x7fffffff
|
||||
} D3DDEVTYPE;
|
||||
|
||||
typedef enum _D3DMULTISAMPLE_TYPE
|
||||
{
|
||||
D3DMULTISAMPLE_NONE = 0,
|
||||
D3DMULTISAMPLE_2_SAMPLES = 2,
|
||||
D3DMULTISAMPLE_3_SAMPLES = 3,
|
||||
D3DMULTISAMPLE_4_SAMPLES = 4,
|
||||
D3DMULTISAMPLE_5_SAMPLES = 5,
|
||||
D3DMULTISAMPLE_6_SAMPLES = 6,
|
||||
D3DMULTISAMPLE_7_SAMPLES = 7,
|
||||
D3DMULTISAMPLE_8_SAMPLES = 8,
|
||||
D3DMULTISAMPLE_9_SAMPLES = 9,
|
||||
D3DMULTISAMPLE_10_SAMPLES = 10,
|
||||
D3DMULTISAMPLE_11_SAMPLES = 11,
|
||||
D3DMULTISAMPLE_12_SAMPLES = 12,
|
||||
D3DMULTISAMPLE_13_SAMPLES = 13,
|
||||
D3DMULTISAMPLE_14_SAMPLES = 14,
|
||||
D3DMULTISAMPLE_15_SAMPLES = 15,
|
||||
D3DMULTISAMPLE_16_SAMPLES = 16,
|
||||
D3DMULTISAMPLE_FORCE_DWORD = 0x7fffffff
|
||||
} D3DMULTISAMPLE_TYPE;
|
||||
|
||||
typedef enum _D3DFILLMODE
|
||||
{
|
||||
D3DFILL_POINT = 1,
|
||||
D3DFILL_WIREFRAME = 2,
|
||||
D3DFILL_SOLID = 3,
|
||||
D3DFILL_FORCE_DWORD = 0x7fffffff
|
||||
} D3DFILLMODE;
|
||||
|
||||
typedef enum _D3DPOOL
|
||||
{
|
||||
D3DPOOL_DEFAULT = 0,
|
||||
D3DPOOL_MANAGED = 1,
|
||||
D3DPOOL_SYSTEMMEM = 2,
|
||||
D3DPOOL_SCRATCH = 3,
|
||||
D3DPOOL_FORCE_DWORD = 0x7fffffff
|
||||
} D3DPOOL;
|
||||
|
||||
typedef enum _D3DSWAPEFFECT
|
||||
{
|
||||
D3DSWAPEFFECT_DISCARD = 1,
|
||||
D3DSWAPEFFECT_FLIP = 2,
|
||||
D3DSWAPEFFECT_COPY = 3,
|
||||
D3DSWAPEFFECT_COPY_VSYNC = 4,
|
||||
D3DSWAPEFFECT_FORCE_DWORD = 0x7fffffff
|
||||
} D3DSWAPEFFECT;
|
||||
|
||||
typedef enum _D3DLIGHTTYPE
|
||||
{
|
||||
D3DLIGHT_POINT = 1,
|
||||
D3DLIGHT_SPOT = 2,
|
||||
D3DLIGHT_DIRECTIONAL = 3,
|
||||
D3DLIGHT_FORCE_DWORD = 0x7fffffff
|
||||
} D3DLIGHTTYPE;
|
||||
|
||||
typedef struct _D3DDISPLAYMODE
|
||||
{
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
UINT RefreshRate;
|
||||
D3DFORMAT Format;
|
||||
} D3DDISPLAYMODE;
|
||||
|
||||
#define MAX_DEVICE_IDENTIFIER_STRING 512
|
||||
typedef struct _D3DADAPTER_IDENTIFIER8
|
||||
{
|
||||
char Driver[MAX_DEVICE_IDENTIFIER_STRING];
|
||||
char Description[MAX_DEVICE_IDENTIFIER_STRING];
|
||||
LARGE_INTEGER DriverVersion;
|
||||
DWORD VendorId;
|
||||
DWORD DeviceId;
|
||||
DWORD SubSysId;
|
||||
DWORD Revision;
|
||||
GUID DeviceIdentifier;
|
||||
DWORD WHQLLevel;
|
||||
} D3DADAPTER_IDENTIFIER8;
|
||||
|
||||
typedef struct _D3DPRESENT_PARAMETERS_
|
||||
{
|
||||
UINT BackBufferWidth;
|
||||
UINT BackBufferHeight;
|
||||
D3DFORMAT BackBufferFormat;
|
||||
UINT BackBufferCount;
|
||||
D3DMULTISAMPLE_TYPE MultiSampleType;
|
||||
D3DSWAPEFFECT SwapEffect;
|
||||
HWND hDeviceWindow;
|
||||
BOOL Windowed;
|
||||
BOOL EnableAutoDepthStencil;
|
||||
D3DFORMAT AutoDepthStencilFormat;
|
||||
DWORD Flags;
|
||||
UINT FullScreen_RefreshRateInHz;
|
||||
UINT FullScreen_PresentationInterval;
|
||||
} D3DPRESENT_PARAMETERS;
|
||||
|
||||
typedef struct _D3DVIEWPORT8
|
||||
{
|
||||
DWORD X;
|
||||
DWORD Y;
|
||||
DWORD Width;
|
||||
DWORD Height;
|
||||
float MinZ;
|
||||
float MaxZ;
|
||||
} D3DVIEWPORT8;
|
||||
|
||||
typedef struct _D3DMATERIAL8
|
||||
{
|
||||
D3DCOLORVALUE Diffuse;
|
||||
D3DCOLORVALUE Ambient;
|
||||
D3DCOLORVALUE Specular;
|
||||
D3DCOLORVALUE Emissive;
|
||||
float Power;
|
||||
} D3DMATERIAL8;
|
||||
|
||||
typedef struct _D3DLIGHT8
|
||||
{
|
||||
D3DLIGHTTYPE Type;
|
||||
D3DCOLORVALUE Diffuse;
|
||||
D3DCOLORVALUE Specular;
|
||||
D3DCOLORVALUE Ambient;
|
||||
D3DVECTOR Position;
|
||||
D3DVECTOR Direction;
|
||||
float Range;
|
||||
float Falloff;
|
||||
float Attenuation0;
|
||||
float Attenuation1;
|
||||
float Attenuation2;
|
||||
float Theta;
|
||||
float Phi;
|
||||
} D3DLIGHT8;
|
||||
|
||||
typedef struct _D3DCAPS8
|
||||
{
|
||||
D3DDEVTYPE DeviceType;
|
||||
UINT AdapterOrdinal;
|
||||
DWORD Caps;
|
||||
DWORD Caps2;
|
||||
DWORD Caps3;
|
||||
DWORD PresentationIntervals;
|
||||
DWORD CursorCaps;
|
||||
DWORD DevCaps;
|
||||
DWORD PrimitiveMiscCaps;
|
||||
DWORD RasterCaps;
|
||||
DWORD ZCmpCaps;
|
||||
DWORD SrcBlendCaps;
|
||||
DWORD DestBlendCaps;
|
||||
DWORD AlphaCmpCaps;
|
||||
DWORD ShadeCaps;
|
||||
DWORD TextureCaps;
|
||||
DWORD TextureFilterCaps;
|
||||
DWORD CubeTextureFilterCaps;
|
||||
DWORD VolumeTextureFilterCaps;
|
||||
DWORD TextureAddressCaps;
|
||||
DWORD VolumeTextureAddressCaps;
|
||||
DWORD LineCaps;
|
||||
DWORD MaxTextureWidth, MaxTextureHeight;
|
||||
DWORD MaxVolumeExtent;
|
||||
DWORD MaxTextureRepeat;
|
||||
DWORD MaxTextureAspectRatio;
|
||||
DWORD MaxAnisotropy;
|
||||
float MaxVertexW;
|
||||
float GuardBandLeft;
|
||||
float GuardBandTop;
|
||||
float GuardBandRight;
|
||||
float GuardBandBottom;
|
||||
float ExtentsAdjust;
|
||||
DWORD StencilCaps;
|
||||
DWORD FVFCaps;
|
||||
DWORD TextureOpCaps;
|
||||
DWORD MaxTextureBlendStages;
|
||||
DWORD MaxSimultaneousTextures;
|
||||
DWORD VertexProcessingCaps;
|
||||
DWORD MaxActiveLights;
|
||||
DWORD MaxUserClipPlanes;
|
||||
DWORD MaxVertexBlendMatrices;
|
||||
DWORD MaxVertexBlendMatrixIndex;
|
||||
float MaxPointSize;
|
||||
DWORD MaxPrimitiveCount;
|
||||
DWORD MaxVertexIndex;
|
||||
DWORD MaxStreams;
|
||||
DWORD MaxStreamStride;
|
||||
DWORD VertexShaderVersion;
|
||||
DWORD MaxVertexShaderConst;
|
||||
DWORD PixelShaderVersion;
|
||||
float MaxPixelShaderValue;
|
||||
} D3DCAPS8;
|
||||
|
||||
// COM interfaces: opaque here; platform/ owns every instance.
|
||||
struct IDirect3D8;
|
||||
struct IDirect3DDevice8;
|
||||
struct IDirect3DBaseTexture8;
|
||||
struct IDirect3DTexture8;
|
||||
struct IDirect3DSurface8;
|
||||
struct IDirect3DVertexBuffer8;
|
||||
struct IDirect3DIndexBuffer8;
|
||||
typedef IDirect3D8* LPDIRECT3D8;
|
||||
typedef IDirect3DDevice8* LPDIRECT3DDEVICE8;
|
||||
typedef IDirect3DBaseTexture8* LPDIRECT3DBASETEXTURE8;
|
||||
typedef IDirect3DTexture8* LPDIRECT3DTEXTURE8;
|
||||
typedef IDirect3DSurface8* LPDIRECT3DSURFACE8;
|
||||
typedef IDirect3DVertexBuffer8* LPDIRECT3DVERTEXBUFFER8;
|
||||
typedef IDirect3DIndexBuffer8* LPDIRECT3DINDEXBUFFER8;
|
||||
|
||||
static_assert(sizeof(D3DVECTOR) == 12 && sizeof(D3DCOLORVALUE) == 16 && sizeof(D3DMATRIX) == 64, "D3D8 base layout");
|
||||
static_assert(sizeof(D3DDISPLAYMODE) == 16 && sizeof(D3DVIEWPORT8) == 24, "D3D8 layout");
|
||||
static_assert(sizeof(D3DMATERIAL8) == 68 && sizeof(D3DLIGHT8) == 104, "D3D8 layout");
|
||||
static_assert(sizeof(D3DCAPS8) == 212 && sizeof(D3DADAPTER_IDENTIFIER8) == 1072, "D3D8 caps/identifier layout");
|
||||
@@ -5,7 +5,7 @@
|
||||
// D3DX* functions follow the documented D3DX conventions (row vectors, left-handed rotations).
|
||||
// Functions are added on demand as ported units call them.
|
||||
|
||||
#include "Win32Types.h"
|
||||
#include "D3D8Types.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
@@ -14,37 +14,6 @@
|
||||
#define D3DXToRadian(degree) ((degree) * (D3DX_PI / 180.0f))
|
||||
#define D3DXToDegree(radian) ((radian) * (180.0f / D3DX_PI))
|
||||
|
||||
typedef DWORD D3DCOLOR;
|
||||
|
||||
typedef struct _D3DVECTOR
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
} D3DVECTOR;
|
||||
|
||||
typedef struct _D3DCOLORVALUE
|
||||
{
|
||||
float r;
|
||||
float g;
|
||||
float b;
|
||||
float a;
|
||||
} D3DCOLORVALUE;
|
||||
|
||||
typedef struct _D3DMATRIX
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
float _11, _12, _13, _14;
|
||||
float _21, _22, _23, _24;
|
||||
float _31, _32, _33, _34;
|
||||
float _41, _42, _43, _44;
|
||||
};
|
||||
float m[4][4];
|
||||
};
|
||||
} D3DMATRIX;
|
||||
|
||||
struct D3DXVECTOR2
|
||||
{
|
||||
|
||||
@@ -4,8 +4,23 @@
|
||||
#include <cctype>
|
||||
#include <chrono>
|
||||
#include <cstdio>
|
||||
#include <mutex>
|
||||
#include <new>
|
||||
#include <vector>
|
||||
|
||||
static_assert(sizeof(std::recursive_mutex) <= sizeof(CRITICAL_SECTION::storage), "CRITICAL_SECTION storage");
|
||||
static_assert(alignof(std::recursive_mutex) <= 16, "CRITICAL_SECTION alignment");
|
||||
|
||||
static std::recursive_mutex& cs_mutex(LPCRITICAL_SECTION cs)
|
||||
{
|
||||
return *std::launder(reinterpret_cast<std::recursive_mutex*>(cs->storage));
|
||||
}
|
||||
|
||||
void InitializeCriticalSection(LPCRITICAL_SECTION cs) { new (cs->storage) std::recursive_mutex(); }
|
||||
void DeleteCriticalSection(LPCRITICAL_SECTION cs) { cs_mutex(cs).~recursive_mutex(); }
|
||||
void EnterCriticalSection(LPCRITICAL_SECTION cs) { cs_mutex(cs).lock(); }
|
||||
void LeaveCriticalSection(LPCRITICAL_SECTION cs) { cs_mutex(cs).unlock(); }
|
||||
|
||||
char* _strlwr(char* s)
|
||||
{
|
||||
for (char* p = s; *p; ++p)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "Win32Types.h"
|
||||
|
||||
#include <cstdarg>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
|
||||
#if !defined(_WIN32)
|
||||
@@ -21,9 +22,15 @@ inline int stricmp(const char* a, const char* b) { return strcasecmp(a, b); }
|
||||
inline int _strnicmp(const char* a, const char* b, size_t n) { return strncasecmp(a, b, n); }
|
||||
inline int strnicmp(const char* a, const char* b, size_t n) { return strncasecmp(a, b, n); }
|
||||
|
||||
inline int _strcmpi(const char* a, const char* b) { return strcasecmp(a, b); }
|
||||
|
||||
char* _strlwr(char* s);
|
||||
char* _strupr(char* s);
|
||||
|
||||
// EterBase/StdAfx.h maps `atoi` to `_atoi64` (and `fileno` to `_fileno`) for MSVC >= 1400.
|
||||
inline INT64 _atoi64(const char* s) { return std::strtoll(s, nullptr, 10); }
|
||||
#define _fileno fileno
|
||||
|
||||
// MSVC `_snprintf`/`_vsnprintf`: when the output is longer than `count`, `count` bytes are written
|
||||
// with no terminator and -1 is returned; exactly `count` bytes are written unterminated and
|
||||
// `count` is returned; otherwise the output is terminated and its length returned.
|
||||
@@ -38,4 +45,15 @@ int _snprintf(char* buf, size_t count, const char* fmt, ...)
|
||||
DWORD timeGetTime();
|
||||
DWORD GetTickCount();
|
||||
|
||||
// Recursive, like the Win32 critical section. Storage holds a std::recursive_mutex.
|
||||
struct CRITICAL_SECTION
|
||||
{
|
||||
alignas(16) unsigned char storage[128];
|
||||
};
|
||||
typedef CRITICAL_SECTION* LPCRITICAL_SECTION;
|
||||
void InitializeCriticalSection(LPCRITICAL_SECTION cs);
|
||||
void DeleteCriticalSection(LPCRITICAL_SECTION cs);
|
||||
void EnterCriticalSection(LPCRITICAL_SECTION cs);
|
||||
void LeaveCriticalSection(LPCRITICAL_SECTION cs);
|
||||
|
||||
#endif // !_WIN32
|
||||
|
||||
@@ -44,6 +44,9 @@ typedef const void* LPCVOID;
|
||||
typedef void* PVOID;
|
||||
typedef char* LPSTR;
|
||||
typedef const char* LPCSTR;
|
||||
typedef char* PSTR;
|
||||
typedef const char* PCSTR;
|
||||
typedef CHAR* PCHAR;
|
||||
typedef BYTE* LPBYTE;
|
||||
typedef BYTE* PBYTE;
|
||||
typedef WORD* LPWORD;
|
||||
@@ -62,6 +65,15 @@ typedef uintptr_t WPARAM;
|
||||
typedef intptr_t LPARAM;
|
||||
typedef intptr_t LRESULT;
|
||||
|
||||
typedef LONG HRESULT;
|
||||
#define S_OK ((HRESULT)0L)
|
||||
#define S_FALSE ((HRESULT)1L)
|
||||
#define E_FAIL ((HRESULT)0x80004005L)
|
||||
#define E_OUTOFMEMORY ((HRESULT)0x8007000EL)
|
||||
#define E_INVALIDARG ((HRESULT)0x80070057L)
|
||||
#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)
|
||||
#define FAILED(hr) (((HRESULT)(hr)) < 0)
|
||||
|
||||
typedef void* HANDLE;
|
||||
struct HWND__;
|
||||
typedef HWND__* HWND;
|
||||
@@ -91,6 +103,74 @@ typedef struct tagSIZE
|
||||
LONG cy;
|
||||
} SIZE, *PSIZE, *LPSIZE;
|
||||
|
||||
typedef union _LARGE_INTEGER
|
||||
{
|
||||
struct
|
||||
{
|
||||
DWORD LowPart;
|
||||
LONG HighPart;
|
||||
};
|
||||
LONGLONG QuadPart;
|
||||
} LARGE_INTEGER, *PLARGE_INTEGER;
|
||||
|
||||
typedef struct _GUID
|
||||
{
|
||||
DWORD Data1;
|
||||
WORD Data2;
|
||||
WORD Data3;
|
||||
BYTE Data4[8];
|
||||
} GUID;
|
||||
|
||||
// The 40250 projects build with the multi-byte character set: TCHAR and the GDI structs are the
|
||||
// `A` variants.
|
||||
typedef char TCHAR;
|
||||
#define LF_FACESIZE 32
|
||||
|
||||
typedef struct tagLOGFONTA
|
||||
{
|
||||
LONG lfHeight;
|
||||
LONG lfWidth;
|
||||
LONG lfEscapement;
|
||||
LONG lfOrientation;
|
||||
LONG lfWeight;
|
||||
BYTE lfItalic;
|
||||
BYTE lfUnderline;
|
||||
BYTE lfStrikeOut;
|
||||
BYTE lfCharSet;
|
||||
BYTE lfOutPrecision;
|
||||
BYTE lfClipPrecision;
|
||||
BYTE lfQuality;
|
||||
BYTE lfPitchAndFamily;
|
||||
CHAR lfFaceName[LF_FACESIZE];
|
||||
} LOGFONTA, LOGFONT, *PLOGFONT, *LPLOGFONT;
|
||||
|
||||
typedef struct tagTEXTMETRICA
|
||||
{
|
||||
LONG tmHeight;
|
||||
LONG tmAscent;
|
||||
LONG tmDescent;
|
||||
LONG tmInternalLeading;
|
||||
LONG tmExternalLeading;
|
||||
LONG tmAveCharWidth;
|
||||
LONG tmMaxCharWidth;
|
||||
LONG tmWeight;
|
||||
LONG tmOverhang;
|
||||
LONG tmDigitizedAspectX;
|
||||
LONG tmDigitizedAspectY;
|
||||
BYTE tmFirstChar;
|
||||
BYTE tmLastChar;
|
||||
BYTE tmDefaultChar;
|
||||
BYTE tmBreakChar;
|
||||
BYTE tmItalic;
|
||||
BYTE tmUnderlined;
|
||||
BYTE tmStruckOut;
|
||||
BYTE tmPitchAndFamily;
|
||||
BYTE tmCharSet;
|
||||
} TEXTMETRICA, TEXTMETRIC, *PTEXTMETRIC, *LPTEXTMETRIC;
|
||||
|
||||
struct HFONT__;
|
||||
typedef HFONT__* HFONT;
|
||||
|
||||
#ifndef VOID
|
||||
#define VOID void
|
||||
#endif
|
||||
@@ -133,4 +213,6 @@ static_assert(sizeof(BYTE) == 1 && sizeof(WORD) == 2 && sizeof(DWORD) == 4, "Win
|
||||
static_assert(sizeof(LONG) == 4 && sizeof(BOOL) == 4 && sizeof(UINT) == 4 && sizeof(INT) == 4, "Win32 signed widths");
|
||||
static_assert(sizeof(SHORT) == 2 && sizeof(FLOAT) == 4, "Win32 short/float widths");
|
||||
static_assert(sizeof(POINT) == 8 && sizeof(RECT) == 16, "Win32 POINT/RECT layout");
|
||||
static_assert(sizeof(GUID) == 16 && sizeof(LARGE_INTEGER) == 8, "Win32 GUID/LARGE_INTEGER layout");
|
||||
static_assert(sizeof(LOGFONTA) == 60 && sizeof(TEXTMETRICA) == 56, "Win32 GDI struct layout");
|
||||
static_assert(sizeof(WPARAM) == sizeof(void*) && sizeof(HANDLE) == sizeof(void*), "handles stay pointer-sized");
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
// Shim for <d3d8.h>: the D3D8 value types 40250 logic uses as data. Rendering goes through
|
||||
// platform/, never through these declarations.
|
||||
#include "../../D3DXMath.h"
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
// Shim for <d3d8types.h>; see d3d8.h.
|
||||
#include "d3d8.h"
|
||||
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
// Shim for <d3dx8.h>: platform-independent D3DX8 math (common/D3DXMath.h); D3DX objects are
|
||||
// opaque, owned by platform/.
|
||||
#include "d3d8.h"
|
||||
|
||||
struct ID3DXMesh;
|
||||
typedef ID3DXMesh* LPD3DXMESH;
|
||||
struct ID3DXMatrixStack;
|
||||
typedef ID3DXMatrixStack* LPD3DXMATRIXSTACK;
|
||||
|
||||
// d3dx8tex.h filter flags
|
||||
#define D3DX_DEFAULT ((UINT)-1)
|
||||
#define D3DX_FILTER_NONE (1 << 0)
|
||||
#define D3DX_FILTER_POINT (2 << 0)
|
||||
#define D3DX_FILTER_LINEAR (3 << 0)
|
||||
#define D3DX_FILTER_TRIANGLE (4 << 0)
|
||||
#define D3DX_FILTER_BOX (5 << 0)
|
||||
#define D3DX_FILTER_MIRROR_U (1 << 16)
|
||||
#define D3DX_FILTER_MIRROR_V (2 << 16)
|
||||
#define D3DX_FILTER_MIRROR_W (4 << 16)
|
||||
#define D3DX_FILTER_MIRROR (7 << 16)
|
||||
#define D3DX_FILTER_DITHER (8 << 16)
|
||||
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
// Shim for Miles Sound System <mss.h>: the scalar types and opaque handles 40250's MilesLib
|
||||
// headers name. Playback goes through platform/, never through these declarations.
|
||||
#include "../../Win32Types.h"
|
||||
|
||||
typedef int32_t S32;
|
||||
typedef uint32_t U32;
|
||||
typedef float F32;
|
||||
typedef int16_t S16;
|
||||
typedef uint16_t U16;
|
||||
typedef int8_t S8;
|
||||
typedef uint8_t U8;
|
||||
|
||||
#define AILCALLBACK
|
||||
#define AILEXPORT
|
||||
|
||||
struct _SAMPLE;
|
||||
struct _STREAM;
|
||||
struct _DIG_DRIVER;
|
||||
struct _H3DSAMPLE;
|
||||
typedef _SAMPLE* HSAMPLE;
|
||||
typedef _STREAM* HSTREAM;
|
||||
typedef _DIG_DRIVER* HDIGDRIVER;
|
||||
typedef void* H3DPOBJECT;
|
||||
typedef H3DPOBJECT H3DSAMPLE;
|
||||
typedef U32 HPROVIDER;
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
// Shim for <dinput.h> on non-Windows targets; what 40250 logic uses from it is in <windows.h>.
|
||||
#include "windows.h"
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
// Shim for <direct.h> on non-Windows targets; what 40250 logic uses from it is in <windows.h>.
|
||||
#include "windows.h"
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
// Shim for <imagehlp.h> on non-Windows targets; what 40250 logic uses from it is in <windows.h>.
|
||||
#include "windows.h"
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
// Shim for MSVC <malloc.h> on non-Windows targets. Linux/Android ship a <malloc.h> that their
|
||||
// <stdlib.h> itself includes, so defer to it; macOS has none.
|
||||
#if __has_include_next(<malloc.h>)
|
||||
#include_next <malloc.h>
|
||||
#else
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
// Shim for <mmsystem.h> on non-Windows targets; what 40250 logic uses from it is in <windows.h>.
|
||||
#include "windows.h"
|
||||
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
// Shim for <process.h> on non-Windows targets; what 40250 logic uses from it is in <windows.h>.
|
||||
#include "windows.h"
|
||||
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
// Shim for <windows.h> on non-Windows targets: the Win32 scalar types and CRT spellings
|
||||
// 40250 sources use (common/Win32Types.h, common/Win32Crt.h).
|
||||
#include "../../Win32Types.h"
|
||||
#include "../../Win32Crt.h"
|
||||
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
// Shim for <winsock.h> on non-Windows targets: the BSD socket types under their Winsock names.
|
||||
#include "windows.h"
|
||||
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
typedef int SOCKET;
|
||||
typedef struct sockaddr SOCKADDR;
|
||||
typedef struct sockaddr_in SOCKADDR_IN;
|
||||
typedef struct in_addr IN_ADDR;
|
||||
#define INVALID_SOCKET (-1)
|
||||
#define SOCKET_ERROR (-1)
|
||||
Reference in New Issue
Block a user