|
You last visited: Today at 20:37
Advertisement
Drawing Text ( CDraw Class )
Discussion on Drawing Text ( CDraw Class ) within the Last Chaos forum part of the MMORPGs category.
07/07/2012, 00:31
|
#1
|
elite*gold: 150
Join Date: Apr 2007
Posts: 2,392
Received Thanks: 6,644
|
Drawing Text ( CDraw Class )
Inspired by Mr0x90 who first posted something about a PutTextCharEx
hook a while ago. hook.h is the Header of my own Hooking class but
you can just use Microsoft Detours instead ( its very very similar
to my Code ). For a MS Detours Tutorial take a look here:
You can also use other functions as the PutTextCharEx from the
CDraw Class inside the hook and could draw your complete
own menu or whatever you like to. The CDraw Functions
are kinda simple. If you have any Questions, feel free to ask.
Code:
#include <windows.h>
#include "hook.h"
Hook * Drawhook = NULL;
DWORD WINAPI hookthread( LPVOID Param );
void __fastcall myDrawText( void* this, void* unusededx, char const * szString, int stringlength, long xpos, long ypos, unsigned long rgba, unsigned long unk1, int unk2, unsigned long unk3 );
typedef void (__thiscall* CDrawPort__PutTextCharExCX)( void* ecx, char const * szString, int stringlength, long xpos, long ypos, unsigned long rgba, unsigned long unk1, int unk2, unsigned long unk3 );
CDrawPort__PutTextCharExCX oPutTextChar = NULL;
BOOL WINAPI DllMain( HMODULE hModule, DWORD reason, LPVOID lpReserved )
{
UNREFERENCED_PARAMETER(lpReserved);
if (reason == DLL_PROCESS_ATTACH)
{
DisableThreadLibraryCalls(hModule);
CreateThread(NULL, NULL, hookthread, NULL, NULL, NULL);
return 1;
}
else if (reason == DLL_PROCESS_DETACH)
{
Drawhook->RemoveHook();
return 0;
}
return 0;
}
void __fastcall myDrawText( void* this, void* unusededx, char const * szString, int stringlength, long xpos, long ypos, unsigned long rgba, unsigned long unk1, int unk2, unsigned long unk3 )
{
oPutTextChar( this, szString, stringlength, xpos, ypos, rgba, unk1, unk2, unk3 );
oPutTextChar( this, "wurstbrot123", 12, 400, 50, 0x0000FFFF, unk1, unk2, unk3 );
}
DWORD WINAPI hookthread( LPVOID Param )
{
HMODULE hmod = 0;
while(!hmod )
{
hmod = GetModuleHandle("engine");
Sleep(50);
}
unsigned long puttextaddress = reinterpret_cast<unsigned long>( GetProcAddress( hmod , "?PutTextCharEx@CDrawPort@@QBEXPBDHJJKMHK@Z" ));
if( puttextaddress )
{
Drawhook = new Hook( puttextaddress, 8, (DWORD)myDrawText );
oPutTextChar = (CDrawPort__PutTextCharExCX)Drawhook->HookFunc();
}
return 0;
}
|
|
|
07/07/2012, 10:22
|
#2
|
elite*gold: 2
Join Date: Aug 2007
Posts: 599
Received Thanks: 2,927
|
Das hier könnte helfen, aber ich denke kaum jemand in dieser section versteht etwas davon, bzw. wird es nutzen.
Code:
//DrawPort.h Zeile 170:
// Writes text on drawport ( expansion version )
void PutTextEx( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend = 0xF2F2F2FF,
FLOAT fZ = 0, BOOL bShadow = FALSE, const COLOR colShadow = 0x181818B2 ) const;
void PutTextCharEx( const char *pText, int nLength, PIX pixX0, PIX pixY0, const COLOR colBlend = 0xF2F2F2FF,
FLOAT fZ = 0, BOOL bShadow = FALSE, const COLOR colShadow = 0x181818B2 ) const;
// Writes text string on drawport ( centered arround X, expansion version )
void PutTextExCX( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend = 0xF2F2F2FF,
FLOAT fZ = 0, BOOL bShadow = FALSE, const COLOR colShadow = 0x181818B2 ) const;
// Writes text string on drawport ( right-aligned, expansion version )
void PutTextExRX( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend = 0xF2F2F2FF,
FLOAT fZ = 0, BOOL bShadow = FALSE, const COLOR colShadow = 0x181818B2 ) const;
// Writes text string on drawport ( centered arround X, expansion version, expansion version )
void PutTextCharExCX( const char *pText, int nLength, PIX pixX0, PIX pixY0, const COLOR colBlend = 0xF2F2F2FF,
FLOAT fZ = 0, BOOL bShadow = FALSE, const COLOR colShadow = 0x181818B2 ) const;
// Writes text string on drawport ( right-aligned, expansion version, expansion version )
void PutTextCharExRX( const char *pText, int nLength, PIX pixX0, PIX pixY0, const COLOR colBlend = 0xF2F2F2FF,
FLOAT fZ = 0, BOOL bShadow = FALSE, const COLOR colShadow = 0x181818B2 ) const;
// Flush rendering queue for text ( expansion versoin )
void EndTextEx( BOOL bDepthTest = FALSE );
|
|
|
07/07/2012, 10:34
|
#3
|
elite*gold: 150
Join Date: Apr 2007
Posts: 2,392
Received Thanks: 6,644
|
Die anderen CDraw Funktionen wären noch Intressant gewesen
aber naja....IDA ist auch eine gute hilfe, muss man halt nur
etwas mehr testen usw
|
|
|
07/07/2012, 10:40
|
#4
|
elite*gold: 2
Join Date: Aug 2007
Posts: 599
Received Thanks: 2,927
|
Quote:
Originally Posted by wurstbrot123
Die anderen CDraw Funktionen wären noch Intressant gewesen
aber naja....IDA ist auch eine gute hilfe, muss man halt nur
etwas mehr testen usw 
|
Ich könnte auch den ganzen source posten, aber dann sind einige personen (Gamigo, Aeria, Barunson, 777 Admin) böse auf mich ^^, deswegen lass ich das lieber.
noch ein paar der anderen funktionen:
Code:
// returns width of entire text string (with scale included)
ULONG GetTextWidth( const CTString &strText) const;
CTString GetTextWidth(const CTString &strText, INDEX nWidth) const;
// writes text string on drawport (left-aligned)
void PutText( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend=0xFFFFFFFF) const;
// writes text string on drawport (centered arround X)
void PutTextC( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend=0xFFFFFFFF) const;
// writes text string on drawport (centered arround X and Y)
void PutTextCXY( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend=0xFFFFFFFF) const;
// writes text string on drawport (right-aligned)
void PutTextR( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend=0xFFFFFFFF) const;
// Adds one part of button texture to rendering queue
void AddBtnTexture( const int nTexID, const FLOAT fI0, const FLOAT fJ0, const FLOAT fI1, const FLOAT fJ1,
const FLOAT fU0, const FLOAT fV0, const FLOAT fU1, const FLOAT fV1,
const COLOR col ) const;
// Flush rendering queue for button
void FlushBtnRenderingQueue( int nBtnType, const ULONG ulPBT = 203 );
// yjpark -->|
// plain texture display
void PutTexture( class CTextureObject *pTO, const PIXaabbox2D &boxScreen,
const COLOR colBlend=0xFFFFFFFF, const ULONG ulPBT=203) const;
void PutTexture( class CTextureObject *pTO, const PIXaabbox2D &boxScreen,
const COLOR colUL, const COLOR colUR, const COLOR colDL, const COLOR colDR,
const ULONG ulPBT=203) const;
void PutTexture( class CTextureObject *pTO, const PIXaabbox2D &boxScreen,
const MEXaabbox2D &boxTexture, const COLOR colBlend=0xFFFFFFFF,
const ULONG ulPBT=203) const;
void PutTexture( class CTextureObject *pTO, const PIXaabbox2D &boxScreen, const MEXaabbox2D &boxTexture,
const COLOR colUL, const COLOR colUR, const COLOR colDL, const COLOR colDR,
const ULONG ulPBT=203) const;
// advanced texture display
void InitTexture( class CTextureObject *pTO, const BOOL bClamp=FALSE,
const ULONG ulPBT=203) const; // prepares texture and rendering arrays
void InitTextureData( class CTextureData *pTD, const BOOL bClamp = FALSE, const ULONG ulPBT = 203,
const BOOL bDepthTest = FALSE ) const;
// adds one full texture to rendering queue
void AddTexture( const FLOAT fI0, const FLOAT fJ0, const FLOAT fI1, const FLOAT fJ1, const COLOR col) const;
// adds one part of texture to rendering queue
void AddTexture( const FLOAT fI0, const FLOAT fJ0, const FLOAT fI1, const FLOAT fJ1,
const FLOAT fU0, const FLOAT fV0, const FLOAT fU1, const FLOAT fV1,
const COLOR col, FLOAT fZ = 0 ) const;
// adds one textured quad to rendering queue (up-left start, counter-clockwise)
void AddTexture( const FLOAT fI0, const FLOAT fJ0, const FLOAT fU0, const FLOAT fV0, const COLOR col0,
const FLOAT fI1, const FLOAT fJ1, const FLOAT fU1, const FLOAT fV1, const COLOR col1,
const FLOAT fI2, const FLOAT fJ2, const FLOAT fU2, const FLOAT fV2, const COLOR col2,
const FLOAT fI3, const FLOAT fJ3, const FLOAT fU3, const FLOAT fV3, const COLOR col3) const;
// adds one textured quad to rendering queue (up-left start, counter-clockwise)
void AddTexture( const FLOAT fI0, const FLOAT fJ0, const FLOAT fI1, const FLOAT fJ1, // yjpark
const FLOAT fU0, const FLOAT fV0, const FLOAT fU1, const FLOAT fV1,
const FLOAT fU2, const FLOAT fV2, const FLOAT fU3, const FLOAT fV3, const COLOR col ) const;
// adds one flat triangle rendering queue (up-left start, counter-clockwise)
void AddTriangle( const FLOAT fI0, const FLOAT fJ0, const FLOAT fI1, const FLOAT fJ1,
const FLOAT fI2, const FLOAT fJ2, const COLOR col) const;
// renders all textures from rendering queue and flushed rendering arrays
void FlushRenderingQueue(void) const;
// (DEPRECATED!) lock and unlock raster thru drawport functions
BOOL Lock(void) { return Lock_internal(); }
void Unlock(void) { Unlock_internal(); }
// set this drawport as current for rendering on it
void SetAsCurrent(void);
// draw point (can be several pixels - depends on radius)
void DrawPoint( PIX pixI, PIX pixJ, COLOR col, PIX pixRadius=1) const;
void DrawPoint3D( FLOAT3D v, COLOR col, FLOAT fRadius=1.0f) const; // in 3D
// draw line
void DrawLine( PIX pixI0, PIX pixJ0, PIX pixI1, PIX pixJ1, COLOR col, ULONG typ=_FULL_) const;
void DrawLine3D( FLOAT3D v0, FLOAT3D v1, COLOR col) const; // in 3D
// draw border
void DrawBorder( PIX pixI, PIX pixJ, PIX pixWidth, PIX pixHeight, COLOR col, ULONG typ=_FULL_) const;
// fill with blending part of a drawport with a given color
void Fill( PIX pixI, PIX pixJ, PIX pixWidth, PIX pixHeight, COLOR col) const;
// fill with blending part of a drawport with a four corner colors
void Fill( PIX pixI, PIX pixJ, PIX pixWidth, PIX pixHeight,
COLOR colUL, COLOR colUR, COLOR colDL, COLOR colDR) const;
// fill an part of Z-Buffer with a given value
void FillZBuffer( PIX pixI, PIX pixJ, PIX pixWidth, PIX pixHeight, FLOAT zval) const;
// fill without blending an entire drawport with a given color
void Fill( COLOR col) const;
// fill an entire Z-Buffer with a given value
void FillZBuffer( FLOAT zval) const;
// grab screen (iGrabZBuffer: 0=no, 1=if allowed, 2=yes)
void GrabScreen( class CImageInfo &iiGrabbedImage, INDEX iGrabZBuffer=0) const;
// render one lens flare
void RenderLensFlare( CTextureObject *pto, FLOAT fI, FLOAT fJ,
FLOAT fSizeI, FLOAT fSizeJ, ANGLE aRotation, COLOR colLight) const;
// blend entire drawport with accumulated colors
void BlendScreen(void);
int CheckShowCharLength(char* strString, int nWidth);
int GetTextSectionWidth(char* strString, int nSectionEnd, BOOL bIsPassWordBox);
void StockCurrentTextureData(CTextureData* cT) { stCurrentTextureData = cT; };
|
|
|
07/07/2012, 10:50
|
#5
|
elite*gold: 150
Join Date: Apr 2007
Posts: 2,392
Received Thanks: 6,644
|
Quote:
Originally Posted by dsfgd
Ich könnte auch den ganzen source posten, aber dann sind einige personen (Gamigo, Aeria, Barunson, 777 Admin) böse auf mich ^^, deswegen lass ich das lieber.
|
Verständlich aber schade ^^
Danke für die Posts, gegebenfalls guck ich mir einige Funktionen
davon demnächst mal an und guck was sich so machen lässt
|
|
|
07/07/2012, 12:20
|
#6
|
elite*gold: 0
Join Date: Apr 2010
Posts: 399
Received Thanks: 187
|
Sorry, dass ich jetzt so "dumm" frage, aber was bringt das und was kann man damit machen?
|
|
|
07/07/2012, 12:42
|
#7
|
elite*gold: 124
Join Date: Dec 2009
Posts: 2,114
Received Thanks: 3,142
|
So wie ich das sehe, kann man damit Text oder andere Objekte im Spiel anzeigen lassen.
Also z.B. könntest du damit die HP des Target nicht nur im Trainer, sondern direkt im LC-Fenster anzeigen.
Lasse mich da gerne eines besseren belehren, aber ich glaube nicht, dass man damit besonders nützliche Sachen machen kann. Das ist eher ne Spielerei.
|
|
|
07/07/2012, 13:00
|
#8
|
elite*gold: 150
Join Date: Apr 2007
Posts: 2,392
Received Thanks: 6,644
|
Generell kann man sich mit den ganzen Funktionen
( nicht nur die die ich gepostet hab ) zum Beispiel
auch einen eigenen Radar Zeichnen der Drops
Spieler Level uvm anzeigt, was man natürlich auch
nicht durchgehend Zeichnen muss. Nützlich im Sinne
von "Hacks" wie Attackspeed etc wohl eher weniger ja,
aber generell kann man damit schon viel anstellen.
|
|
|
07/07/2012, 16:54
|
#9
|
elite*gold: 265
Join Date: Jul 2009
Posts: 735
Received Thanks: 2,147
|
Quote:
Originally Posted by dsfgd
Ich könnte auch den ganzen source posten, aber dann sind einige personen (Gamigo, Aeria, Barunson, 777 Admin) böse auf mich ^^, deswegen lass ich das lieber.
|
I dont mind if they will be angry at me 
I dont see much problem in posting just this simple drawport stuff
Code:
#ifndef SE_INCL_DRAWPORT_H
#define SE_INCL_DRAWPORT_H
#ifdef PRAGMA_ONCE
#pragma once
#endif
#include <Engine/Base/Lists.h>
// public drawport's text flags
#define DPTF_BOLD (1L<<0)
#define DPTF_ITALIC (1L<<1)
// internals
#define DPTF_PRINTSPECIALCODES (1L<<10)
#define DPTF_IGNORESPECIALCODES (1L<<11)
class ENGINE_API CDrawPort {
// implementation:
public:
class CRaster *dp_Raster; // pointer to the Raster this refers to
class CFontData *dp_FontData; // pointer to the current text font
// drawport box relative to the raster's origin
PIX dp_MinI, dp_MinJ;
PIX dp_MaxI, dp_MaxJ;
// drawport scissoring box relative to the raster's origin
PIX dp_ScissorMinI, dp_ScissorMinJ;
PIX dp_ScissorMaxI, dp_ScissorMaxJ;
PIX dp_pixTextCharSpacing; // space between chars in text
PIX dp_pixTextLineSpacing; // space between lines in text
FLOAT dp_fTextScaling; // scaling factor for font size
FLOAT dp_fTextAspect; // aspect ratio for font (x/y)
FLOAT dp_fTextShadow; // drop-shadow direction and offset (<0=up-left, >0=down-right, 0=none)
ULONG dp_ulTextFlags; // see DPTF_...
ULONG dp_ulTextBlendingType; // prredefinedBlendType (PBT_BLEND and such) - cannot use wrapper's enum here
FLOAT dp_fWideAdjustment; // for wide (16:9 or 16:10) screen support (needed in some calculations) = 1.0f or >1 (10/12 perhaps)
BOOL dp_bRenderingOverlay; // set when scene renderer requires overlay mode (don't clear z-buffer)
// adjust this during frame to be used for screen blending
ULONG dp_ulBlendingRA, dp_ulBlendingGA, dp_ulBlendingBA; // r*a, g*a, b*a
ULONG dp_ulBlendingA;
// (DEPRECATED!)
void InitCloned(CDrawPort *pdpBase, double rMinI,double rMinJ, double rSizeI,double rSizeJ);
BOOL Lock_internal(void);
void Unlock_internal(void);
// Recalculate pixel dimensions from relative dimensions and raster size
void RecalculateDimensions(void);
// set orthogonal projection
void SetOrtho(void) const;
// set given projection
void SetProjection(CAnyProjection3D &apr);
//interface:
// default constructor
CDrawPort(void);
// copy constructor
CDrawPort(const CDrawPort *pdpOriginal);
// assignment operation
CDrawPort &operator=(CDrawPort &dpOriginal);
// destructor
~CDrawPort(void);
// set physical rectangle in physical coordinates
void SetPhysicalRectInPhysical(const PIXaabbox2D &rect);
// set physical rectangle in logical coordinates
void SetPhysicalRectInLogical(const PIXaabbox2D &rect);
// set physical rectangle in raster coordinates (low-level function)
void SetPhysicalRectInRaster(const PIXaabbox2D &rect);
// set logical rectangle in logical coordinates
void SetLogicalRectInLogical(const PIXaabbox2D &rect);
// set logical rectangle in physical coordinates
void SetLogicalRectInPhysical(const PIXaabbox2D &rect);
// set logical rectangle in raster coordinates (low-level function)
void SetLogicalRectInRaster(const PIXaabbox2D &rect);
// create a smaller subdrawport
CDrawPort CreateSubDrawPort(const PIXaabbox2D &rect);
CDrawPort CreateSubDrawPortRatio(const FLOATaabbox2D &rect);
// DEPRECATED! -- old drawport cloning functions
CDrawPort( CDrawPort *pdpBase, double rMinI,double rMinJ, double rSizeI,double rSizeJ);
CDrawPort( CDrawPort *pdpBase, const PIXaabbox2D &box);
CDrawPort( CDrawPort *pdpBase, const INDEX iMonitor); // iMonitor: -1=left, 0=center, +1=right
void MakeWideScreen(CDrawPort *pdp);
// check if a drawport is dualhead, triplehead or widescreen
BOOL IsDualHead( void);
BOOL IsTripleHead(void);
BOOL IsWideScreen(void);
// set/get rendering in overlay mode
inline void SetOverlappedRendering(BOOL bOverlay) { dp_bRenderingOverlay = bOverlay; };
inline BOOL IsOverlappedRendering(void) const { return dp_bRenderingOverlay; };
// returns unique drawport number
ULONG GetID(void);
// Get dimensions and location of drawport
inline PIX GetWidth( void) const { return dp_MaxI-dp_MinI; };
inline PIX GetHeight(void) const { return dp_MaxJ-dp_MinJ; };
// text manipulation
void SetFont( CFontData *pfd); // WARNING: this resets text variables
inline void SetTextCharSpacing( PIX pixSpacing) { dp_pixTextCharSpacing = pixSpacing; };
inline void SetTextLineSpacing( PIX pixSpacing) { dp_pixTextLineSpacing = pixSpacing; };
inline void SetTextScaling( FLOAT fScalingFactor) { dp_fTextScaling = fScalingFactor; };
inline void SetTextAspect( FLOAT fAspectRatio) { dp_fTextAspect = fAspectRatio; };
inline void SetTextShadow( FLOAT fShadow) { dp_fTextShadow = fShadow; };
inline void SetTextBlendingType( ULONG ulBlendingType) { dp_ulTextBlendingType = ulBlendingType; };
inline void SetTextFlags( ULONG ulFlags) { dp_ulTextFlags = ulFlags; };
// text output mode (-1 = print special codes, 0 = ignore special codes, 1 = parse special codes)
inline void SetTextMode( INDEX iMode) {
dp_ulTextFlags &= ~(DPTF_PRINTSPECIALCODES|DPTF_IGNORESPECIALCODES);
if( iMode <0) dp_ulTextFlags |= DPTF_PRINTSPECIALCODES;
else if( iMode==0) dp_ulTextFlags |= DPTF_IGNORESPECIALCODES;
};
// returns width of entire text string (with scale included)
ULONG GetTextWidth( const CTString &strText) const;
// writes text string on drawport (left-aligned)
void PutText( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend=0xFFFFFFFF) const;
// writes text string on drawport (centered arround X)
void PutTextC( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend=0xFFFFFFFF) const;
// writes text string on drawport (centered arround X and Y)
void PutTextCXY( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend=0xFFFFFFFF) const;
// writes text string on drawport (right-aligned)
void PutTextR( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend=0xFFFFFFFF) const;
// yjpark |<--
// Writes text on drawport ( expansion version ) - internal
void PutTextExKor( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend,
FLOAT fZ, BOOL bShadow, const COLOR colShadow ) const;
void PutTextExCht( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend,
FLOAT fZ, BOOL bShadow, const COLOR colShadow ) const;
void PutTextExChs( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend,
FLOAT fZ, BOOL bShadow, const COLOR colShadow ) const;
void PutTextExThai( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend,
FLOAT fZ, BOOL bShadow, const COLOR colShadow ) const;
void PutTextExJap( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend, // wooss 051021
FLOAT fZ, BOOL bShadow, const COLOR colShadow ) const;
void PutTextCharExKor( const char *pText, int nLength, PIX pixX0, PIX pixY0, const COLOR colBlend,
FLOAT fZ, BOOL bShadow, const COLOR colShadow ) const;
void PutTextCharExCht( const char *pText, int nLength, PIX pixX0, PIX pixY0, const COLOR colBlend,
FLOAT fZ, BOOL bShadow, const COLOR colShadow ) const;
void PutTextCharExChs( const char *pText, int nLength, PIX pixX0, PIX pixY0, const COLOR colBlend,
FLOAT fZ, BOOL bShadow, const COLOR colShadow ) const;
void PutTextCharExThai( const char *pText, int nLength, PIX pixX0, PIX pixY0, const COLOR colBlend,
FLOAT fZ, BOOL bShadow, const COLOR colShadow ) const;
void PutTextCharExJap( const char *pText, int nLength, PIX pixX0, PIX pixY0, const COLOR colBlend,
FLOAT fZ, BOOL bShadow, const COLOR colShadow ) const;
// Writes text on drawport ( expansion version )
void PutTextEx( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend = 0xF2F2F2FF,
FLOAT fZ = 0, BOOL bShadow = FALSE, const COLOR colShadow = 0x181818B2 ) const;
void PutTextCharEx( const char *pText, int nLength, PIX pixX0, PIX pixY0, const COLOR colBlend = 0xF2F2F2FF,
FLOAT fZ = 0, BOOL bShadow = FALSE, const COLOR colShadow = 0x181818B2 ) const;
// Writes text string on drawport ( centered arround X, expansion version )
void PutTextExCX( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend = 0xF2F2F2FF,
FLOAT fZ = 0, BOOL bShadow = FALSE, const COLOR colShadow = 0x181818B2 ) const;
// Writes text string on drawport ( right-aligned, expansion version )
void PutTextExRX( const CTString &strText, PIX pixX0, PIX pixY0, const COLOR colBlend = 0xF2F2F2FF,
FLOAT fZ = 0, BOOL bShadow = FALSE, const COLOR colShadow = 0x181818B2 ) const;
// Writes text string on drawport ( centered arround X, expansion version, expansion version )
void PutTextCharExCX( const char *pText, int nLength, PIX pixX0, PIX pixY0, const COLOR colBlend = 0xF2F2F2FF,
FLOAT fZ = 0, BOOL bShadow = FALSE, const COLOR colShadow = 0x181818B2 ) const;
// Writes text string on drawport ( right-aligned, expansion version, expansion version )
void PutTextCharExRX( const char *pText, int nLength, PIX pixX0, PIX pixY0, const COLOR colBlend = 0xF2F2F2FF,
FLOAT fZ = 0, BOOL bShadow = FALSE, const COLOR colShadow = 0x181818B2 ) const;
// Flush rendering queue for text ( expansion versoin )
void EndTextEx( BOOL bDepthTest = FALSE );
// Adds one part of button texture to rendering queue
void AddBtnTexture( const int nTexID, const FLOAT fI0, const FLOAT fJ0, const FLOAT fI1, const FLOAT fJ1,
const FLOAT fU0, const FLOAT fV0, const FLOAT fU1, const FLOAT fV1,
const COLOR col ) const;
// Flush rendering queue for button
void FlushBtnRenderingQueue( int nBtnType, const ULONG ulPBT = 203 );
// yjpark -->|
// plain texture display
void PutTexture( class CTextureObject *pTO, const PIXaabbox2D &boxScreen,
const COLOR colBlend=0xFFFFFFFF, const ULONG ulPBT=203) const;
void PutTexture( class CTextureObject *pTO, const PIXaabbox2D &boxScreen,
const COLOR colUL, const COLOR colUR, const COLOR colDL, const COLOR colDR,
const ULONG ulPBT=203) const;
void PutTexture( class CTextureObject *pTO, const PIXaabbox2D &boxScreen,
const MEXaabbox2D &boxTexture, const COLOR colBlend=0xFFFFFFFF,
const ULONG ulPBT=203) const;
void PutTexture( class CTextureObject *pTO, const PIXaabbox2D &boxScreen, const MEXaabbox2D &boxTexture,
const COLOR colUL, const COLOR colUR, const COLOR colDL, const COLOR colDR,
const ULONG ulPBT=203) const;
// advanced texture display
void InitTexture( class CTextureObject *pTO, const BOOL bClamp=FALSE,
const ULONG ulPBT=203) const; // prepares texture and rendering arrays
void InitTextureData( class CTextureData *pTD, const BOOL bClamp = FALSE, const ULONG ulPBT = 203,
const BOOL bDepthTest = FALSE ) const;
// adds one full texture to rendering queue
void AddTexture( const FLOAT fI0, const FLOAT fJ0, const FLOAT fI1, const FLOAT fJ1, const COLOR col) const;
// adds one part of texture to rendering queue
void AddTexture( const FLOAT fI0, const FLOAT fJ0, const FLOAT fI1, const FLOAT fJ1,
const FLOAT fU0, const FLOAT fV0, const FLOAT fU1, const FLOAT fV1,
const COLOR col, FLOAT fZ = 0 ) const;
// adds one textured quad to rendering queue (up-left start, counter-clockwise)
void AddTexture( const FLOAT fI0, const FLOAT fJ0, const FLOAT fU0, const FLOAT fV0, const COLOR col0,
const FLOAT fI1, const FLOAT fJ1, const FLOAT fU1, const FLOAT fV1, const COLOR col1,
const FLOAT fI2, const FLOAT fJ2, const FLOAT fU2, const FLOAT fV2, const COLOR col2,
const FLOAT fI3, const FLOAT fJ3, const FLOAT fU3, const FLOAT fV3, const COLOR col3) const;
// adds one textured quad to rendering queue (up-left start, counter-clockwise)
void AddTexture( const FLOAT fI0, const FLOAT fJ0, const FLOAT fI1, const FLOAT fJ1, // yjpark
const FLOAT fU0, const FLOAT fV0, const FLOAT fU1, const FLOAT fV1,
const FLOAT fU2, const FLOAT fV2, const FLOAT fU3, const FLOAT fV3, const COLOR col ) const;
// adds one flat triangle rendering queue (up-left start, counter-clockwise)
void AddTriangle( const FLOAT fI0, const FLOAT fJ0, const FLOAT fI1, const FLOAT fJ1,
const FLOAT fI2, const FLOAT fJ2, const COLOR col) const;
// renders all textures from rendering queue and flushed rendering arrays
void FlushRenderingQueue(void) const;
// (DEPRECATED!) lock and unlock raster thru drawport functions
BOOL Lock(void) { return Lock_internal(); }
void Unlock(void) { Unlock_internal(); }
// set this drawport as current for rendering on it
void SetAsCurrent(void);
// draw point (can be several pixels - depends on radius)
void DrawPoint( PIX pixI, PIX pixJ, COLOR col, PIX pixRadius=1) const;
void DrawPoint3D( FLOAT3D v, COLOR col, FLOAT fRadius=1.0f) const; // in 3D
// draw line
void DrawLine( PIX pixI0, PIX pixJ0, PIX pixI1, PIX pixJ1, COLOR col, ULONG typ=_FULL_) const;
void DrawLine3D( FLOAT3D v0, FLOAT3D v1, COLOR col) const; // in 3D
// draw border
void DrawBorder( PIX pixI, PIX pixJ, PIX pixWidth, PIX pixHeight, COLOR col, ULONG typ=_FULL_) const;
// fill with blending part of a drawport with a given color
void Fill( PIX pixI, PIX pixJ, PIX pixWidth, PIX pixHeight, COLOR col) const;
// fill with blending part of a drawport with a four corner colors
void Fill( PIX pixI, PIX pixJ, PIX pixWidth, PIX pixHeight,
COLOR colUL, COLOR colUR, COLOR colDL, COLOR colDR) const;
// fill an part of Z-Buffer with a given value
void FillZBuffer( PIX pixI, PIX pixJ, PIX pixWidth, PIX pixHeight, FLOAT zval) const;
// fill without blending an entire drawport with a given color
void Fill( COLOR col) const;
// fill an entire Z-Buffer with a given value
void FillZBuffer( FLOAT zval) const;
// grab screen (iGrabZBuffer: 0=no, 1=if allowed, 2=yes)
void GrabScreen( class CImageInfo &iiGrabbedImage, INDEX iGrabZBuffer=0) const;
// functions for getting depth of points on drawport
//°*µ¿¹Î ¼öÁ¤ ½ÃÀÛ Water ±¸Çö 04.22
//BOOL IsPointVisible(PIX pixI, PIX pixJ, FLOAT fOoK, INDEX iID, INDEX iMirrorLevel=0) const; // ¿øº».
BOOL IsPointVisible(CAnyProjection3D &apr, PIX pixI, PIX pixJ, FLOAT fOoK, INDEX iID, INDEX iMirrorLevel=0) const;
//°*µ¿¹Î ¼öÁ¤ ³¡ Water ±¸Çö 04.22
// render one lens flare
void RenderLensFlare( CTextureObject *pto, FLOAT fI, FLOAT fJ,
FLOAT fSizeI, FLOAT fSizeJ, ANGLE aRotation, COLOR colLight) const;
// blend entire drawport with accumulated colors
void BlendScreen(void);
};
void ENGINE_API Particle_PrepareSystem( CDrawPort *pdpDrawPort, CAnyProjection3D &prProjection);
void ENGINE_API Particle_EndSystem( BOOL bRestoreOrtho=TRUE);
void ENGINE_API Particle_PrepareEntity( const FLOAT fMipFactor, const BOOL bHasFog, const BOOL bHasHaze,
const BOOL bSkipClipping, CEntity *penViewer);
FLOAT ENGINE_API Particle_GetMipFactor(void);
INDEX ENGINE_API Particle_GetDrawPortID(void);
ENGINE_API CEntity *Particle_GetViewer(void);
ENGINE_API CProjection3D *Particle_GetProjection(void);
void ENGINE_API Particle_PrepareTexture( CTextureObject *pto, const enum PredefinedBlendType pbt);
void ENGINE_API Particle_SetTexturePart( const MEX mexWidth, const MEX mexHeight, const INDEX iCol, const INDEX iRow);
void ENGINE_API Particle_SetTextureSection( const PIX pixLeft, const PIX pixTop, const PIX pixRight, const PIX pixBottom);
void ENGINE_API Particle_RenderSquare( const FLOAT3D &vPos, FLOAT fSize, ANGLE aRotation, COLOR col, FLOAT fYRatio=1.0f);
void ENGINE_API Particle_RenderQuad3D( const FLOAT3D &vPos0, const FLOAT3D &vPos1, const FLOAT3D &vPos2,
const FLOAT3D &vPos3, COLOR col);
void ENGINE_API Particle_RenderLine( const FLOAT3D &vPos0, const FLOAT3D &vPos1, FLOAT fWidth, COLOR col);
void ENGINE_API Particle_Sort( BOOL b3D=FALSE);
void ENGINE_API Particle_Flush(void);
int ENGINE_API FindVowel(const char*);
int ENGINE_API FindThaiLen(const char*,int fromText=0,int toText=-1);
#endif /* include-once check. */
Sadly drawport.cpp is to big to post
This is also interesting :
Code:
// Guild Name
if( ct.cha_lGuildIndex > 0)
{
// WSS_GUILDMASTER 070517 --------------------------->>
COLOR tRankColor = 0xD6A4D6FF;
#ifdef DISPLAY_GUILD_RANK
// WSS_GUILDMASTER 070517
// ±æµå ·©Å·¿¡ µû¶ó »öÇ¥½Ã ´Þ¸®ÇÔ
// 1 : Ȳ±Ý»ö
// 2 : ˼Ț
// 3 : µ¿»ö
switch(ct.cha_sbGuildRank)
{
case 1:
tRankColor = 0xCDAF28FF;
break;
case 2:
tRankColor = 0xBEBEAAFF;
break;
case 3:
tRankColor = 0x9B7D50FF;
break;
}
#endif
//[071123: Su-won] DRATAN_SIEGE_DUNGEON
//±æµå À̸§ »ö ¼³Á¤
COLOR colGuildName =0xD6A4D6FF; //ÀÏ¹Ý ±æµå
if( ct.cha_ubGuildNameColor == 1) //¸Þ¶óÅ© ¼ºÁÖ ±æµå
colGuildName = 0xFF4500FF;
else if( ct.cha_ubGuildNameColor == 2) //µå¶óź ¼ºÁÖ ±æµå
colGuildName = 0xFFD700FF;
// --------------------------------------------------<<
m_pUIDrawPort->PutTextEx( ct.cha_strGuildName, nTextSX, nTextSY,
colGuildName, fPopupZ );
}
And this, to create your own version of titles :
Code:
m_pUIDrawPort->PutTextEx( ct.cha_strGuildName, nTextSX, nTextSY, colGuildName, fPopupZ );
|
|
|
07/08/2012, 22:32
|
#10
|
elite*gold: 0
Join Date: Jun 2011
Posts: 274
Received Thanks: 61
|
Wiza you are chillig (:
|
|
|
Similar Threads
|
Action 6 is drawing near ^^
03/17/2010 - Dekaron - 9 Replies
::: Welcome to GAMEHI :::
And here i thought it was going to be at the end of march XD
Woot lets go own with our new skills and bust up some new maps ^^
|
How can "Aloken" text be removed from common class items?
08/07/2009 - Dekaron Private Server - 3 Replies
When you see in the info tag of a common used, by all classes, item you see that it has Aloken in the description tag.
Anyone knows how to remove the Aloken string?
I searched in data/script/string for Aloken string but didn't get it :(
|
All times are GMT +1. The time now is 20:38.
|
|