Fixed errors in inline.h.
More compiling. 156 unique undefined references.
This commit is contained in:
parent
cfd7274022
commit
29792b40ef
19 changed files with 504 additions and 1092 deletions
File diff suppressed because it is too large
Load diff
|
@ -42,6 +42,8 @@ enum AwTlErc
|
|||
AW_TL_ERC;
|
||||
|
||||
|
||||
#define NO_ERROR 0
|
||||
|
||||
/*********/
|
||||
/* Flags */
|
||||
/*********/
|
||||
|
@ -76,6 +78,43 @@ extern DDSurface * AwCreateSurface(char const * _argFormatS, ...);
|
|||
|
||||
extern AW_TL_ERC AwDestroyBackupTexture(AW_BACKUPTEXTUREHANDLE _bH);
|
||||
|
||||
|
||||
typedef int (* AW_TL_PFN_CALLBACK) (void *);
|
||||
|
||||
/* Structure for receiving specific regions of an image in a surface or texture.
|
||||
* A pointer to an array of thise structures is passed to the AwCreate...
|
||||
* functions if the 'a' format specifier is used. The fields 'left', 'right',
|
||||
* 'top' and 'bottom' specify the rectangle to cut out of the image being loaded
|
||||
* and must be valid. In AwCreateSurface, the 'pSurface' field is used and is a
|
||||
* pointer to the Direct Draw surface created; in AwCreateTexture, the
|
||||
* 'pTexture' field is used and is a pointer to the Direct 3D texture created.
|
||||
* If an error occurs all the pointers in the array will be set to NULL. The
|
||||
* 'width' and 'height' fields will be filled in with the width and height of
|
||||
* the surface or texture that is created. If the rectangle specified is
|
||||
* completely outsided the main image, the width and height will be set to zero,
|
||||
* and the pointer field will be set to NULL, but this does not constitute an
|
||||
* error. If the 't' option is used, the pointer fields are assumed to be valid
|
||||
* textures or surfaces into which to load the new textures or surfaces. If the
|
||||
* pointer is NULL, the structure is ignored. The pointers will remain unchanged
|
||||
* even in the event of an error or a rectangle specified outside the main
|
||||
* image, though the width and height will still be set to zero.
|
||||
*/
|
||||
struct AwCreateGraphicRegion
|
||||
{
|
||||
unsigned left, top, right, bottom; /* rectangle to cut from the original image */
|
||||
unsigned width, height; /* width and height of the resulting surface or texture */
|
||||
union /* DDSurface or D3DTexture pointer depending on the context used */
|
||||
{
|
||||
DDSurface * pSurface; /* Direct Draw Surface object pointer */
|
||||
D3DTexture * pTexture; /* Direct 3D Texture object pointer */
|
||||
};
|
||||
};
|
||||
|
||||
/* typedef to save typing 'struct' when not using C++ */
|
||||
typedef struct AwCreateGraphicRegion AW_CREATEGRAPHICREGION;
|
||||
|
||||
extern char const * AwTlErrorToString(AW_TL_ERC _AWTL_DEFAULTPARM(awTlLastErr));
|
||||
|
||||
#if 0
|
||||
|
||||
#include <windows.h>
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
* stuff, which is, after all, a part of Windows. If you want Windows
|
||||
* stuff, but NOT Direct Draw, define DB_NODIRECTDRAW.
|
||||
*/
|
||||
|
||||
#define DB_NOWINDOWS
|
||||
#define DB_NODIRECTDRAW
|
||||
|
||||
/* ******************************************************************** *
|
||||
* *
|
||||
|
@ -26,8 +29,9 @@
|
|||
|
||||
/* I N C L U D E S **************************************************** */
|
||||
|
||||
#include "fixer.h"
|
||||
|
||||
/* Windows includes. Actually internal, but here to allow pre-compilation. */
|
||||
#include "advwin32.h"
|
||||
#ifndef DB_NOWINDOWS
|
||||
#include <windows.h>
|
||||
#include "advwin32.h"
|
||||
|
@ -63,9 +67,8 @@ int db_option = 0; /* Default is off. */
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <conio.h>
|
||||
#include <direct.h> /* For getcwd() */
|
||||
#include <stdarg.h> /* For variable arguments. */
|
||||
#include <unistd.h>
|
||||
|
||||
/* C O N S T A N T S ************************************************** */
|
||||
|
||||
|
@ -90,7 +93,8 @@ int db_option = 0; /* Default is off. */
|
|||
#define DB_FORCE_EXCEPTION() ( db_vol_zero = 1 / db_vol_zero )
|
||||
|
||||
/* Cause a brakepoint. */
|
||||
#define DB_FORCE_BRAKEPOINT() do {__asm int 3} while(0)
|
||||
//#define DB_FORCE_BRAKEPOINT() do {__asm int 3} while(0)
|
||||
#define DB_FORCE_BRAKEPOINT() { }
|
||||
|
||||
/* T Y P E S ********************************************************** */
|
||||
|
||||
|
@ -534,6 +538,7 @@ static void db_do_std_prompt(unsigned yOffset)
|
|||
switch(db_display_type)
|
||||
{
|
||||
case DB_DOS:
|
||||
#if 0
|
||||
printf( db_prompt_std );
|
||||
printf("\n");
|
||||
do
|
||||
|
@ -541,6 +546,9 @@ static void db_do_std_prompt(unsigned yOffset)
|
|||
ch = toupper(getch());
|
||||
}
|
||||
while((ch != 'N') && (ch != 'Y') && (ch != 'X'));
|
||||
#endif
|
||||
ch = 'N';
|
||||
|
||||
break;
|
||||
#ifndef DB_NODIRECTDRAW
|
||||
case DB_DIRECTDRAW:
|
||||
|
@ -602,7 +610,7 @@ static void db_do_std_prompt(unsigned yOffset)
|
|||
{
|
||||
exit(-10);
|
||||
}
|
||||
else if(ch == 'X')
|
||||
else if (ch == 'X')
|
||||
{
|
||||
if(db_use_brakepoints)
|
||||
{
|
||||
|
|
|
@ -47,112 +47,6 @@ extern "C" {
|
|||
#define OUR_MUL_INT(a, b) ((a) * (b))
|
||||
#define OUR_ISR(a, shift) ((a) >> (shift))
|
||||
|
||||
|
||||
/*
|
||||
|
||||
win95\item.c functions
|
||||
|
||||
*/
|
||||
|
||||
void InitialiseTriangleArrayData(void);
|
||||
void* AllocateTriangleArrayData(int tasize);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
General Triangle Array Handler Null Case / Error
|
||||
|
||||
*/
|
||||
|
||||
void TriangleArrayNullOrError(TRIANGLEARRAY *tarr);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Item Polygon Triangle Array Functions
|
||||
|
||||
*/
|
||||
|
||||
void Item_Polygon_PrepareTriangleArray_3(TRIANGLEARRAY *qarr);
|
||||
void Item_Polygon_PrepareTriangleArray_4(TRIANGLEARRAY *qarr);
|
||||
void Item_Polygon_PrepareTriangleArray_5(TRIANGLEARRAY *qarr);
|
||||
void Item_Polygon_PrepareTriangleArray_6(TRIANGLEARRAY *qarr);
|
||||
void Item_Polygon_PrepareTriangleArray_7(TRIANGLEARRAY *qarr);
|
||||
void Item_Polygon_PrepareTriangleArray_8(TRIANGLEARRAY *qarr);
|
||||
void Item_Polygon_PrepareTriangleArray_9(TRIANGLEARRAY *qarr);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Item Gouraud Polygon Triangle Array Functions
|
||||
|
||||
*/
|
||||
|
||||
void Item_GouraudPolygon_PrepareTriangleArray_3(TRIANGLEARRAY *qarr);
|
||||
void Item_GouraudPolygon_PrepareTriangleArray_4(TRIANGLEARRAY *qarr);
|
||||
void Item_GouraudPolygon_PrepareTriangleArray_5(TRIANGLEARRAY *qarr);
|
||||
void Item_GouraudPolygon_PrepareTriangleArray_6(TRIANGLEARRAY *qarr);
|
||||
void Item_GouraudPolygon_PrepareTriangleArray_7(TRIANGLEARRAY *qarr);
|
||||
void Item_GouraudPolygon_PrepareTriangleArray_8(TRIANGLEARRAY *qarr);
|
||||
void Item_GouraudPolygon_PrepareTriangleArray_9(TRIANGLEARRAY *qarr);
|
||||
|
||||
/*
|
||||
|
||||
Item 2d Textured Polygon Triangle Array Functions
|
||||
|
||||
*/
|
||||
|
||||
void Item_2dTexturedPolygon_PrepareTriangleArray_3(TRIANGLEARRAY *qarr);
|
||||
void Item_2dTexturedPolygon_PrepareTriangleArray_4(TRIANGLEARRAY *qarr);
|
||||
void Item_2dTexturedPolygon_PrepareTriangleArray_5(TRIANGLEARRAY *qarr);
|
||||
void Item_2dTexturedPolygon_PrepareTriangleArray_6(TRIANGLEARRAY *qarr);
|
||||
void Item_2dTexturedPolygon_PrepareTriangleArray_7(TRIANGLEARRAY *qarr);
|
||||
void Item_2dTexturedPolygon_PrepareTriangleArray_8(TRIANGLEARRAY *qarr);
|
||||
void Item_2dTexturedPolygon_PrepareTriangleArray_9(TRIANGLEARRAY *qarr);
|
||||
|
||||
/*
|
||||
|
||||
Item Gouraud 2d Textured Polygon Triangle Array Functions
|
||||
|
||||
*/
|
||||
|
||||
void Item_Gouraud2dTexturedPolygon_PrepareTriangleArray_3(TRIANGLEARRAY *qarr);
|
||||
void Item_Gouraud2dTexturedPolygon_PrepareTriangleArray_4(TRIANGLEARRAY *qarr);
|
||||
void Item_Gouraud2dTexturedPolygon_PrepareTriangleArray_5(TRIANGLEARRAY *qarr);
|
||||
void Item_Gouraud2dTexturedPolygon_PrepareTriangleArray_6(TRIANGLEARRAY *qarr);
|
||||
void Item_Gouraud2dTexturedPolygon_PrepareTriangleArray_7(TRIANGLEARRAY *qarr);
|
||||
void Item_Gouraud2dTexturedPolygon_PrepareTriangleArray_8(TRIANGLEARRAY *qarr);
|
||||
void Item_Gouraud2dTexturedPolygon_PrepareTriangleArray_9(TRIANGLEARRAY *qarr);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Item 3d Textured Polygon Triangle Array Functions
|
||||
|
||||
*/
|
||||
|
||||
void Item_3dTexturedPolygon_PrepareTriangleArray_3(TRIANGLEARRAY *qarr);
|
||||
void Item_3dTexturedPolygon_PrepareTriangleArray_4(TRIANGLEARRAY *qarr);
|
||||
void Item_3dTexturedPolygon_PrepareTriangleArray_5(TRIANGLEARRAY *qarr);
|
||||
void Item_3dTexturedPolygon_PrepareTriangleArray_6(TRIANGLEARRAY *qarr);
|
||||
void Item_3dTexturedPolygon_PrepareTriangleArray_7(TRIANGLEARRAY *qarr);
|
||||
void Item_3dTexturedPolygon_PrepareTriangleArray_8(TRIANGLEARRAY *qarr);
|
||||
void Item_3dTexturedPolygon_PrepareTriangleArray_9(TRIANGLEARRAY *qarr);
|
||||
|
||||
/*
|
||||
|
||||
Item Gouraud 3d Textured Polygon Triangle Array Functions
|
||||
|
||||
*/
|
||||
|
||||
void Item_Gouraud3dTexturedPolygon_PrepareTriangleArray_3(TRIANGLEARRAY *qarr);
|
||||
void Item_Gouraud3dTexturedPolygon_PrepareTriangleArray_4(TRIANGLEARRAY *qarr);
|
||||
void Item_Gouraud3dTexturedPolygon_PrepareTriangleArray_5(TRIANGLEARRAY *qarr);
|
||||
void Item_Gouraud3dTexturedPolygon_PrepareTriangleArray_6(TRIANGLEARRAY *qarr);
|
||||
void Item_Gouraud3dTexturedPolygon_PrepareTriangleArray_7(TRIANGLEARRAY *qarr);
|
||||
void Item_Gouraud3dTexturedPolygon_PrepareTriangleArray_8(TRIANGLEARRAY *qarr);
|
||||
void Item_Gouraud3dTexturedPolygon_PrepareTriangleArray_9(TRIANGLEARRAY *qarr);
|
||||
|
||||
/*
|
||||
|
||||
Platform Specific 64-Bit Operator Functions
|
||||
|
@ -1383,7 +1277,7 @@ static __inline__ void MUL_I_WIDE(int a, int b, LONGLONGCH *c)
|
|||
mov [ebx+4],edx
|
||||
}
|
||||
*/
|
||||
__asm__("imull %0 \n\t"
|
||||
__asm__("imull %2 \n\t"
|
||||
"movl %%eax, 0(%%ebx) \n\t"
|
||||
"movl %%edx, 4(%%ebx) \n\t"
|
||||
:
|
||||
|
@ -1596,7 +1490,7 @@ static __inline__ int MUL_FIXED(int a, int b)
|
|||
}
|
||||
*/
|
||||
/* TODO */
|
||||
__asm__("imull %0 \n\t"
|
||||
__asm__("imull %2 \n\t"
|
||||
"shrdl $16, %%edx, %%eax \n\t"
|
||||
: "=a" (retval)
|
||||
: "a" (a), "q" (b)
|
||||
|
@ -1631,7 +1525,7 @@ __asm__("cdq \n\t"
|
|||
"roll $16, %%eax \n\t"
|
||||
"mov %%ax, %%dx \n\t"
|
||||
"xor %%ax, %%ax \n\t"
|
||||
"idivl %0 \n\t"
|
||||
"idivl %2 \n\t"
|
||||
: "=a" (retval)
|
||||
: "a" (a), "q" (b)
|
||||
: "%edx", "cc"
|
||||
|
@ -1677,7 +1571,7 @@ static __inline__ int NarrowDivide(LONGLONGCH *a, int b)
|
|||
*/
|
||||
__asm__("movl 0(%%esi), %%eax \n\t"
|
||||
"movl 4(%%esi), %%edx \n\t"
|
||||
"idivl %0 \n\t"
|
||||
"idivl %2 \n\t"
|
||||
: "=a" (retval)
|
||||
: "S" (a), "q" (b)
|
||||
: "%edx", "cc"
|
||||
|
@ -1706,8 +1600,8 @@ static __inline__ int WideMulNarrowDiv(int a, int b, int c)
|
|||
}
|
||||
*/
|
||||
/* TODO */
|
||||
__asm__("imull %0 \n\t"
|
||||
"idivl %1 \n\t"
|
||||
__asm__("imull %2 \n\t"
|
||||
"idivl %3 \n\t"
|
||||
: "=a" (retval)
|
||||
: "a" (a), "q" (b), "q" (c)
|
||||
: "cc"
|
||||
|
@ -1959,15 +1853,11 @@ a = FloatToInt(b); \
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
/* These functions are in plspecfn.c */
|
||||
|
||||
int WideMul2NarrowDiv(int a, int b, int c, int d, int e);
|
||||
int _Dot(VECTORCH *vptr1, VECTORCH *vptr2);
|
||||
void MakeV(VECTORCH *v1, VECTORCH *v2, VECTORCH *v3);
|
||||
void AddV(VECTORCH *v1, VECTORCH *v2);
|
||||
void RotVect(VECTORCH *v, MATRIXCH *m);
|
||||
void CopyClipPoint(CLIP_POINT *cp1, CLIP_POINT *cp2);
|
||||
|
||||
#if SUPPORT_MMX
|
||||
|
||||
|
|
|
@ -634,6 +634,7 @@ void InitialiseSystem()
|
|||
video memory etc exist.
|
||||
*/
|
||||
|
||||
#if 0 /* LINUX */
|
||||
if (InitialiseDirectDrawObject()
|
||||
== FALSE)
|
||||
/*
|
||||
|
@ -665,6 +666,7 @@ void InitialiseSystem()
|
|||
system memory...
|
||||
*/
|
||||
TestMemoryAccess();
|
||||
#endif
|
||||
|
||||
/* Initialise main window, windows procedure etc */
|
||||
rc = InitialiseWindowsSystem(hInstance, nCmdShow, WinInitFull);
|
||||
|
@ -673,11 +675,13 @@ void InitialiseSystem()
|
|||
memset((void*)KeyboardInput, No, MAX_NUMBER_OF_INPUT_KEYS);
|
||||
GotAnyKey = No;
|
||||
|
||||
#if 0 /* LINUX */
|
||||
/* launch Direct Input */
|
||||
InitialiseDirectInput();
|
||||
InitialiseDirectKeyboard();
|
||||
InitialiseDirectMouse();
|
||||
InitJoysticks();
|
||||
#endif
|
||||
|
||||
/* Initialise textprint system */
|
||||
textprintPosX = 0;
|
||||
|
|
|
@ -2827,4 +2827,4 @@ void DrawStarfilledSky(void)
|
|||
|
||||
UnlockSurface();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#include "fixer.h"
|
||||
|
||||
#include "media.hpp"
|
||||
|
||||
void * MediaMedium::GetWriteBuffer(unsigned * pSize, unsigned /*nDesiredSize*/)
|
||||
|
@ -51,7 +53,7 @@ unsigned MediaWinFileMedium::GetRemainingSize()
|
|||
return 0;
|
||||
}
|
||||
|
||||
unsigned nSize = GetFileSize(m_hFile,NULL);
|
||||
unsigned nSize = GetFileSize(m_hFile, 0);
|
||||
|
||||
if (0xffffffff == nSize)
|
||||
{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#ifndef _INCLUDED_MEDIA_HPP_
|
||||
#define _INCLUDED_MEDIA_HPP_
|
||||
|
||||
#if defined(_WIN32) || defined(WIN32) || defined(WINDOWS) || defined(_WINDOWS)
|
||||
//#if defined(_WIN32) || defined(WIN32) || defined(WINDOWS) || defined(_WINDOWS)
|
||||
#define _MEDIA_WIN_TARGET
|
||||
#include <windows.h>
|
||||
#endif // WIN32 || _WIN32 || WINDOWS || _WINDOWS
|
||||
// #include <windows.h>
|
||||
//#endif // WIN32 || _WIN32 || WINDOWS || _WINDOWS
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -386,7 +386,7 @@ class MediaWinFileMedium : public MediaMedium
|
|||
m_hFile = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
void Open(LPCTSTR pszFileName, DWORD dwDesiredAccess)
|
||||
void Open(char *pszFileName, DWORD dwDesiredAccess)
|
||||
{
|
||||
DWORD dwShareMode;
|
||||
DWORD dwCreationDistribution;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue