First wave of changes:
Removed inclusion of Windows header files and remove some Windows-specific declarations.
This commit is contained in:
parent
190a6b306b
commit
d89eb0014e
8 changed files with 43 additions and 132 deletions
|
@ -35,7 +35,7 @@
|
|||
/* Version settings *****************************************************/
|
||||
|
||||
/* Constants ***********************************************************/
|
||||
#include "HUD_layout.h"
|
||||
#include "hud_layout.h"
|
||||
/* Macros ***************************************************************/
|
||||
|
||||
/* Type definitions *****************************************************/
|
||||
|
|
|
@ -6,18 +6,10 @@
|
|||
|
||||
*/
|
||||
|
||||
#ifndef SupportWindows95
|
||||
#if defined(_WIN32)||defined(WIN32)
|
||||
#define SupportWindows95 1
|
||||
#else
|
||||
#define SupportWindows95 0
|
||||
#endif
|
||||
#endif
|
||||
#if SupportWindows95
|
||||
#include <ddraw.h>
|
||||
#include <d3d.h>
|
||||
#include "aw.h"
|
||||
#ifndef SupportWindows95 /* Enable so that PC code is used */
|
||||
#define SupportWindows95 1
|
||||
#endif
|
||||
|
||||
#include "shpanim.h"
|
||||
|
||||
|
||||
|
|
|
@ -243,4 +243,3 @@ void MapBlockInit(DISPLAYBLOCK *dptr)
|
|||
|
||||
|
||||
}
|
||||
|
||||
|
|
29
src/morph.c
29
src/morph.c
|
@ -1,36 +1,23 @@
|
|||
#include "3dc.h"
|
||||
|
||||
#include "inline.h"
|
||||
|
||||
|
||||
/*
|
||||
externs for commonly used global variables and arrays
|
||||
*/
|
||||
|
||||
extern MORPHDISPLAY MorphDisplay;
|
||||
extern int NormalFrameTime;
|
||||
|
||||
extern MORPHDISPLAY MorphDisplay;
|
||||
extern int NormalFrameTime;
|
||||
|
||||
/*
|
||||
|
||||
Global Variables
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Update Morphing Animation Control Block
|
||||
|
||||
*/
|
||||
|
||||
void UpdateMorphing(MORPHCTRL *mcptr)
|
||||
|
||||
{
|
||||
|
||||
MORPHHEADER *mhdr = mcptr->ObMorphHeader;
|
||||
int UpdateRate;
|
||||
|
||||
|
@ -130,13 +117,10 @@ void UpdateMorphing(MORPHCTRL *mcptr)
|
|||
*/
|
||||
|
||||
void UpdateMorphingDptr(DISPLAYBLOCK *dptr)
|
||||
|
||||
{
|
||||
|
||||
SHAPEHEADER *sptr1;
|
||||
SHAPEHEADER *sptr2;
|
||||
|
||||
|
||||
/* Update object radius and extents */
|
||||
|
||||
GetMorphDisplay(&MorphDisplay, dptr);
|
||||
|
@ -284,9 +268,7 @@ void UpdateMorphingDptr(DISPLAYBLOCK *dptr)
|
|||
*/
|
||||
|
||||
void GetMorphDisplay(MORPHDISPLAY *md, DISPLAYBLOCK *dptr)
|
||||
|
||||
{
|
||||
|
||||
MORPHFRAME *mdata;
|
||||
MORPHCTRL *mc = dptr->ObMorphCtrl;
|
||||
MORPHHEADER *mhdr = mc->ObMorphHeader;
|
||||
|
@ -303,20 +285,13 @@ void GetMorphDisplay(MORPHDISPLAY *md, DISPLAYBLOCK *dptr)
|
|||
|
||||
md->md_sptr1 = GetShapeData(md->md_shape1);
|
||||
md->md_sptr2 = GetShapeData(md->md_shape2);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CopyMorphCtrl(MORPHCTRL *src, MORPHCTRL *dst)
|
||||
|
||||
{
|
||||
|
||||
dst->ObMorphCurrFrame = src->ObMorphCurrFrame;
|
||||
dst->ObMorphFlags = src->ObMorphFlags;
|
||||
dst->ObMorphSpeed = src->ObMorphSpeed;
|
||||
dst->ObMorphHeader = src->ObMorphHeader;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,20 +1,6 @@
|
|||
#ifndef _INCLUDED_AW_H_
|
||||
#define _INCLUDED_AW_H_
|
||||
|
||||
#include <d3d.h>
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#ifndef PLATFORM_INCLUDED
|
||||
#define PLATFORM_INCLUDED
|
||||
|
||||
/*
|
||||
|
||||
|
@ -10,41 +11,13 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
Minimise header files to
|
||||
speed compiles...
|
||||
*/
|
||||
#define PACKED __attribute__((packed))
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
||||
/*
|
||||
Standard windows functionality
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <windowsx.h>
|
||||
#include <winuser.h>
|
||||
#include <mmsystem.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
DirectX functionality
|
||||
*/
|
||||
|
||||
#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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue