CPP source/project added...
btw... is it true, when writing a intro in pure C that the generated output (exe) may be some bytes smaller as writing in CPP? O.O
Here i will list some things i have tried myself to optimize the size (possible some older source versions here)
struct MyTextData
{
int x;
int y;
int font;
char* string;
int color;
};
static MyTextData td[4] = {
910+(ScrollX>>1), -30, 0, "Ö", 0xff000000,
580+(ScrollX<<1), -50, 0, "j", 0xff523317,
ScrollX , 150, 0, "CKMSQ", 0xff000000,
20 , 20, 1, TextParts[TextObj], 0xffFFFFFF,
};
for (int i=0; i<=3; i++)
{
SetRect( &rect, td[i].x, td[i].y, 1024, 1024);
g_pFont[ td[i].font ]->DrawText(NULL, td[i].string, -1, &rect, DT_LEFT , td[i].color); // D3DCOLOR_XRGB(0,0,0) ) Sun
};
// ************************************************************
// i n s t e a d o f t h i s :
// ************************************************************
rect.left = 680+(ScrollX<<1);
rect.top = -50;
g_pFont[0]->DrawText(NULL, "j", -1, &rect, DT_LEFT , 0x88000000); // D3DCOLOR_XRGB(85,49,23) airplane (saves some bytes!)
// g_pFont[0]->DrawText(NULL, "j", -1, &rect, DT_LEFT , 0xff523317); // D3DCOLOR_XRGB(85,49,23) airplane
rect.left = 910+(ScrollX>>1);
rect.top = -30;
g_pFont[0]->DrawText(NULL, "Ö", -1, &rect, DT_LEFT , 0xff000000); // D3DCOLOR_XRGB(0,0,0) sun
rect.left = ScrollX;
rect.top = 150;
g_pFont[0]->DrawText(NULL, "CKMSQ", -1, &rect, DT_LEFT , 0xff000000); // D3DCOLOR_XRGB(0,0,0) landscape
static void MyDrawText(int x, int y, int font, char* string, int color)
{
SetRect( &rect, x, y, 1024, 1024);
g_pFont[font]->DrawText(NULL, string, -1, &rect, DT_LEFT , color);
};
MyDrawText( 0, 910+(ScrollX>>1), -30, "Ö", 0xff000000);
MyDrawText( 0, 680+(ScrollX<<1), -50, "j", 0xff523317);
MyDrawText( 0, ScrollX, 150, "CKMSQ", 0xff000000);
MyDrawText( 1, 20, 20, TextParts[TextObj], 0xffFFFFFF);