skumy
11-17-2007, 09:50 AM
Well guys i m getting a weird error which i dont really understand^^
warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
TatniumD3D error LNK2019: unresolved external symbol "public: long __thiscall CD3DFont::RestoreDeviceObjects(void)" (?RestoreDeviceObjects@CD3DFont@@QAEJXZ) referenced in function "public: void __thiscall cMenu::InitalizeFont(char *,int,struct IDirect3DDevice8 *)" (?InitalizeFont@cMenu@@QAEXPADHPAUIDirect3DDevice8 @@@Z)
and some more with different strings
d3dfont.h
HRESULT DrawText( FLOAT x, FLOAT y, DWORD dwColor,
const TCHAR* strText, DWORD dwFlags=0L );
HRESULT DrawTextScaled( FLOAT x, FLOAT y, FLOAT z,
FLOAT fXScale, FLOAT fYScale, DWORD dwColor,
const TCHAR* strText, DWORD dwFlags=0L );
HRESULT Render3DText( const TCHAR* strText, DWORD dwFlags=0L );
HRESULT GetTextExtent( const TCHAR* strText, SIZE* pSize );
HRESULT InitDeviceObjects( LPDIRECT3DDEVICE8 pd3dDevice );
HRESULT RestoreDeviceObjects();
HRESULT InvalidateDeviceObjects();
HRESULT DeleteDeviceObjects();
cLTFX.cpp
void cMenu::InitalizeFont(char *font, int size, IDirect3DDevice8* pD3Ddev)
{
menuFont = new CD3DFont(font, size, 0);
menuFont->InitDeviceObjects(pD3Ddev);
menuFont->RestoreDeviceObjects();
}
void cMenu::PostReset(char *font, int size, IDirect3DDevice8* pD3Ddev)
{
menuFont = new CD3DFont(font, size,0);
menuFont->InitDeviceObjects(pD3Ddev);
menuFont->RestoreDeviceObjects();
}
void cMenu::PreReset()
{
menuFont->InvalidateDeviceObjects();
menuFont->DeleteDeviceObjects();
menuFont = NULL;
}
void cMenu::DrawGameText(int x, int y, DWORD color, char *text, ...)
{
if(!text) { return; }
va_list va_alist;
char logbuf[256] = {0};
va_start (va_alist, text);
_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), text, va_alist);
va_end (va_alist);
menuFont->DrawText((float)x, (float)y, color, logbuf);
}
void cMenu::DrawGameTextShadowed(int x, int y, DWORD color, char *text, ...)
{
if(!text) { return; }
va_list va_alist;
char logbuf[256] = {0};
va_start (va_alist, text);
_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), text, va_alist);
va_end (va_alist);
menuFont->DrawText((float)x-1, (float)y+1, D3DCOLOR_ARGB( 255, 0, 0, 0 ), logbuf);
menuFont->DrawText((float)x-2, (float)y+2, D3DCOLOR_ARGB( 255, 0, 0, 0 ), logbuf);
menuFont->DrawText((float)x, (float)y, color, logbuf);
}
void cMenu::DrawGameTextPixel(int x, int y, DWORD color, char *text, ...)
{
if(!text) { return; }
va_list va_alist;
char logbuf[256] = {0};
va_start (va_alist, text);
_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), text, va_alist);
va_end (va_alist);
menuFont->DrawText((float)x+1, (float)y, D3DCOLOR_ARGB( 255, 0, 0, 0 ), logbuf);
menuFont->DrawText((float)x-1, (float)y, D3DCOLOR_ARGB( 255, 0, 0, 0 ), logbuf);
menuFont->DrawText((float)x, (float)y+1, D3DCOLOR_ARGB( 255, 0, 0, 0 ), logbuf);
menuFont->DrawText((float)x, (float)y-1, D3DCOLOR_ARGB( 255, 0, 0, 0 ), logbuf);
menuFont->DrawText((float)x, (float)y, color, logbuf);
}
void cMenu::FillRGB( int x, int y, int w, int h, int r, int g, int b, LPDIRECT3DDEVICE8 pDevice )
{
D3DCOLOR col = D3DCOLOR_ARGB( 255, r, g, b );
D3DRECT rec;
rec.x1 = x;
rec.x2 = x + w;
rec.y1 = y;
rec.y2 = y + h;
pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, col, 0, 0 );
}
cMenu::cMenu( int MAX_MENU )
{
MAX_ITEMS = 0;
mainMenu = new pMenu[MAX_MENU];
bMenu = false;
}
cMenu::~cMenu( )
{
MAX_ITEMS = 0;
delete mainMenu;
}
void cMenu::AddMenuItem(char title[16], float *cvar, int min, int max)
{
mainMenu[MAX_ITEMS].value = cvar;
sprintf( mainMenu[MAX_ITEMS].title, title );
mainMenu[MAX_ITEMS].max = max;
mainMenu[MAX_ITEMS].min = min;
MAX_ITEMS++;
}
void cMenu::DrawMenu( int x, int y, DWORD dwSelected, DWORD dwNonSelected, DWORD dwValues, LPDIRECT3DDEVICE8 pDevice )
{
if( !bMenu )return;
for (int i = 0; i <= ( MAX_ITEMS - 1 ); i++)
{
if( i == curItem )
{
DrawGameTextPixel( x, y + (i * 20), dwSelected, mainMenu[i].title );
DrawGameTextPixel( x + 75, y + (i * 20), dwValues, "%2.2f", mainMenu[i].value[0] );
}
else
{
DrawGameTextPixel( x, y + (i * 20), dwNonSelected, mainMenu[i].title);
DrawGameTextPixel( x + 75, y + (i * 20), dwValues, "%2.2f", mainMenu[i].value[0] );
}
}
}
i would be pleased if some one could help me :D
warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
TatniumD3D error LNK2019: unresolved external symbol "public: long __thiscall CD3DFont::RestoreDeviceObjects(void)" (?RestoreDeviceObjects@CD3DFont@@QAEJXZ) referenced in function "public: void __thiscall cMenu::InitalizeFont(char *,int,struct IDirect3DDevice8 *)" (?InitalizeFont@cMenu@@QAEXPADHPAUIDirect3DDevice8 @@@Z)
and some more with different strings
d3dfont.h
HRESULT DrawText( FLOAT x, FLOAT y, DWORD dwColor,
const TCHAR* strText, DWORD dwFlags=0L );
HRESULT DrawTextScaled( FLOAT x, FLOAT y, FLOAT z,
FLOAT fXScale, FLOAT fYScale, DWORD dwColor,
const TCHAR* strText, DWORD dwFlags=0L );
HRESULT Render3DText( const TCHAR* strText, DWORD dwFlags=0L );
HRESULT GetTextExtent( const TCHAR* strText, SIZE* pSize );
HRESULT InitDeviceObjects( LPDIRECT3DDEVICE8 pd3dDevice );
HRESULT RestoreDeviceObjects();
HRESULT InvalidateDeviceObjects();
HRESULT DeleteDeviceObjects();
cLTFX.cpp
void cMenu::InitalizeFont(char *font, int size, IDirect3DDevice8* pD3Ddev)
{
menuFont = new CD3DFont(font, size, 0);
menuFont->InitDeviceObjects(pD3Ddev);
menuFont->RestoreDeviceObjects();
}
void cMenu::PostReset(char *font, int size, IDirect3DDevice8* pD3Ddev)
{
menuFont = new CD3DFont(font, size,0);
menuFont->InitDeviceObjects(pD3Ddev);
menuFont->RestoreDeviceObjects();
}
void cMenu::PreReset()
{
menuFont->InvalidateDeviceObjects();
menuFont->DeleteDeviceObjects();
menuFont = NULL;
}
void cMenu::DrawGameText(int x, int y, DWORD color, char *text, ...)
{
if(!text) { return; }
va_list va_alist;
char logbuf[256] = {0};
va_start (va_alist, text);
_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), text, va_alist);
va_end (va_alist);
menuFont->DrawText((float)x, (float)y, color, logbuf);
}
void cMenu::DrawGameTextShadowed(int x, int y, DWORD color, char *text, ...)
{
if(!text) { return; }
va_list va_alist;
char logbuf[256] = {0};
va_start (va_alist, text);
_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), text, va_alist);
va_end (va_alist);
menuFont->DrawText((float)x-1, (float)y+1, D3DCOLOR_ARGB( 255, 0, 0, 0 ), logbuf);
menuFont->DrawText((float)x-2, (float)y+2, D3DCOLOR_ARGB( 255, 0, 0, 0 ), logbuf);
menuFont->DrawText((float)x, (float)y, color, logbuf);
}
void cMenu::DrawGameTextPixel(int x, int y, DWORD color, char *text, ...)
{
if(!text) { return; }
va_list va_alist;
char logbuf[256] = {0};
va_start (va_alist, text);
_vsnprintf (logbuf+strlen(logbuf), sizeof(logbuf) - strlen(logbuf), text, va_alist);
va_end (va_alist);
menuFont->DrawText((float)x+1, (float)y, D3DCOLOR_ARGB( 255, 0, 0, 0 ), logbuf);
menuFont->DrawText((float)x-1, (float)y, D3DCOLOR_ARGB( 255, 0, 0, 0 ), logbuf);
menuFont->DrawText((float)x, (float)y+1, D3DCOLOR_ARGB( 255, 0, 0, 0 ), logbuf);
menuFont->DrawText((float)x, (float)y-1, D3DCOLOR_ARGB( 255, 0, 0, 0 ), logbuf);
menuFont->DrawText((float)x, (float)y, color, logbuf);
}
void cMenu::FillRGB( int x, int y, int w, int h, int r, int g, int b, LPDIRECT3DDEVICE8 pDevice )
{
D3DCOLOR col = D3DCOLOR_ARGB( 255, r, g, b );
D3DRECT rec;
rec.x1 = x;
rec.x2 = x + w;
rec.y1 = y;
rec.y2 = y + h;
pDevice->Clear( 1, &rec, D3DCLEAR_TARGET, col, 0, 0 );
}
cMenu::cMenu( int MAX_MENU )
{
MAX_ITEMS = 0;
mainMenu = new pMenu[MAX_MENU];
bMenu = false;
}
cMenu::~cMenu( )
{
MAX_ITEMS = 0;
delete mainMenu;
}
void cMenu::AddMenuItem(char title[16], float *cvar, int min, int max)
{
mainMenu[MAX_ITEMS].value = cvar;
sprintf( mainMenu[MAX_ITEMS].title, title );
mainMenu[MAX_ITEMS].max = max;
mainMenu[MAX_ITEMS].min = min;
MAX_ITEMS++;
}
void cMenu::DrawMenu( int x, int y, DWORD dwSelected, DWORD dwNonSelected, DWORD dwValues, LPDIRECT3DDEVICE8 pDevice )
{
if( !bMenu )return;
for (int i = 0; i <= ( MAX_ITEMS - 1 ); i++)
{
if( i == curItem )
{
DrawGameTextPixel( x, y + (i * 20), dwSelected, mainMenu[i].title );
DrawGameTextPixel( x + 75, y + (i * 20), dwValues, "%2.2f", mainMenu[i].value[0] );
}
else
{
DrawGameTextPixel( x, y + (i * 20), dwNonSelected, mainMenu[i].title);
DrawGameTextPixel( x + 75, y + (i * 20), dwValues, "%2.2f", mainMenu[i].value[0] );
}
}
}
i would be pleased if some one could help me :D