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

📄 client_de.h

📁 Blood 2全套源码
💻 H
📖 第 1 页 / 共 4 页
字号:
			// Create and add to playlists....
			// Arguments:
			//		szPlayList - Name of playlist.
			//		szSong - Name of song to add.
			DBOOL		(*AddSongToPlayList)(char *szPlayList, char *szSong);

			// Removes a whole playlist...
			// Arguments:
			//		szPlayList - Name of playlist.
			void		(*DeletePlayList)(char *szPlayList);

			// Plays a motif.
			// Ima only.
			// Arguments:
			//		szMotif - name of motif.
			//		bLoop - Loop the motif.
			DBOOL		(*PlayMotif)(char *szMotif, DBOOL bLoop);

			// Stops a motif for IMA.
			// IMA only.
			// Arguments:
			//		szMotif - name of motif.
			void		(*StopMotif)(char *szMotif);

			// Volume range is 0-off, 100-full.
			short		(*GetMusicVolume)();
			void		(*SetMusicVolume)( short wVolume );


		// Sound functions.

			// Gets a list of the 3d sound providers available on system.  Choose one pass it in the 
			// InitSoundInfo structure.  Use bVerify to tell the engine not to report providers that 
			// aren't completely supported on the system.  This takes longer and causes speaker popping.  
			// Games should only need  to do this when a different provider is chosen.  EAX support
			// can only be checked when the provider is opened, so without the bVerify, the 
			// SOUND3DPROVIDER_CAPS_REVERB cannot be set.  InitSound will report this info in the
			// m_dwResults flags.
			// Be sure to release both lists with ReleaseSound3DProviderList.
			DRESULT			(*GetSound3DProviderLists)( Sound3DProvider *&pSound3DProviderList, DBOOL bVerify );
			void			(*ReleaseSound3DProviderList)( Sound3DProvider *pSound3DProviderList );

			// Initializes the sound driver.
			DRESULT			(*InitSound)( InitSoundInfo *pSoundInfo );

			// Volume controls between 0 - 100
			unsigned short	( *GetSoundVolume )();
			void			( *SetSoundVolume )( unsigned short nVolume );

			// Controls the reverb properties.
			// Inputs:
			DRESULT			( *SetReverbProperties )( ReverbProperties *pReverbProperties );
			DRESULT			( *GetReverbProperties )( ReverbProperties *pReverbProperties );

			// These PlaySound function allows the client shell to initiate and control sounds
			// without going through the server.  These sounds will only be played 
			// on the client initiating them. These functions will fill m_hSound
			// with the handle to the client sound if you set the PLAYSOUND_GETHANDLE flag.  This will
			// also force the sound not to be automatically deleted when the sound is done playing.  You
			// must call KillSound.  You must get the handle in order to use the other sound functions
			// like SetSoundPosition.

				// Play a sound with full control
				// Arguments:
				//		pPlaySoundInfo - sound control structure
				// Return:
				//		Handle to the client only sound.
				DRESULT	(*PlaySound)( PlaySoundInfo *pPlaySoundInfo );

				// Update position and orientation of a client only sound.
				// Arguments:
				//		hSound - Handle to client only sound.
				//		pPos - New position of sound. Can be NULL.
				// Return:
				//		LT_OK - Successful.
				//		LT_INVALIDPARAM - Invalid parameters.
				//		LT_ERROR - Unable find hSound
				DRESULT	(*SetSoundPosition)( HSOUNDDE hSound, DVector *pPos );

				// Get current position and orientation of a client only sound.
				// Arguments:
				//		hSound - Handle to client only sound.
				//		pPos - Destination of position. Can be NULL.
				//		pOrientation - Destination of orientation. Can be NULL.
				// Return:
				//		LT_OK - Successful.
				//		LT_INVALIDPARAM - Invalid parameters.
				//		LT_ERROR - Unable to find hSound.
				DRESULT	(*GetSoundPosition)( HSOUNDDE hSound, DVector *pPos );

				// Pause/resume sounds.
				void		(*PauseSounds)( );
				void		(*ResumeSounds)( );

				// Get total length in seconds of sound.
				// Arguments:
				//		hSound - Handle to sound.
				//		fDuration - Duration of sound.
				// Returns:
				//		DE_OK if successful.
				//		DE_INVALIDPARAMS if hSound not available.
				DRESULT	(*GetSoundDuration)( HSOUNDDE hSound, DFLOAT *fDuration );

				// Check if sound finished playing or if object it was attached to was removed.
				// Arguments:
				//		pSoundHandle - handle to client only sound
				DBOOL	(*IsDone)( HSOUNDDE pSoundHandle );

				// Kill a sound.
				// Arguments:
				//		pSoundHandle - handle to client only sound
				void	(*KillSound)( HSOUNDDE pSoundHandle );

				// Set the listener status, position and orientation.  If bListenerInClient is TRUE, then
				// pPos and pRot are ignored and can be set to NULL.
				void	(*SetListener)( DBOOL bListenerInClient, DVector *pPos, DRotation *pRot );


		// Video functions.  These functions use Smacker movies.

			// DE_OK, VIDEO_ERROR.
			// flags is a combination of the PLAYBACK_ flags in de_codes.h.
			DRESULT		(*StartVideo)(char *pFilename, DDWORD flags);
			DRESULT		(*StopVideo)();

			// Draws the current video playback to the screen.
			DRESULT		(*UpdateVideo)();
			
			// VIDEO_PLAYING, VIDEO_NOTPLAYING.
			DRESULT		(*IsVideoPlaying)();


		// String functions.  Strings are reference counted objects that cannot
		// be manipulated.  When you create one with FormatString or CreateString,
		// the reference count is 1.  When you copy a string with CopyString, the
		// reference count is incremented.  When you free one with FreeString,
		// it decrements the reference count.. when the reference count goes to
		// zero, it deletes the string.  If you forget to free up any strings, 
		// DirectEngine will spit out a message telling you about it..

			// In Windows, messageCode comes from your resource DLL.  The messages
			// need to be formatted with %1!s! %2!s! (the number is the argument 
			// number and the !s! says its a string).  You can also use !f! and !d!
			// for floating point and whole number.
			HSTRING		(*FormatString)(int messageCode, ...);
			
			// Copy a string.. much more efficient than CreateString().
			HSTRING		(*CopyString)(HSTRING hString);
			HSTRING		(*CreateString)(char *pString);
			void		(*FreeString)(HSTRING hString);

			DBOOL		(*CompareStrings)(HSTRING hString1, HSTRING hString2);
			DBOOL		(*CompareStringsUpper)(HSTRING hString1, HSTRING hString2);

			// Get the string's data.. you really should only use this for strings
			// that you stored off and want to pass to the engine for a filename 
			// or something..  Most strings could be in some format other than ANSI.
			char*		(*GetStringData)(HSTRING hString);


		// Intersections.

			// Intersect a line segment.. (used to be raycast, but line segments are WAY faster).
			// Returns TRUE and fills in pInfo if it hit something.
			DBOOL		(*IntersectSegment)(ClientIntersectQuery *pQuery, ClientIntersectInfo *pInfo);

			// Same as IntersectSegment, except for it casts a ray from pQuery->m_From
			// in the direction of pQuery->m_Dir.
			DBOOL		(*CastRay)(ClientIntersectQuery *pQuery, ClientIntersectInfo *pInfo);

			// Find objects in a sphere.  This is only based on their centerpoints, not
			// on their dimensions or anything.  inObjects is filled in and nOutObjects 
			// is set to the number of objects filled in.  nFound might be larger if
			// it found more objects than nInObjects.
			DRESULT		(*FindObjectsInSphere)(DVector *pCenter, float radius, 
				HLOCALOBJ *inObjects, DDWORD nInObjects, DDWORD *nOutObjects, DDWORD *nFound);


		// Fonts..

			// Creates the closest font it can to the one you asked for.
			HDEFONT		(*CreateFont)(char *pFontName, int width, int height, 
				DBOOL bItalic, DBOOL bUnderline, DBOOL bBold);

			void		(*DeleteFont)(HDEFONT hFont);


		// Colors..

			// r, g, and b go from 0 to 1.
			// bTransparent is only used when the function specifies so.
			// Note: anywhere you can pass a color, if you pass in NULL, it'll use black.
			HDECOLOR	(*CreateColor)(float r, float g, float b, DBOOL bTransparent);
			void		(*DeleteColor)(HDECOLOR hColor);

			// Just for convenience.  You don't have to create/delete these colors,
			// and they're always around!
			HDECOLOR	(*SetupColor1)(float r, float g, float b, DBOOL bTransparent);
			HDECOLOR	(*SetupColor2)(float r, float g, float b, DBOOL bTransparent);

		
		// Surface management.
		// Note:  All the rectangles you specify in here do not include the right and bottom
		//        edges.  ie: If you draw a rectangle (0, 1, 0, 1), it'll draw 1 pixel
		//        instead of 4 pixels. 

		// Note:  Try to use the screen surface as little as possible.  Using the screen
		//        surface stalls ALL asynchronous rendering performance and can cut framerate
		//        in half on some cards.  That's not to say don't use them in the interface,
		//        just don't use them for things that are always there like frag counts, etc..
		//        The only functions that don't stall async performance (feel free to use
		//        these regularly) are:
		//           DrawSurfaceToSurface
		//           DrawSurfaceToSurfaceTransparent
		//           ScaleSurfaceToSurface
		//           ScaleSurfaceToSurfaceTransparent

			// This goes around the edges of the surface and returns the smallest inside
			// rectangle allowing for a border of hColor.  For example, if hSurface 
			// had a black border of 2 pixels on the left and right and a black border 
			// of 3 pixels on the top and bottom, pRect would be set to (2,3,2,3).
			DRESULT		(*GetBorderSize)(HSURFACE hSurface, HDECOLOR hColor, DRect *pRect);

			// Any surfaces you use while rendering 3D stuff at the same time should be optimized
			// with this function and drawn in an StartOptimized2D/EndOptimized2D block.
			// You need to call OptimizeSurface each time you change its contents.
			DRESULT		(*OptimizeSurface)(HSURFACE hSurface, HDECOLOR hTransparentColor);
			DRESULT		(*UnoptimizeSurface)(HSURFACE hSurface);
		
			HSURFACE	(*GetScreenSurface)();

			// Creates a surface sized to the dimensions of the bitmap.
			// The bitmap is an 8-bit (you can use any palette you want..) PCX file.
			// So pBitmapName might look like "interface/bitmaps/menu1.pcx".
			HSURFACE	(*CreateSurfaceFromBitmap)(char *pBitmapName);
			
			// Creates a surface just large enough for the string.
			// You can make the surface a little larger with extraPixelsX and extraPixelsY.
			HSURFACE	(*CreateSurfaceFromString)(HDEFONT hFont, HSTRING hString,
				HDECOLOR hForeColor, HDECOLOR hBackColor, 
				int extraPixelsX, int extraPixelsY);
			
			// Create a plain old surface.
			HSURFACE	(*CreateSurface)(DDWORD width, DDWORD height);
			
			DRESULT		(*DeleteSurface)(HSURFACE hSurface);

			// Attach whatever user data you want to a surface.
			void*		(*GetSurfaceUserData)(HSURFACE hSurface);
			void		(*SetSurfaceUserData)(HSURFACE hSurface, void *pUserData);

			// Access the pixels (SLOW).
			DRESULT		(*GetPixel)(HSURFACE hSurface, DDWORD x, DDWORD y, HDECOLOR *color);
			DRESULT		(*SetPixel)(HSURFACE hSurface, DDWORD x, DDWORD y, HDECOLOR color);
			
			// Gets the dimensions that this string would take up.
			void		(*GetStringDimensions)(HDEFONT hFont, HSTRING hString, int *sizeX, int *sizeY);

			// Draws the string into the rectangle..
			void		(*DrawStringToSurface)(HSURFACE hDest, HDEFONT hFont, HSTRING hString, 
				DRect *pRect, HDECOLOR hForeColor, HDECOLOR hBackColor);

			// You can pass in NULL for pWidth and pHeight if you want.
			void		(*GetSurfaceDims)(HSURFACE hSurf, DDWORD *pWidth, DDWORD *pHeight);
			
			// Draw a bitmap to a surface..
			DBOOL		(*DrawBitmapToSurface)(HSURFACE hDest, char *pSourceBitmapName, 
				DRect *pSrcRect, int destX, int destY);

			// Draws hSrc to hDest like a normal transparent blit, but tiles hMask's surface
			// into the nontransparent pixels of hSrc (can you say airbrushed text?)
			// You can't have a mask texture larger than 256x256, and the mask must be
			// a power of 2.
			DRESULT		(*DrawSurfaceMasked)(HSURFACE hDest, HSURFACE hSrc, HSURFACE hMask,
				DRect *pSrcRect, int destX, int destY, HDECOLOR hColor);

			// Draws hSrc onto hDest, but fills in the nontransparent pixels with the
			// color you specify.
			DRESULT		(*DrawSurfaceSolidColor)(HSURFACE hDest, HSURFACE hSrc,
				DRect *pSrcRect, int destX, int destY, HDECOLOR hTransColor, HDECOLOR hFillColor);
			
			// Draws the source surface onto the dest surface.  You can specify a rectangle 
			// in the source surface and the destination coordinates on the destination
			// surface.. it doesn't scale the bitmap..  If you pass in NULL for the source
			// rect, it'll just use the whole thing.
			DRESULT		(*DrawSurfaceToSurface)(HSURFACE hDest, HSURFACE hSrc, 
				DRect *pSrcRect, int destX, int destY);

			DRESULT		(*DrawSurfaceToSurfaceTransparent)(HSURFACE hDest, HSURFACE hSrc, 

⌨️ 快捷键说明

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