⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gslib.h

📁 连连看这个游戏都玩过吧
💻 H
字号:
     #ifndef	_DX_DLL_H_2002_12_4_9_38_
#define _DX_DLL_H_2002_12_4_9_38_

// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the GSLIB_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// GSLIB_API functions as being imported from a DLL, wheras this DLL sees symbols
// defined with this macro as being exported.
#ifdef GSLIB_EXPORTS
#define GSLIB_API __declspec(dllexport)
#else
#define GSLIB_API __declspec(dllimport)
#endif
// kill the 255+ character identifier warning.  Templates tend to exceed that easily.
#pragma warning (disable:4786)
#pragma warning (disable:4251)

#define D3D_OVERLOADS

#include <ddraw.h>
#include <d3d.h>
#include "tchar.h"
#include <stdio.h>
#include "d3dx.h"
#include <string>
#include <map>
#include <list>
#include <vector>
#include <set>
#include <functional>
#include <algorithm>
#include "fstream.h"
#include <fstream>
#include "assert.h"


#include <mmsystem.h>
#include <mmreg.h>
#include <dsound.h>
#include <dshow.h>
#include <time.h>

#include <sys/types.h>
#include <sys/stat.h>

//#include <deque>

//using namespace std;

//-----------------------------------------------------------------------------
// Miscellaneous helper functions
//-----------------------------------------------------------------------------
#define SAFE_DELETE(p)       { if(p) { delete (p);     (p)=NULL; } }
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p);   (p)=NULL; } }
#define SAFE_RELEASE(p)      { if(p) { (p)->Release(); (p)=NULL; } }
#define SAFE_FREE(p)		 { if(p) { if(0>=(p)->Release()) delete(p); (p)=NULL; } }

#define SAFE_RELEASE_OBJECT(p)      { if(p) { (p)->Release(); SAFE_DELETE(p); } }



//-----------------------------------------------------------------------------
// Timer event helper
//-----------------------------------------------------------------------------
#define	TIMER_APP	1
#define	TIMER_USER	2



class	CGsApp;
class	CGsAppEx;
class	CGsFunc;
class	CGsEngine;
class	CGsGame;
class	CDxSurface;
class	CGsSurface;
class	CGsTexture;
class	CGsSource;
class	CGsTextureGroup;
class	CGsAnimation;
class	CGsSound;
class	CGsAnimation;
class	CGsMedia;


class	CGsTask;

class	CGsUIPanel;


#define PATH_SIZE 255


#pragma pack(push, 1)


typedef D3DX_SURFACEFORMAT DXSF;


typedef	std::string		KEY;
typedef	std::string		DESC;
typedef DWORD			ID;
typedef WORD			INDEX;
typedef LONG			FLAG;
typedef BYTE			SIGN;

typedef	D3DXVECTOR3	GVECTOR;


typedef	CGsAnimation	GSANI;
typedef	CGsAnimation*	LPGSANI;

struct GSLIB_API SStreamBuf
{
	FILE*		p_fstream;
	long		file_size;
	long		pos_begin;
};
typedef	SStreamBuf	GSFBUF;
typedef	SStreamBuf*	LPGSFBUF;

enum	_FILE_FORMAT_TYPE
{
	GSF_UNKNOWN	= 0,
	GSF_FOLDER,
	GSF_INI,
	//image type
	GSF_BMP,
	GSF_JPG,
	GSF_TGA,
	GSF_WAV,
	GSF_GIF,
	GSF_PGG,
	GSF_TEX,
	GSF_TXG,
	//
	GSF_TXT,
	//video type
	GSF_AVI,
	GSF_MPG,
	GSF_MPEG,
	GSF_WMV,
	//audio type
	GSF_MP3,
	GSF_MIDI,
	GSF_WMA,
	//
	GSF_MAP,
	//font
	GSF_FNT,
	GSF_FON,
	GSF_TTF,
	GSF_FOT,
	//
	GSF_DDS,
	//
	GSF_GSS
};
typedef _FILE_FORMAT_TYPE FFT;
//enum	_ALIGN
//{
//	ALIGN_LEFT,
//	ALIGN_RIGHT,
//	ALIGN_CENTER
//};
//typedef _ALIGN ALIGN;

