Some tidying up. Scrollbars don't work

This commit is contained in:
ZedThree 2014-05-11 15:56:59 +02:00
parent 705af9377b
commit 6f1421117b
1 changed files with 23 additions and 33 deletions

View File

@ -168,41 +168,34 @@ void gfx_fill_rect(rct_drawpixelinfo *dpi, int left, int top, int right, int bot
if (!(colour & 0x2000000)) { if (!(colour & 0x2000000)) {
if (!(colour & 0x4000000)) { if (!(colour & 0x4000000)) {
char* edi; uint8* edi;
edi = (top_ * (dpi->width + dpi->pitch)) + left_ + dpi->bits; edi = (top_ * (dpi->width + dpi->pitch)) + left_ + dpi->bits;
// Take the last byte of colour and repeat it 4 times? uint8 col = colour & 0xFF;
uint32 ax;
ax = colour & 0xffff;
ax = (ax & 0xff) << 8;
ax = ax << 8;
ax = (ax & 0xff00) >> 8;
ax = ax << 8;
ax = (ax & 0xff00) >> 8;
int length; int length;
length = dpi->width + dpi->pitch - right_; length = dpi->width + dpi->pitch - right_;
for (int dx = bottom_; dx > 0; --dx) { for (int i = 0; i < bottom_; ++i) {
uint32 ecx; uint32 ecx;
ecx = right_; ecx = right_;
ecx = ecx/2; ecx = ecx / 2;
if (ecx % 2 != 0) { if (ecx % 2 != 0) {
*edi = ax & 0xff; *edi = col;
edi++; edi++;
} }
ecx = ecx/2; ecx = ecx / 2;
if (ecx % 2 != 0) { if (ecx % 2 != 0) {
*edi = ax & 0xffff; *edi = col;
edi += 2; edi++;
} *edi = col;
memset(edi, ax, ecx); edi++;
// *((uint16*)edi) = ax & 0xffff;
edi += length; // edi += 2;
}
} memset(edi, col, ecx*4);
return; edi += length;
}
} else { } else {
// 00678B8A 00678E38 // 00678B8A 00678E38
char* esi; char* esi;
@ -264,11 +257,8 @@ void gfx_fill_rect(rct_drawpixelinfo *dpi, int left, int top, int right, int bot
// Fill the rectangle with the colours from the colour table // Fill the rectangle with the colours from the colour table
for (int i = 0; i < bottom_; ++i) { for (int i = 0; i < bottom_; ++i) {
uint8 al;
al = 0;
for (int j = 0; j < right_; ++j) { for (int j = 0; j < right_; ++j) {
al = *edi; *edi = *((uint8*)(&g1_element->offset[*edi]));
*edi = *((uint8*)(&g1_element->offset[al]));
edi++; edi++;
} }
edi += length; edi += length;