(svn r2571) Add explicit type Pixel for ... Pixels

This commit is contained in:
tron
2005-07-15 14:16:14 +00:00
parent b21ee889fe
commit 8f71864bef
6 changed files with 32 additions and 33 deletions

12
win32.c
View File

@@ -21,9 +21,9 @@
static struct {
HWND main_wnd;
HBITMAP dib_sect;
void *bitmap_bits;
void *buffer_bits;
void *alloced_bits;
Pixel *bitmap_bits;
Pixel *buffer_bits;
Pixel *alloced_bits;
HPALETTE gdi_palette;
int width,height;
int width_org, height_org;
@@ -568,7 +568,7 @@ static bool AllocateDibSection(int w, int h)
DeleteObject(_wnd.dib_sect);
dc = GetDC(0);
_wnd.dib_sect = CreateDIBSection(dc, bi, DIB_RGB_COLORS, &_wnd.bitmap_bits, NULL, 0);
_wnd.dib_sect = CreateDIBSection(dc, bi, DIB_RGB_COLORS, (void**)&_wnd.bitmap_bits, NULL, 0);
if (_wnd.dib_sect == NULL)
error("CreateDIBSection failed");
ReleaseDC(0, dc);
@@ -665,8 +665,8 @@ static void Win32GdiStop(void)
static void filter(int left, int top, int width, int height)
{
uint p = _screen.pitch;
byte *s = (byte*)_wnd.buffer_bits + top * p + left;
byte *d = (byte*)_wnd.bitmap_bits + top * p * 4 + left * 2;
const Pixel *s = _wnd.buffer_bits + top * p + left;
Pixel *d = _wnd.bitmap_bits + top * p * 4 + left * 2;
for (; height > 0; height--) {
int i;