summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/a2gameio/computereyes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/a2gameio/computereyes.cpp')
-rw-r--r--src/devices/bus/a2gameio/computereyes.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/devices/bus/a2gameio/computereyes.cpp b/src/devices/bus/a2gameio/computereyes.cpp
index 2b3065e76a0..af597361c8e 100644
--- a/src/devices/bus/a2gameio/computereyes.cpp
+++ b/src/devices/bus/a2gameio/computereyes.cpp
@@ -82,23 +82,22 @@ WRITE_LINE_MEMBER(apple2_compeyes_device::an0_w)
std::fill_n(m_a2_bitmap, 280*192, 0);
- m_bitmap = &m_picture->get_bitmap();
- if (m_bitmap->valid())
+ const bitmap_argb32 &bitmap = m_picture->get_bitmap();
+ if (bitmap.valid())
{
// convert arbitrary sized ARGB32 image to a 280x192 image with 256 levels of grayscale
- double stepx = (double)m_bitmap->width() / 280.0;
- double stepy = (double)m_bitmap->height() / 192.0;
-
+ double stepx = (double)bitmap.width() / 280.0;
+ double stepy = (double)bitmap.height() / 192.0;
for (int y = 0; y < 192; y++)
{
for (int x = 0; x < 280; x++)
{
- u32 pixel = m_bitmap->pix((int)((double)y * stepy), (int)((double)x * stepx));
- double mono = ((0.2126 * (double)(((pixel>>16) & 0xff) / 255.0)) +
- (0.7152 * (double)(((pixel>>8) & 0xff) / 255.0)) +
- (0.0722 * (double)((pixel& 0xff) / 255.0)));
- m_a2_bitmap[(y*280)+x] = (u8)(mono * 255.0);
+ u32 pixel = bitmap.pix(int((double)y * stepy), int((double)x * stepx));
+ double mono = ((0.2126 * double(((pixel>>16) & 0xff) / 255.0)) +
+ (0.7152 * double(((pixel>>8) & 0xff) / 255.0)) +
+ (0.0722 * double((pixel& 0xff) / 255.0)));
+ m_a2_bitmap[(y*280)+x] = u8(mono * 255.0);
}
}
}