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

📄 client_de.h

📁 Blood 2全套源码
💻 H
📖 第 1 页 / 共 4 页
字号:
				int left, int top, int right, int bottom);

			// Get/Set the camera light add.  RGB 0-1.  Light add is applied AFTER
			// scaling, so if light is fully bright and scaling is zero, you'll just
			// see whiteness.  When the light add is nonzero, it draws a poly over 
			// the screen so don't use it all the time!
			// These return DFALSE if the object is not a camera.
			DBOOL		(*GetCameraLightAdd)(HLOCALOBJ hCamera, DVector *pAdd);
			DBOOL		(*SetCameraLightAdd)(HLOCALOBJ hCamera, DVector *pAdd);



		// Particle system manipulation.

			// gravityAccel default is -500
			// flags default is 0
			// particleRadius default is 300
			// color scale defauls to 1.0
			// Particle colors are 0-255.
			
			// All particle positions are RELATIVE to the particle system's 
			// position and rotation.  In many cases, you can have your code be very simple
			// and fast if you just move and rotate the particle system and not the particles.
			
			// Change the system's parameters.
			DRESULT		(*SetupParticleSystem)(HLOCALOBJ hObj, char *pTextureName, float gravityAccel, DDWORD flags, float particleRadius);

			// The software version uses a single color for all the particles in each
			// system specified here (default 1).  RGB (0-1).
			DRESULT		(*SetSoftwarePSColor)(HLOCALOBJ hObj, float r, float g, float b);

			virtual DEParticle*	AddParticle(HLOCALOBJ hObj, DVector *pPos, DVector *pVelocity, DVector *pColor, float lifeTime)=0;
			
			void		(*AddParticles)(HLOCALOBJ hObj, DDWORD nParticles,
				DVector *pMinOffset, DVector *pMaxOffset,
				DVector *pMinVelocity, DVector *pMaxVelocity, 
				DVector *pMinColor, DVector *pMaxColor,
				float minLifetime, float maxLifetime);

			DBOOL		(*GetParticles)(HLOCALOBJ hObj, DEParticle **pHead, DEParticle **pTail);

			// Get/Set particle positions.  hSystem is NOT checked to be valid here
			// for speed so make sure it's valid!
			void		(*GetParticlePos)(HLOCALOBJ hSystem, DEParticle *pParticle, DVector *pPos);
			void		(*SetParticlePos)(HLOCALOBJ hSystem, DEParticle *pParticle, DVector *pPos);

			// Remove a particle.
			void		(*RemoveParticle)(HLOCALOBJ hSystem, DEParticle *pParticle);

			// This is an optimization you can make to help the engine minimize its boundaries on
			// a particle system.  If you create particles in various places and they go away, you
			// can use this every so often to recalculate where the particles are.
			DRESULT		(*OptimizeParticles)(HLOCALOBJ hSystem);
			


		// Line system manipulation.
		// As with particle systems, the lines are centered around the object's origin.
		// Don't just place the object at the origin and put lines way off to the side,
		// it's more efficient to keep the lines as close to the center as possible.

			// Set hPrev to NULL to start, then pass in the return value, etc..
			// Returns DNULL for last line.
			// ** If you call RemoveLine on the current HDELINE, DO NOT
			// ** pass that into GetNextLine - call GetNextLine first
			// ** while the HDELINE is still valid!
			HDELINE		(*GetNextLine)(HLOCALOBJ hObj, HDELINE hPrev);

			void		(*GetLineInfo)(HDELINE hLine, DELine *pLine);
			void		(*SetLineInfo)(HDELINE hLine, DELine *pLine);

			// Adds a line to the end of the line system's list.
			HDELINE		(*AddLine)(HLOCALOBJ hObj, DELine *pLine);
			void		(*RemoveLine)(HLOCALOBJ hObj, HDELINE hLine);


		// Poly grid manipulation.

			// A poly grid is basically a heightmapped grid of pixels that are drawn
			// as polygons.  Each pixel can have a value from -127 to 127.  The pixel's value 
			// defines its height and is a lookup into the color table for the vertex color.
			// You can scale and rotate the poly grid using SetObjectScale and SetObjectRotation.
			// bHalfTriangles will cause it to look VERY triangulated, but draw way faster.
			DBOOL		(*SetupPolyGrid)(HLOCALOBJ hObj, DDWORD width, DDWORD height, DBOOL bHalfTrianges);

			// Set the texture.  The texture MUST be a sprite file.  It CANNOT be a .dtx file!
			DRESULT		(*SetPolyGridTexture)(HLOCALOBJ hObj, char *pFilename);

			// Set the environment map for the PolyGrid.  This MUST be a DTX file.
			// Specify NULL if you want to disable the environment map.  Returns 
			// DE_NOTFOUND if it can't find the specified map.
			DRESULT		(*SetPolyGridEnvMap)(HLOCALOBJ hObj, char *pFilename);

			// Get/Set the texture pan and scale for a PolyGrid.
			// Defaults are 0.0 for xPan and yPan, and 1.0 for xScale and yScale.
			DRESULT		(*GetPolyGridTextureInfo)(HLOCALOBJ hObj, float *xPan, float *yPan, float *xScale, float *yScale);
			DRESULT		(*SetPolyGridTextureInfo)(HLOCALOBJ hObj, float xPan, float yPan, float xScale, float yScale);
			
			// You can set it to be transparent or not.  It defaults to not being transparent.
			DRESULT		(*GetPolyGridInfo)(HLOCALOBJ hObj, char **pBytes, DDWORD *pWidth, DDWORD *pHeight, PGColor **pColorTable);

			// Set pMin and pMax to the dimensions of the box you want the polygrid to fit in.
			// pPos and pScale will be filled in with the recommended position and scale.
			DRESULT		(*FitPolyGrid)(HLOCALOBJ hObj, DVector *pMin, DVector *pMax, DVector *pPos, DVector *pScale);


		// Light manipulation.

			// Get/Set a light's color (RGB, 0.0f to 1.0f).
			// When you create a light, its color defaults to (0,0,0).
			void	(*GetLightColor)(HLOCALOBJ hObj, float *r, float *g, float *b);
			void	(*SetLightColor)(HLOCALOBJ hObj, float r, float g, float b);

			// Get/Set a light's radius.
			// When you create a light, its radius defaults to 100.
			float	(*GetLightRadius)(HLOCALOBJ hObj);
			void	(*SetLightRadius)(HLOCALOBJ hObj, float radius);


		// Container manipulation.

			// Get a container's code.
			// Returns DFALSE if the object is not a container.
			DBOOL	(*GetContainerCode)(HLOCALOBJ hObj, D_WORD *pCode);

			// Find out what containers contain the given point.
			// Returns the number of containers filled in.
			DDWORD	(*GetPointContainers)(DVector *pPoint, HLOCALOBJ *pList, DDWORD maxListSize);


		// Sprite manipulation.

			// This clips the sprite on the poly.
			// Returns DE_OK or DE_ERROR if not a sprite.
			// Pass in INVALID_HPOLY to un-clip the sprite.
			DRESULT	(*ClipSprite)(HLOCALOBJ hObj, HPOLY hPoly);

			// Get the sprite control interface for a sprite.  Returns DE_INVALIDPARAMS
			// if the object is not a sprite.
			virtual DRESULT GetSpriteControl(HLOCALOBJ hObj, SpriteControl* &pControl)=0;


		// Client-side models..
		
			// Iterate through the model's nodes.  Returns DE_FINISHED when there are no more.
			// hCurNode = INVALID_MODEL_NODE;
			// while(interface->GetNextModelNode(hModel, hCurNode, &hCurNode) == DE_OK)
			// { ... }
			DRESULT	(*GetNextModelNode)(HLOCALOBJ hObject, HMODELNODE hNode, HMODELNODE *pNext);

			// Get a model node's name.
			DRESULT	(*GetModelNodeName)(HLOCALOBJ hObject, HMODELNODE hNode, char *pName, DDWORD maxLen);

			// Hide/unhide a node on the model (they're all unhidden by default).
			// Returns DE_OK, DE_ERROR, LT_NOCHANGE, or DE_NODENOTFOUND.
			DRESULT	(*GetModelNodeHideStatus)(HOBJECT hObj, char *pNodeName, /* out */DBOOL *bHidden);
			DRESULT	(*SetModelNodeHideStatus)(HOBJECT hObj, char *pNodeName, DBOOL bHidden);

			// Get the current (global) transformation for a model node.
			// Returns DFALSE if the node does not exist or if the object
			// you pass in is not a model.
			DBOOL	(*GetModelNodeTransform)(HOBJECT hObj, char *pNodeName,	
				DVector *pPos, DRotation *pRot);

			// Returns the animation the model is currently on.  (DDWORD)-1 if none.
			DDWORD	(*GetModelAnimation)(HLOCALOBJ hObj);
			void	(*SetModelAnimation)(HLOCALOBJ hObj, DDWORD iAnim);

			// Get an animation index from a model.
			// Returns -1 if the animation doesn't exist (or if the object isn't a model).
			HMODELANIM	(*GetAnimIndex)(HOBJECT hObj, char *pAnimName);

			// Starts the current animation over.
			DRESULT	(*ResetModelAnimation)(HLOCALOBJ hObj);

			// Tells what the playback state of the model is (a combination of the
			// MS_ bits defined in basedefs_de.h).
			DDWORD	(*GetModelPlaybackState)(HLOCALOBJ hObj);

			// Get/Set the looping state of the model.  The default state is TRUE.
			DBOOL	(*GetModelLooping)(HLOCALOBJ hObj);
			void	(*SetModelLooping)(HLOCALOBJ hObj, DBOOL bLoop);


		// (Geometry) surface functions.

			DBOOL	(*GetSurfaceBounds)(SurfaceData *pSurface, DVector *pMin, DVector *pMax);

			// Hide/Unhide a poly.
			DRESULT	(*SetPolyHideStatus)(HPOLY hPoly, DBOOL bHide);

			// Just used for internal debugging.. never use this.
			DRESULT	(*GetPolyIndex)(HPOLY hPoly, DDWORD *pIndex);

			// Get the texture flags from a poly.  Returns DE_OK
			// or DE_ERROR if no world is loaded or hPoly is invalid.
			DRESULT	(*GetPolyTextureFlags)(HPOLY hPoly, DDWORD *pFlags);

		
		// Render hooks.

			// When this is set, the renderer will call your hook function before drawing each
			// model.  Either keep the function very fast or set it to NULL so you don't slow
			// the renderer down.
			DRESULT	(*SetModelHook)(ModelHookFn fn, void *pUser);


		// Engine hooks.

			// This is here so we can avoid adding API functions if necessary and for
			// some system-dependent or misc. stuff.  Pass in a string describing what
			// you want and it fills in pData.
			// Returns DE_OK if it understands the string or an error otherwise.
			// Strings:
			//    HWND: Returns main window handle.
			DRESULT	(*GetEngineHook)(char *pName, void **pData);


		// Network startup/join/host functions.

			// Call this function before calling any other
			// network functions. pDriver can be NULL to use the default net driver.
			// No flags are currently supported.
			DRESULT (*InitNetworking)(char *pDriver, DDWORD dwFlags);

			// Gets a list of net services (tcp/ip, modem, etc).
			DRESULT (*GetServiceList)(NetService* &pListHead);

			// Call this function when you are finished using the list returned by
			// GetServiceList().
			DRESULT (*FreeServiceList)(NetService *pListHead);

			// Selects the given service as the one to use.
			DRESULT (*SelectService)(HNETSERVICE hNetService);

			// Gets a list (and count) of enumerated sessions.
			// See driver flags for a description of pInfo.
			DRESULT (*GetSessionList)(NetSession* &pListHead, char *pInfo);

			// Call this function when you are finished using the list returned by
			// GetSessionList().
			DRESULT (*FreeSessionList)(NetSession *pListHead);


			// Alternate mode of getting session lists.  These only work for services with
			// the NETSERVICE_TCPIP flag.  These functions return immediately so you can update
			// a UI in the background without having to 'freeze' the UI while it queries hosts.

				// Start querying.  pInfo contains the address list formatted just like GetSessionLists.
				virtual DRESULT	StartQuery(char *pInfo)=0;
				
				// Update the query.  Call this as often as possible.
				virtual DRESULT UpdateQuery()=0;

				// Get the current list of results from the query.  Each time you call this,
				// a new session list is allocated and you need to free it with FreeSessionList.
				virtual DRESULT GetQueryResults(NetSession* &pListHead)=0;

				// End the current query.
				virtual DRESULT EndQuery()=0;


			// Determines if we werw lobby launched.
			DRESULT (*IsLobbyLaunched)(char* sDriver);

			// Gets the lobby launch info if available.
			DRESULT (*GetLobbyLaunchInfo)(char* sDriver, void** ppLobbyLaunchData);

			// Gets the tcp/ip address of the main driver if available.
			DRESULT (*GetTcpIpAddress)(char* sAddress, DDWORD dwBufferSize);

	protected:
		
			CommonLT	*m_pCommonLT;
			CPhysicsLT	*m_pPhysicsLT;
	};


	// For backward compatibility.. never use this.
	#define CClientDE ClientDE


#endif  // __CLIENT_DE_H__


⌨️ 快捷键说明

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