Hello, I have problem with some on-screen drawn menu. Normal it's all good but there is one point where item list is too long for screen and it has been drawn out of visible area. I can go through it but I can't see what I'm picking.
Code:
struct itemEntry
{
char name[64];
BYTE type;
void* item;
itemEntry* last;
itemEntry* next;
bool show;
itemEntry(char * n, BYTE t,void *i)
{
strcpy_s(name,n);
type = t;
item = i;
show = 1;
next = NULL;
}
};
Code:
struct itemPicker
{
itemEntry* first;
itemEntry* last;
itemEntry* selected;
itemPicker()
{
itemEntry *f = new itemEntry("...",0,0);
selected = last = first = f;
f->last = NULL;
}
void add(itemEntry* nm)
{
last->next = nm;
nm->last = last;
last = nm;
}
void update(char* t)
{
}
};
Code:
void DrawFont (int X, int Y, D3DCOLOR Color, char *format, ...)
{
char buffer[256];
va_list args;
va_start (args, format);
vsprintf (buffer,format, args);
RECT FontRect = { X, Y, X + 120, Y + 16 };
m_pFont->DrawText( NULL, buffer, -1, &FontRect, DT_NOCLIP , Color );
va_end (args);
}