Add rayman2 source files

This commit is contained in:
2024-09-18 02:33:44 +08:00
parent bcc093f8ed
commit fb036c54fd
14339 changed files with 2596224 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
#if defined (ERROR_TEST)
/*
extern GLenum g_oglError;
extern GLenum g_oglPrevError;
extern char g_oglErrorString[255];
extern int g_oglErrorCount;
extern LPVOID g_lpMsgBuf;
*/
extern void fn_vOutputLog(char* ErrorString);
extern void fn_vOglError(char* oglFunc);
extern void fn_vError();
#define M_OUTPUT OutputDebugString
//#define M_OUTPUT fn_vOutputLog
#define M_OGL_ASSERT(oglFunc) \
{\
/*M_OUTPUT(#oglFunc);\
M_OUTPUT("\n");*/\
oglFunc\
fn_vOglError(#oglFunc);\
}
#define M_ASSERT(Func) \
{\
/*M_OUTPUT(#Func);\
M_OUTPUT("\n");*/\
if (!Func)\
{\
fn_vError();\
M_OUTPUT(#Func);\
M_OUTPUT("\n");\
}\
}
#define M_OGL_ASSERT_FAKE(oglFunc) \
{\
/*M_OUTPUT(#oglFunc);\
M_OUTPUT("\n");*/\
oglFunc\
}
//#define M_OGL_ASSERT_FAKE M_OGL_ASSERT
#else // ERROR_TEST
#define M_OGL_ASSERT_FAKE(oglFunc) oglFunc
#define M_OGL_ASSERT(oglFunc) oglFunc
#define M_ASSERT(Func) Func;
#define M_OUTPUT(str)
#endif // ERROR_TEST

View File

@@ -0,0 +1,62 @@
/* Testing Errors */
//#define OGL_VER2_2 // OpenGL version 2.2
#if defined (_DEBUG)
#define ERROR_TEST
#endif
//#define OPENGL_3DFX
#if defined (OPENGL_3DFX)
#define WORKAROUNDBUG //Work around bug in mini drivers
#endif //defined (OPENGL_3DFX)
/* Perspective */
//#define Z_BUFFER // if not defined => W_BUFFER
#define PERSP_CORRECTION
#if !defined (Z_BUFFER)
//#define ACCURATE_DEPTH_BUFFER // if defined in Rayman2 => nothing drawn in the "second viewport"
#endif
/* Texture test (fail if not in video memory) */
#if defined (_DEBUG)
//#define TEX_TEST
#endif
/* MIPMAP */
#if !defined (OGL_VER2_2)
#define MIPMAP_DOWN_TO_1x1
#endif
//#define REINIT_DEVICE_ONSIZE
//#define IGNORE_TEXTUREWRAP // to keep TexParameters GL_TEXTURE_WRAP_S & GL_TEXTURE_WRAP_T to GL_REPEAT value (because rastering GL_CLAMP'ed textures costs a lot !)
//#define NO_MIPMAP_FOR_TRANSPARENT_TEX // bug on the ATI RAGE PRO harware rasterization pipe : bilinear filtering is very ugly on transparent textures, so it looks better without Mipmaping these textures (on the software rasterization pipe, it is ok)
#define NO_FOG
/* window creation */
//#define USE_DEVMODE
//#define USE_DDRAW
#if defined (USE_DDRAW)
#define FULL_SCREEN
#endif //USE_DDRAW
#define SIZABLE
/* locking backbuffer*/
#define INVERT_Y
#define USE_ALPHA

View File

@@ -0,0 +1,139 @@
/*
=======================================================================================
Name : OGL_Thread.h
Author : Bart
Description :
=======================================================================================
*/
/*
=======================================================================================
Include
=======================================================================================
*/
/* 1->13 : no param */
#define OGLT0_CREATE 1
#define OGLT0_RESUME 2
#define OGLT0_SWAP 3
//#define OGLT0_RENDER 4
//#define OGLT0_LOADTEXTURES 5
#define OGLT0_INITFLAGS 6
#define OGLT0_FLUSH 7
#define OGLT0_ALPHATEST 8
#define OGLT0_LOCKDEVICE 9
#define OGLT0_UNLOCKDEVICE 10
#define OGLT0_BLACKPOLY 11
#define OGLT0_WAIT 12
#define OGLT0_FOGPARAM 13
/* 31->38 : 1 param */
#define OGLT1_ENABLE 31
#define OGLT1_DISABLE 32
#define OGLT1_DEPTHMASK 33
#define OGLT1_DELETETEXTURE 34
#define OGLT1_BINDTEXTURE 35
#define OGLT1_TEXTUREENV 36
#define OGLT1_RENDER 37
#define OGLT1_LOADTEXTURES 38
/* 51->54 : 2 params */
#define OGLT2_PIXELTRANSFER 51
#define OGLT2_BLENDFUNC 52
#define OGLT2_WRITEBITMAP 53
#define OGLT2_CLEARDEVICE 54
/* 71->71 : 3 params */
//#define OGLT3_CLEARDEVICE 71
/* 81->83 : 1 param + 1 returned (boolean) value */
#define OGLT1_ISTEXTURE 81
#define OGLT1_ISENABLED 82
#define OGLT1_ISRESIDENT 83
/* 98->99 : specific */
#define OGLT0_EXIT 98
#define OGLT0_NB_MSG_MAX 99
/* Post OGL Commands in the thread message queue */
void OGLThread_fn_vPostCmd(int _CommandId);
void OGLThread_fn_vPostCmd_1Long(int _nCommandId, long _lParam1);
void OGLThread_fn_vPostCmd_2Long(int _nCommandId, long _lParam1, long _lParam2);
//void OGLThread_fn_vPostCmd_3Long(int _nCommandId, long _lParam1, long _lParam2, long _lParam3);
BOOL OGLThread_fn_bPostCmdAndWait(int _nCommandId, long _lParam1);
void OGLThread_fn_vCreateThread(void);
void OGLThread_fn_vTerminateThread();
void OGLThread_fn_vCreateContext(BOOL _bReinitDevice);
void OGLThread_fn_vResumeContext(BOOL _bReinitDevice);
void OGLThread_fn_vWaitForSynchro();
/* from OGL_Acces.c */
#if defined (Z_BUFFER)
//#define M_glVertex(x, y, w) glVertex4f( x, y, 1.0f/w, 1.0f )
#if defined (PERSP_CORRECTION)
#define M_glVertex(x, y, w) glVertex4f( x/w, y/w, 1.0f/(w*w), 1.0f/w )
#else
#define M_glVertex(x, y, w) glVertex4f( x, y, 1.0f/w, 1.0f )
#endif
#else // W_BUFFER
//#define M_glVertex(x, y, w) glVertex4f( x, y, 1.0f, w )
#if defined (PERSP_CORRECTION)
#define M_glVertex(x, y, w) glVertex4f( x/w, y/w, 1.0f, 1.0f/w )
#else
#define M_glVertex(x, y, w) glVertex4f( x, y, w, 1.0f )
#endif
#endif
/*
=======================================================================================
Vertex Access Macros
=======================================================================================
*/
// GET
#define GetX(a) a.sx
#define GetY(a) a.sy
#define GetZ(a) a.sz //a.rhw
#define GetPackedColor(a) a.color
#define GetPackedSpecular(a) a.specular
#define GetU(a) a.tu
#define GetV(a) a.tv
// SET
#define SetX(a,b) a.sx = b
#define SetY(a,b) a.sy = b
#define SetZ(a,b) a.sz = b //a.rhw
#define SetPackedColor(a,b) a.color = b
#define SetPackedSpecular(a,b) a.specular = b
#define SetU(a,b) a.tu = b
#define SetV(a,b) a.tv = b
#define SetU_Cpy(a,b) a.tu = b
#define SetV_Cpy(a,b) a.tv = b
typedef struct _GLI_tdScreenVertx {
float sx;
float sy;
float sz;
//float rhw;
unsigned long color;
unsigned long specular;
float tu;
float tv;
} GLI_tdScreenVertx;
/* end of OGL_Acces.c */