📄 client_de.h
字号:
DRect *pSrcRect, int destX, int destY, HDECOLOR hColor);
// Scales the source surface rectangle into the dest rectangle..
DRESULT (*ScaleSurfaceToSurface)(HSURFACE hDest, HSURFACE hSrc,
DRect *pDestRect, DRect *pSrcRect);
DRESULT (*ScaleSurfaceToSurfaceTransparent)(HSURFACE hDest, HSURFACE hSrc,
DRect *pDestRect, DRect *pSrcRect, HDECOLOR hColor);
DRESULT (*ScaleSurfaceToSurfaceSolidColor)(HSURFACE hDest, HSURFACE hSrc,
DRect *pDestRect, DRect *pSrcRect, HDECOLOR hTransColor, HDECOLOR hFillColor);
// (Affine) warps the source poly into the dest poly. The source
// coordinates are CLAMPED to be inside the source surface's rectangle, and
// the warp is clipped against the destination rectangle (ie: don't specify
// coordinates outside the source rectangle, but feel free to specify them
// outside the destination rectangle). The polygon you specify should be
// convex. The minimum number of coordinates is 3 and the maximum
// is 10.
DRESULT (*WarpSurfaceToSurface)(HSURFACE hDest, HSURFACE hSrc,
DWarpPt *pCoords, int nCoords);
DRESULT (*WarpSurfaceToSurfaceTransparent)(HSURFACE hDest, HSURFACE hSrc,
DWarpPt *pCoords, int nCoords, HDECOLOR hColor);
DRESULT (*WarpSurfaceToSurfaceSolidColor)(HSURFACE hDest, HSURFACE hSrc,
DWarpPt *pCoords, int nCoords, HDECOLOR hTransColor, HDECOLOR hFillColor);
// Transform the source surface onto the dest surface. The origin is
// in the destination surface's coordinates. If you specify NULL, it will
// use the centerpoint as the origin.
DRESULT (*TransformSurfaceToSurface)(HSURFACE hDest, HSURFACE hSrc,
DFloatPt *pOrigin, int destX, int destY, float angle,
float scaleX, float scaleY);
DRESULT (*TransformSurfaceToSurfaceTransparent)(HSURFACE hDest, HSURFACE hSrc,
DFloatPt *pOrigin, int destX, int destY, float angle,
float scaleX, float scaleY, HDECOLOR hColor);
// Draw a filled rectangle into the surface.
DRESULT (*FillRect)(HSURFACE hDest, DRect *pRect, HDECOLOR hColor);
// Access to client console variables...
// Register a console program. pName is just stored so it should either be
// static or allocated. When the client shell DLL is unloaded, it gets
// rid of any registered programs.
// Returns DE_OK or DE_ALREADYEXISTS.
DRESULT (*RegisterConsoleProgram)(char *pName, ConsoleProgramFn fn);
// Returns DE_OK or DE_NOTFOUND.
DRESULT (*UnregisterConsoleProgram)(char *pName);
// Returns NULL if the parameter doesn't exist.
HCONSOLEVAR (*GetConsoleVar)(char *pName);
// Gets the value of a parameter .. returns 0/NULL if you pass in NULL.
float (*GetVarValueFloat)(HCONSOLEVAR hVar);
char* (*GetVarValueString)(HCONSOLEVAR hVar);
// Access to server console mirror variables...
// The 'new' accessors for server console variables. Returns DE_NOTFOUND
// if the variable isn't found.
virtual DRESULT GetSConValueFloat(char *pName, float &val)=0;
virtual DRESULT GetSConValueString(char *pName, char *valBuf, DDWORD bufLen)=0;
// Gets the value of a parameter .. returns 0/NULL if you pass in NULL.
// OBSOLETE (will be removed soon). Use the GetSCon functions.
virtual float GetServerConVarValueFloat(char *pName)=0;
virtual char* GetServerConVarValueString(char *pName)=0;
// Helpers..
// Use these to time sections of code. Timing is done in microseconds
// (1,000,000 counts per second).
void (*StartCounter)(struct DCounter_t *pCounter);
DDWORD (*EndCounter)(struct DCounter_t *pCounter);
// Setup the panning sky stuff. Pass in DNULL for the filename if you want
// to disable the panning sky. Returns DE_NOTFOUND if it can't find
// the texture.
// index tells which global panning thing you want to change. It
// is one of the GLOBALPAN_ defines in de_codes.h.
DRESULT (*SetGlobalPanTexture)(DDWORD index, char *pFilename);
DRESULT (*SetGlobalPanInfo)(DDWORD index, float xOffset, float zOffset, float xScale, float zScale);
// Register a surface effect. You should register all your effects in OnEngineInitialized
// (before you start a world).
DRESULT (*AddSurfaceEffect)(SurfaceEffectDesc *pDesc);
// Turn the input state on or off. This is for times when the client
// is interacting with menus and you don't want their mouse movement or
// keystrokes to get sent to the server. This defaults to ON.
void (*SetInputState)(DBOOL bOn);
// Clears all the keyboard, command, and axis offset input.
DRESULT (*ClearInput)();
// Returns a list of DeviceBindings for a given device. You must call FreeDeviceBindings()
// to free the list.
DeviceBinding* (*GetDeviceBindings)(DDWORD nDevice);
void (*FreeDeviceBindings)(DeviceBinding* pBindings);
// Track Input Devices. Between calls to StartDeviceTrack() and EndDeviceTrack() no command
// states will be set through the normal input. Pass in the devices to track (DEVICETYPE_
// defines) and a buffer size for all input devices. The buffer size is the number of events
// that could occur between calls to TrackDevice(), not to exceed MAX_INPUT_BUFFER_SIZE.
// Supply TrackDevice() with an array of DeviceInput structures, and the number of structures
// in the array. When TrackDevice() returns, the pnInOut variable will contain the number of
// events that have occurred (the number of filled-in DeviceInput structures). If there were
// more events that occurred than the original buffer size allowed for, TrackDevice will return
// LT_INPUTBUFFEROVERFLOW.
DRESULT (*StartDeviceTrack)(DDWORD nDevices, DDWORD nBufferSize);
DRESULT (*TrackDevice)(DeviceInput* pInputArray, DDWORD* pnInOut);
DRESULT (*EndDeviceTrack)();
// Retrieve a list of device objects (like axes, buttons, etc.) for one or more devices.
// Pass GetDeviceObjects a combination of DEVICETYPE_ flags and it will return a DeviceObject
// (defined in basedefs_de.h) list.
// You must free the list with FreeDeviceObjects().
DeviceObject* (*GetDeviceObjects)(DDWORD nDeviceFlags);
void (*FreeDeviceObjects)(DeviceObject* pList);
// Get the name of the first input device of the given type.
// Returns either LT_OK or DE_NOTFOUND.
DRESULT (*GetDeviceName)(DDWORD nDeviceType, char* pStrBuffer, DDWORD nBufferSize);
// Find out if the specified device is enabled yet.
// Fills in the BOOL pointer and always returns LT_OK.
DRESULT (*IsDeviceEnabled)(char* strDeviceName, DBOOL* pIsEnabled);
// Attempt to enable specified device.
// Returns LT_OK or LT_ERROR.
DRESULT (*EnableDevice)(char* strDeviceName);
// These access the real, accurate timer.
float (*GetTime)();
float (*GetFrameTime)();
// These access the GAME timer (which resides on the server).
// Since this comes from the server, it will be intermittent, so only
// use it for things that must be synced with server. This timer will
// not update when there isn't a connection to the server.
float (*GetGameTime)();
float (*GetGameFrameTime)();
// Print a string to the console.
void (*CPrint)(char *pMsg, ...);
// Used to output a TRACE message to the Debug Output window. Newlines must be explicitly used.
void (*DebugOut)( char *pMsg, ... );
DBOOL (*IsCommandOn)(int commandNum);
// Same as typing a string into the console.
void (*RunConsoleString)(char *pString);
// Gives you a pointer to the client shell you created.
LPCLIENTSHELLDE (*GetClientShell)();
// Get your client object (NULL if you don't currently have one).
HLOCALOBJ (*GetClientObject)();
// Rotate a rotation around the given vector.
void (*RotateAroundAxis)(DRotation *pRotation, DVector *pAxis, float amount);
// Treat the rotation like Euler angles...
void (*EulerRotateX)(DRotation *pRotation, float amount);
void (*EulerRotateY)(DRotation *pRotation, float amount);
void (*EulerRotateZ)(DRotation *pRotation, float amount);
// Align a rotation to a normal. The vector you pass in becomes the
// forward vector in the rotation it outputs.
// Use pUp to set the frame of reference or set it to NULL, in which case
// the up vector could be anything. pUp should not be equal to pVector.
void (*AlignRotation)(DRotation *pRotation, DVector *pVector, DVector *pUp);
// OBSOLETE: use CommonLT::SetupEuler.
virtual DRESULT SetupEuler(DRotation *pRotation, float pitch, float yaw, float roll)=0;
// Interpolate between two rotations (with quaternions).
DRESULT (*InterpolateRotation)(DRotation *pDest, DRotation *pRot1, DRotation *pRot2, float t);
// OBSOLETE. Use CommonLT::GetRotationVectors.
virtual DRESULT GetRotationVectors(DRotation *pRotation, DVector *pUp, DVector *pRight, DVector *pForward)=0;
// You can set a global light scale that's applied to all rendering.
// Colors are RGB 0-1 (values are clamped for you).
void (*GetGlobalLightScale)(DVector *pScale);
void (*SetGlobalLightScale)(DVector *pScale);
void (*OffsetGlobalLightScale)(DVector *pOffset);
// Obsolete, use Parse2.
int (*Parse)(char *pCommand, char **pNewCommandPos, char *argBuffer, char **argPointers, int *nArgs);
// Messaging.
virtual HMESSAGEWRITE StartMessage(DBYTE messageID)=0;
virtual DRESULT EndMessage(HMESSAGEWRITE hMessage)=0; // Just calls EndMessage2 with MESSAGE_GUARANTEED.
virtual DRESULT EndMessage2(HMESSAGEWRITE hMessage, DDWORD flags)=0;
// NEW message functions. These functions don't free the message so you need to
// call LMessage::Release after sending.
virtual DRESULT SendToServer(LMessage &msg, DBYTE msgID, DDWORD flags)=0;
// Management of client-side objects.
HLOCALOBJ (*CreateObject)(ObjectCreateStruct *pStruct);
DRESULT (*DeleteObject)(HLOCALOBJ hObj);
// Gets the objects attached to this object. outListSize is filled in with how many
// objects it filled into inList and outNumAttachment is the actual number of attachments
// (which can be larger than outListSize if inListSize is too small to fit them all).
DRESULT (*GetAttachments)(HLOCALOBJ hObj, HLOCALOBJ *inList, DDWORD inListSize,
DDWORD *outListSize, DDWORD *outNumAttachments);
// Updates the position/rotation of the attachments on the object. Attachments are
// always automatically updated when the object is rendered.
virtual DRESULT ProcessAttachments(HOBJECT hObj)=0;
// Change position and rotation. It's more efficient to set them
// at the same time...
void (*GetObjectPos)(HLOCALOBJ hObj, DVector *pPos);
void (*SetObjectPos)(HLOCALOBJ hObj, DVector *pPos);
void (*GetObjectRotation)(HLOCALOBJ hObj, DRotation *pRotation);
void (*SetObjectRotation)(HLOCALOBJ hObj, DRotation *pRotation);
void (*SetObjectPosAndRotation)(HLOCALOBJ hObj, DVector *pPos, DRotation *pRotation);
DDWORD (*GetObjectType)(HLOCALOBJ hObj);
// Get/Set scale.
DRESULT (*GetObjectScale)(HLOCALOBJ hObj, DVector *pScale);
DRESULT (*SetObjectScale)(HLOCALOBJ hObj, DVector *pScale);
// RGB 0-1.
void (*GetObjectColor)(HLOCALOBJ hObject, float *r, float *g, float *b, float *a);
void (*SetObjectColor)(HLOCALOBJ hObject, float r, float g, float b, float a);
DDWORD (*GetObjectFlags)(HLOCALOBJ hObj);
void (*SetObjectFlags)(HLOCALOBJ hObj, DDWORD flags);
// Get/Set object user flags. Can't set user flags on an object
// created on the server.
DRESULT (*GetObjectUserFlags)(HLOCALOBJ hObj, DDWORD *pFlags);
DRESULT (*SetObjectUserFlags)(HLOCALOBJ hObj, DDWORD flags);
// Get/set the client flags (defined above).
DDWORD (*GetObjectClientFlags)(HLOCALOBJ hObj);
void (*SetObjectClientFlags)(HLOCALOBJ hObj, DDWORD flags);
// User data for the object..
void* (*GetObjectUserData)(HLOCALOBJ hObj);
void (*SetObjectUserData)(HLOCALOBJ hObj, void *pData);
// Camera functions.
// Gets the 3D coordinates of a screen coordinate given a camera. The 3D
// coordinate is one unit out along the forward vector. Returns DE_OUTSIDE
// if the screen coordinates aren't inside the camera's rectangle.
DRESULT (*Get3DCameraPt)(HLOCALOBJ hCamera, int sx, int sy, DVector *pOut);
// Get/Set a camera's FOV. It defaults to (PI/2, PI/2).
// It will clamp your values between (PI/100, 99*PI/100)
void (*GetCameraFOV)(HLOCALOBJ hObj, float *pX, float *pY);
void (*SetCameraFOV)(HLOCALOBJ hObj, float fovX, float fovY);
void (*GetCameraRect)(HLOCALOBJ hObj, DBOOL *bFullscreen,
int *left, int *top, int *right, int *bottom);
// Set the camera's rectangle on the screen.
// If bFullscreen is DTRUE, then it ignores the rect and draws the
// camera fullscreen. If the rectangle extends over the screen
// boundaries, then it is clipped..
void (*SetCameraRect)(HLOCALOBJ hObj, DBOOL bFullscreen,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -