From d89eb0014e72da9fe561a5a150943d6b962c3dd9 Mon Sep 17 00:00:00 2001 From: Steven Fuller Date: Wed, 4 Jul 2001 22:58:50 +0000 Subject: First wave of changes: Removed inclusion of Windows header files and remove some Windows-specific declarations. --- src/win95/aw.h | 14 ----------- src/win95/inline.h | 26 ++++++++++++++++++--- src/win95/mmx_math.h | 24 ++++++++----------- src/win95/platform.h | 65 ++++------------------------------------------------ 4 files changed, 37 insertions(+), 92 deletions(-) (limited to 'src/win95') diff --git a/src/win95/aw.h b/src/win95/aw.h index 8e43f33..1b4fa3b 100644 --- a/src/win95/aw.h +++ b/src/win95/aw.h @@ -1,20 +1,6 @@ #ifndef _INCLUDED_AW_H_ #define _INCLUDED_AW_H_ -#include - -typedef IDirectDraw DDObject; -typedef IDirect3DDevice D3DDevice; -typedef IDirect3DTexture D3DTexture; -typedef IDirectDrawSurface DDSurface; -typedef IDirectDrawPalette DDPalette; - -#define GUID_D3D_TEXTURE IID_IDirect3DTexture -#define GUID_DD_SURFACE IID_IDirectDrawSurface - -typedef DDSURFACEDESC DD_SURFACE_DESC; -typedef DDSCAPS DD_S_CAPS; - struct AwBackupTexture; typedef struct AwBackupTexture * AW_BACKUPTEXTUREHANDLE; diff --git a/src/win95/inline.h b/src/win95/inline.h index fdc5c60..30b7faa 100644 --- a/src/win95/inline.h +++ b/src/win95/inline.h @@ -1,4 +1,5 @@ #ifndef INLINE_INCLUDED +#define INLINE_INCLUDED #if SUPPORT_MMX #include "mmx_math.h" @@ -1207,7 +1208,27 @@ a = itmp;} #else /* other compiler ? */ -#error "Unknown compiler" +/* #error "Unknown compiler" */ +void ADD_LL(LONGLONGCH *a, LONGLONGCH *b, LONGLONGCH *c); +void ADD_LL_PP(LONGLONGCH *c, LONGLONGCH *a); +void SUB_LL(LONGLONGCH *a, LONGLONGCH *b, LONGLONGCH *c); +void SUB_LL_MM(LONGLONGCH *c, LONGLONGCH *a); +void MUL_I_WIDE(int a, int b, LONGLONGCH *c); +int CMP_LL(LONGLONGCH *a, LONGLONGCH *b); +void EQUALS_LL(LONGLONGCH *a, LONGLONGCH *b); +void NEG_LL(LONGLONGCH *a); +void ASR_LL(LONGLONGCH *a, int shift); +void IntToLL(LONGLONGCH *a, int *b); +int MUL_FIXED(int a, int b); +int DIV_FIXED(int a, int b); + +#define DIV_INT(a, b) ((a) / (b)) + +int NarrowDivide(LONGLONGCH *a, int b); +int WideMulNarrowDiv(int a, int b, int c); +void RotateVector_ASM(VECTORCH *v, MATRIXCH *m); +void RotateAndCopyVector_ASM(VECTORCH *v1, VECTORCH *v2, MATRIXCH *m); +int f2i(float f); #endif @@ -1241,6 +1262,5 @@ void CopyClipPoint(CLIP_POINT *cp1, CLIP_POINT *cp2); } #endif -#define INLINE_INCLUDED -#endif +#endif diff --git a/src/win95/mmx_math.h b/src/win95/mmx_math.h index 594ac0e..9382c0e 100644 --- a/src/win95/mmx_math.h +++ b/src/win95/mmx_math.h @@ -70,18 +70,6 @@ To ensure this in arrays of vectors/matrices, the structure should contain a dummy padding 32-bit value (recommended). */ -/* storage class specifier for assembler calls */ - -#ifdef __WATCOMC__ -#define _asmcall -#define _asminline -#elif defined(_MSC_VER) -#define _asmcall static __inline -#define _asminline static __inline -#else -#error "Unknown compiler" -#endif - /* forward reference declared in global scope */ struct vectorch; struct matrixch; @@ -202,7 +190,13 @@ _asmcall signed MMX_VectorDot16(struct vectorch const * v1, struct vectorch cons #else -#error "Unknown compiler" +/* #error "Unknown compiler" */ +void MMX_VectorTransform(struct vectorch * vector, struct matrixch const * matrix); +void MMX_VectorTransformed(struct vectorch * v_result, struct vectorch const * v_parm, struct matrixch const * matrix); +void MMX_VectorTransformAndAdd(struct vectorch * vector, struct matrixch const * matrix, struct vectorch const * v_add); +void MMX_VectorTransformedAndAdd(struct vectorch * v_result, struct vectorch const * v_parm, struct matrixch const * matrix, struct vectorch const * v_add); +int MMX_VectorDot(struct vectorch const * v1, struct vectorch const * v2); +int MMX_VectorDot16(struct vectorch const * v1, struct vectorch const * v2); #endif @@ -456,7 +450,9 @@ _asminline signed MMXInline_VectorDot16(struct vectorch const * v1, struct vecto #else -#error "Unknown compiler" +/* #error "Unknown compiler" */ +int MMXInline_VectorDot(struct vectorch const * v1, struct vectorch const * v2); +int MMXInline_VectorDot16(struct vectorch const * v1, struct vectorch const * v2); #endif diff --git a/src/win95/platform.h b/src/win95/platform.h index 7cab03d..31a0d68 100644 --- a/src/win95/platform.h +++ b/src/win95/platform.h @@ -1,4 +1,5 @@ #ifndef PLATFORM_INCLUDED +#define PLATFORM_INCLUDED /* @@ -10,41 +11,13 @@ extern "C" { #endif -/* - Minimise header files to - speed compiles... -*/ - -#define WIN32_LEAN_AND_MEAN - -/* - Standard windows functionality -*/ - -#include -#include -#include -#include -#include -#include -#include - -/* - DirectX functionality -*/ +#define PACKED __attribute__((packed)) -#include "ddraw.h" -#include "d3d.h" -#include "dsound.h" -#include "dplay.h" -#include "dinput.h" -#include "dplobby.h" //#include "fastfile.h" #define platform_pc Yes - -#define Saturn No +#define Saturn No #define Hardware2dTextureClipping No @@ -607,10 +580,6 @@ typedef enum { loader works (John's code, still under test). */ -#ifdef __WATCOMC__ -#pragma pack (1) -#endif - typedef struct bmpheader { unsigned short BMP_ID; /* Contains 'BM' */ @@ -634,11 +603,7 @@ typedef struct bmpheader { int BMP_Colours; /* Number of colours used, below (N) */ int BMP_ImpCols; /* Number of important colours */ -} BMPHEADER; - -#ifdef __WATCOMC__ -#pragma pack (4) -#endif +} PACKED BMPHEADER; /* Types of texture files that can be @@ -785,27 +750,6 @@ void UnlockBackdropSurface(void); void ComposeBackdropBackBuffer(void); int GetSingleColourForPrimary(int Colour); -/* - DirectX functionality only available in - C++ under Watcom at present -*/ -#ifdef __cplusplus -HRESULT CALLBACK EnumDisplayModesCallback(LPDDSURFACEDESC pddsd, LPVOID Context); -BOOL FAR PASCAL EnumDDObjectsCallback(GUID FAR* lpGUID, LPSTR lpDriverDesc, - LPSTR lpDriverName, LPVOID lpContext); -#if triplebuffer -/* - must be WINAPI to support Windows FAR PASCAL - calling convention. Must be HRESULT to support - enumeration return value. NOTE THIS FUNCTION - DOESN'T WORK (DOCS WRONG) AND TRIPLE BUFFERING - HAS BEEN REMOVED ANYWAY 'COS IT'S USELESS... -*/ -HRESULT WINAPI InitTripleBuffers(LPDIRECTDRAWSURFACE lpdd, - LPDDSURFACEDESC lpsd, LPVOID lpc); -#endif -#endif - /* Direct 3D Immediate Mode Rasterisation Module */ BOOL InitialiseDirect3DImmediateMode(void); BOOL LockExecuteBuffer(void); @@ -934,6 +878,5 @@ void ProcessProjectWhileWaitingToBeFlippable(); }; #endif -#define PLATFORM_INCLUDED #endif -- cgit v1.3