7,35 → 7,23 |
char debuf[50] = ""; |
|
|
// ïî÷åìó-òî íå áûëî â ñòàíäàðòíîé áèáëèîòåêå |
void kos_DrawLine( Word x1, Word y1, Word x2, Word y2, Dword colour, Dword invert ) |
void kos_DrawRegion(Word x, Word y,Word width, Word height, Dword color1, Word invert) |
{ |
Dword arg1, arg2, arg3; |
|
// |
arg1 = ( x1 << 16 ) | x2; |
arg2 = ( y1 << 16 ) | y2; |
arg3 = (invert)?0x01000000:colour; |
// |
__asm{ |
mov eax, 38 |
mov ebx, arg1 |
mov ecx, arg2 |
mov edx, arg3 |
int 0x40 |
kos_DrawLine(x,y,x+width-2,y,color1,invert); |
kos_DrawLine(x,y+1,x,y+height-1,color1,invert); |
kos_DrawLine(x+width-1,y,x+width-1,y+height-2,color1,invert); |
kos_DrawLine(x+1,y+height-1,x+width-1,y+height-1,color1,invert); |
} |
} |
|
// ïîõèùåíî èç áèáëèîòåêè ê C-- |
void DrawRegion(Dword x,Dword y,Dword width,Dword height,Dword color1) |
void kos_DrawCutTextSmall(Word x, Word y, int areaWidth, Dword textColour, char *textPtr) |
{ |
kos_DrawBar(x,y,width,1,color1); //ïîëîñà ãîð ñâåðõó |
kos_DrawBar(x,y+height,width,1,color1); //ïîëîñà ãîð ñíèçó |
kos_DrawBar(x,y,1,height,color1); //ïîëîñà âåðò ñëåâà |
kos_DrawBar(x+width,y,1,height+1,color1); //ïîëîñà âåðò ñïðàâà |
if (textPtr) { |
int textLen = strlen(textPtr); |
if (textLen*6 > areaWidth) textLen = areaWidth / 6; |
kos_WriteTextToWindow(x,y,0,textColour,textPtr,textLen); |
} |
} |
|
|
// äà, ýòî áàÿí |
int atoi(const char* string) |
{ |