struct GSLIB_API sFile
{
	FFT			fft;
	char		strFile[PATH_SIZE];
	long		file_size;
	long		pos_begin;
};
typedef	sFile	GSFILE;
typedef	sFile*	LPGSFILE;

struct GSLIB_API sFont
{
	char	strFont[PATH_SIZE];
	LONG	size;
	int		charset;
	BOOL	Italic;
	BOOL	Underline;
	BOOL	StrikeOut;
};
typedef	sFont	GSFONT;

struct GSLIB_API SDxDeviceInfo
{
    // D3D Device info
    TCHAR          strDesc[40];
    GUID*          pDeviceGUID;
    D3DDEVICEDESC7 ddDeviceDesc;
    BOOL           bHardware;

    // DDraw Driver info
    GUID*          pDriverGUID;
    DDCAPS         ddDriverCaps;
    DDCAPS         ddHELCaps;

    // DDraw Mode Info
    DDSURFACEDESC2 ddsdFullscreenMode;
    BOOL           bWindowed;
    BOOL           bStereo;

    // For internal use (apps should not need to use these)
    GUID            guidDevice;
    GUID            guidDriver;
    DDSURFACEDESC2* pddsdModes;
    DWORD           dwNumModes;
    DWORD           dwCurrentMode;
    BOOL            bDesktopCompatible;
    BOOL            bStereoCompatible;
};
typedef SDxDeviceInfo DXDEVICEINFO;


struct GSLIB_API s_PGM_guid
{
	WORD	line;
	WORD	start;
	WORD	end;
};
typedef	s_PGM_guid GPGM;

#define PGM_FLAG_RGBA	1
#define PGM_FLAG_RGB	2

#pragma pack(pop)


//////////////////////////////////////////////////////
//自定义ID
#define IDM_DISPLAY_MODE 0xff00//0xbf00
#define ID_UI_DIALOG_FINISH 0xfe00

#define GS_MEDIA_GRAPHNOTIFY 0xBF00

////////////////////////////////////////////////////
//粒子
#define	GS_PARTICLE_LASER	0
#define	GS_PARTICLE_LIGHT	1






#define GSANI_FRAME_NOCHANGE		-1
#define GSANI_DIRECTION_NOCHANGE	-1
#define GSANI_ACT_COUNT_NOCHANGE	-1
#define GSANI_ACT_COUNT_LOOP		0



//-----------------------------------------------------------------------------
// Flags used for the Initialize() method of a CD3DFramework object
//-----------------------------------------------------------------------------
#define GSE_FULLSCREEN		0x00000001 // Use fullscreen mode
#define GSE_STEREO			0x00000002 // Use stereo-scopic viewing
#define GSE_ZBUFFER			0x00000004 // Create and use a zbuffer
#define GSE_NO_FPUSETUP		0x00000008 // Don't use default DDSCL_FPUSETUP flag




//-----------------------------------------------------------------------------
// Errors that the Initialize() and ChangeDriver() calls may return
//-----------------------------------------------------------------------------
#define GSERR_INITIALIZATIONFAILED 0x82000000
#define GSERR_NODIRECTDRAW         0x82000001
#define GSERR_COULDNTSETCOOPLEVEL  0x82000002
#define GSERR_NODIRECT3D           0x82000003
#define GSERR_NO3DDEVICE           0x82000004
#define GSERR_NOZBUFFER            0x82000005
#define GSERR_INVALIDZBUFFERDEPTH  0x82000006
#define GSERR_NOVIEWPORT           0x82000007
#define GSERR_NOPRIMARY            0x82000008
#define GSERR_NOCLIPPER            0x82000009
#define GSERR_BADDISPLAYMODE       0x8200000a
#define GSERR_NOBACKBUFFER         0x8200000b
#define GSERR_NONZEROREFCOUNT      0x8200000c
#define GSERR_NORENDERTARGET       0x8200000d
#define GSERR_INVALIDMODE          0x8200000e
#define GSERR_NOTINITIALIZED       0x8200000f
#define GSERR_ALREADYDISMISS       0x82000010

#endif //_DX_DLL_H_2002_12_4_9_38_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -