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

📄 h2def.h

📁 魔法师传奇源代码
💻 H
📖 第 1 页 / 共 3 页
字号:
// called by IO functions when input is detectedvoid NetUpdate (void);// create any new ticcmds and broadcast to other playersvoid D_QuitNetGame (void);// broadcasts special packets to other players to notify of game exitvoid TryRunTics (void);//---------//SYSTEM IO//---------#if 1#define	SCREENWIDTH		320#define	SCREENHEIGHT	200#else#define	SCREENWIDTH		560#define	SCREENHEIGHT	375#endifbyte *I_ZoneBase (int *size);// called by startup code to get the ammount of memory to malloc// for the zone managementint I_GetTime (void);// called by H2_GameLoop// returns current time in ticsvoid I_StartFrame (void);// called by H2_GameLoop// called before processing any tics in a frame (just after displaying a frame)// time consuming syncronous operations are performed here (joystick reading)// can call H2_PostEventvoid I_StartTic (void);// called by H2_GameLoop// called before processing each tic in a frame// quick syncronous operations are performed here// can call H2_PostEvent// asyncronous interrupt functions should maintain private ques that are// read by the syncronous functions to be converted into eventsvoid I_Init (void);// called by H2_Main// determines the hardware configuration and sets up the video modevoid I_InitGraphics (void);void I_InitNetwork (void);void I_NetCmd (void);void I_CheckExternDriver(void);void I_Error (char *error, ...);// called by anything that can generate a terminal error// bad exit with diagnostic messagevoid I_Quit (void);// called by M_Responder when quit is selected// clean exit, displays sell blurbvoid I_SetPalette (byte *palette);// takes full 8 bit valuesvoid I_Update(void);// Copy buffer to videovoid I_WipeUpdate(wipe_t wipe);// Copy buffer to video with wipe effectvoid I_WaitVBL(int count);// wait for vertical retrace or pause a bitvoid I_BeginRead (void);void I_EndRead (void);byte	*I_AllocLow (int length);// allocates from low memory under dos, just mallocs under unixvoid I_Tactile (int on, int off, int total);#ifdef __WATCOMC__extern boolean useexterndriver;#define EBT_FIRE			1#define EBT_OPENDOOR 		2#define EBT_SPEED			4#define EBT_STRAFE			8#define EBT_MAP				0x10#define EBT_INVENTORYLEFT 	0x20#define EBT_INVENTORYRIGHT 	0x40#define EBT_USEARTIFACT		0x80#define EBT_FLYDROP			0x100#define EBT_CENTERVIEW		0x200#define EBT_PAUSE			0x400#define EBT_WEAPONCYCLE		0x800#define EBT_JUMP			0x1000typedef struct{	short vector; // Interrupt vector		signed char moveForward; // forward/backward (maxes at 50)	signed char moveSideways; // strafe (maxes at 24)	short angleTurn; // turning speed (640 [slow] 1280 [fast])	short angleHead; // head angle (+2080 [left] : 0 [center] : -2048 [right])	signed char pitch; // look up/down (-110 : +90)	signed char flyDirection; // flyheight (+1/-1)	unsigned short buttons; // EBT_* flags} externdata_t;#endif//----//GAME//----void G_DeathMatchSpawnPlayer (int playernum);void G_InitNew (skill_t skill, int episode, int map);void G_DeferedInitNew (skill_t skill, int episode, int map);// can be called by the startup code or M_Responder// a normal game starts at map 1, but a warp test can start elsewherevoid G_DeferredNewGame(skill_t skill);void G_DeferedPlayDemo (char *demo);void G_LoadGame(int slot);// can be called by the startup code or M_Responder// calls P_SetupLevel or W_EnterWorldvoid G_DoLoadGame (void);void G_SaveGame (int slot, char *description);// called by M_Respondervoid G_RecordDemo (skill_t skill, int numplayers, int episode	, int map, char *name);// only called by startup codevoid G_PlayDemo (char *name);void G_TimeDemo (char *name);void G_TeleportNewMap(int map, int position);void G_Completed(int map, int position);//void G_ExitLevel (void);//void G_SecretExitLevel (void);void G_StartNewGame(skill_t skill);void G_StartNewInit(void);void G_WorldDone (void);void G_Ticker (void);boolean G_Responder (event_t *ev);void G_ScreenShot (void);//-------//SV_SAVE//-------#define HXS_VERSION_TEXT "HXS Ver 2.37"#define HXS_VERSION_TEXT_LENGTH 16#define HXS_DESCRIPTION_LENGTH 24void SV_SaveGame(int slot, char *description);void SV_SaveMap(boolean savePlayers);void SV_LoadGame(int slot);void SV_MapTeleport(int map, int position);void SV_LoadMap(void);void SV_InitBaseSlot(void);void SV_UpdateRebornSlot(void);void SV_ClearRebornSlot(void);boolean SV_RebornSlotAvailable(void);int SV_GetRebornSlot(void);//-----//PLAY//-----void P_Ticker (void);// called by C_Ticker// can call G_PlayerExited// carries out all thinking of monsters and playersvoid P_SetupLevel (int episode, int map, int playermask, skill_t skill);// called by W_Tickervoid P_Init (void);// called by startup codeint P_GetMapCluster(int map);int P_TranslateMap(int map);int P_GetMapCDTrack(int map);int P_GetMapWarpTrans(int map);int P_GetMapNextMap(int map);int P_GetMapSky1Texture(int map);int P_GetMapSky2Texture(int map);char *P_GetMapName(int map);fixed_t P_GetMapSky1ScrollDelta(int map);fixed_t P_GetMapSky2ScrollDelta(int map);boolean P_GetMapDoubleSky(int map);boolean P_GetMapLightning(int map);boolean P_GetMapFadeTable(int map);char *P_GetMapSongLump(int map);void P_PutMapSongLump(int map, char *lumpName);int P_GetCDStartTrack(void);int P_GetCDEnd1Track(void);int P_GetCDEnd2Track(void);int P_GetCDEnd3Track(void);int P_GetCDIntermissionTrack(void);int P_GetCDTitleTrack(void);//-------//REFRESH//-------extern boolean setsizeneeded;extern boolean BorderNeedRefresh;extern boolean BorderTopRefresh;extern int UpdateState;// define the different areas for the dirty map#define I_NOUPDATE	0#define I_FULLVIEW	1#define I_STATBAR	2#define I_MESSAGES	4#define I_FULLSCRN	8void R_RenderPlayerView (player_t *player);// called by G_Drawervoid R_Init (void);// called by startup codevoid R_DrawViewBorder (void);void R_DrawTopBorder (void);// if the view size is not full screen, draws a border around itvoid R_SetViewSize (int blocks, int detail);// called by M_Responderint	R_FlatNumForName (char *name);int	R_TextureNumForName (char *name);int	R_CheckTextureNumForName (char *name);// called by P_Ticker for switches and animations// returns the texture number for the texture name//----//MISC//----extern	int		myargc;extern	char	**myargv;extern	int		localQuakeHappening[MAXPLAYERS];int	M_CheckParm(char *check);// returns the position of the given parameter in the arg list (0 if not found)boolean M_ParmExists(char *check);void M_ExtractFileBase(char *path, char *dest);void M_ForceUppercase(char *text);// Changes a string to uppercaseint M_Random (void);// returns a number from 0 to 255extern unsigned char rndtable[256];extern int prndindex;#define P_Random() rndtable[(++prndindex)&0xff]// as M_Random, but used only by the play simulationvoid M_ClearRandom (void);// fix randoms for demosvoid M_FindResponseFile(void);void M_ClearBox (fixed_t *box);void M_AddToBox (fixed_t *box, fixed_t x, fixed_t y);// bounding box functionsboolean M_WriteFile(char const *name, void *source, int length);int M_ReadFile(char const *name, byte **buffer);int M_ReadFileCLib(char const *name, byte **buffer);void M_ScreenShot (void);void M_LoadDefaults(char *fileName);void M_SaveDefaults (void);int M_DrawText (int x, int y, boolean direct, char *string);//------------------------------// SC_man.c//------------------------------void SC_Open(char *name);void SC_OpenLump(char *name);void SC_OpenFile(char *name);void SC_OpenFileCLib(char *name);void SC_Close(void);boolean SC_GetString(void);void SC_MustGetString(void);void SC_MustGetStringName(char *name);boolean SC_GetNumber(void);void SC_MustGetNumber(void);void SC_UnGet(void);//boolean SC_Check(void);boolean SC_Compare(char *text);int SC_MatchString(char **strings);int SC_MustMatchString(char **strings);void SC_ScriptError(char *message);extern char *sc_String;extern int sc_Number;extern int sc_Line;extern boolean sc_End;extern boolean sc_Crossed;extern boolean sc_FileScripts;extern char *sc_ScriptsDir;//------------------------------// SN_sonix.c//------------------------------enum{	SEQ_PLATFORM,	SEQ_PLATFORM_HEAVY,		// same script as a normal platform	SEQ_PLATFORM_METAL,	SEQ_PLATFORM_CREAK,		// same script as a normal platform	SEQ_PLATFORM_SILENCE,	SEQ_PLATFORM_LAVA,	SEQ_PLATFORM_WATER,	SEQ_PLATFORM_ICE,	SEQ_PLATFORM_EARTH,	SEQ_PLATFORM_METAL2,	SEQ_DOOR_STONE,	SEQ_DOOR_HEAVY,	SEQ_DOOR_METAL,	SEQ_DOOR_CREAK,	SEQ_DOOR_SILENCE,	SEQ_DOOR_LAVA,	SEQ_DOOR_WATER,	SEQ_DOOR_ICE,	SEQ_DOOR_EARTH,	SEQ_DOOR_METAL2,	SEQ_ESOUND_WIND,	SEQ_NUMSEQ};typedef enum{	SEQTYPE_STONE,	SEQTYPE_HEAVY,	SEQTYPE_METAL,	SEQTYPE_CREAK,	SEQTYPE_SILENCE,	SEQTYPE_LAVA,	SEQTYPE_WATER,	SEQTYPE_ICE,	SEQTYPE_EARTH,	SEQTYPE_METAL2,	SEQTYPE_NUMSEQ} seqtype_t;void SN_InitSequenceScript(void);void SN_StartSequence(mobj_t *mobj, int sequence);void SN_StartSequenceName(mobj_t *mobj, char *name);void SN_StopSequence(mobj_t *mobj);void SN_UpdateActiveSequences(void);void SN_StopAllSequences(void);int SN_GetSequenceOffset(int sequence, int *sequencePtr);void SN_ChangeNodeData(int nodeNum, int seqOffset, int delayTics, int volume,	int currentSoundID);typedef struct seqnode_s seqnode_t;struct seqnode_s{	int *sequencePtr;	int	sequence;	mobj_t *mobj;	int currentSoundID;	int delayTics;	int volume;	int stopSound;	seqnode_t *prev;	seqnode_t *next;};extern int ActiveSequences;extern seqnode_t *SequenceListHead;//----------------------// Interlude (IN_lude.c)//----------------------#define MAX_INTRMSN_MESSAGE_SIZE 1024extern boolean intermission;extern char ClusterMessage[MAX_INTRMSN_MESSAGE_SIZE];void IN_Start(void);void IN_Ticker(void);void IN_Drawer(void);//----------------------// Chat mode (CT_chat.c)//----------------------void CT_Init(void);void CT_Drawer(void);boolean CT_Responder(event_t *ev);void CT_Ticker(void);char CT_dequeueChatChar(void);extern boolean chatmodeon;//--------------------// Finale (F_finale.c)//--------------------void F_Drawer(void);void F_Ticker(void);void F_StartFinale(void);//----------------------// STATUS BAR (SB_bar.c)//----------------------extern int inv_ptr;extern int curpos;extern int SB_state;void SB_Init(void);void SB_SetClassData(void);boolean SB_Responder(event_t *event);void SB_Ticker(void);void SB_Drawer(void);void Draw_TeleportIcon(void);void Draw_SaveIcon(void);void Draw_LoadIcon(void);//-----------------// MENU (MN_menu.c)//-----------------void MN_Init(void);void MN_ActivateMenu(void);void MN_DeactivateMenu(void);boolean MN_Responder(event_t *event);void MN_Ticker(void);void MN_Drawer(void);void MN_DrTextA(char *text, int x, int y);void MN_DrTextAYellow(char *text, int x, int y);int MN_TextAWidth(char *text);void MN_DrTextB(char *text, int x, int y);int MN_TextBWidth(char *text);//------// VIDEO//------extern int dirtybox[4];extern byte gammatable[5][256];extern int usegamma;void V_Init(void); // Allocates buffer screens, call before R_Initvoid V_DrawPatch(int x, int y, patch_t *patch);void V_DrawFuzzPatch(int x, int y, patch_t *patch);void V_DrawAltFuzzPatch(int x, int y, patch_t *patch);void V_DrawShadowedPatch(int x, int y, patch_t *patch);void V_DrawRawScreen(byte *raw);#include "sounds.h"#endif // __H2DEF__

⌨️ 快捷键说明

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