Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

screen_device::create_composited_bitmap() - missing 'break'? #6372

Closed
fasteddo opened this issue Feb 29, 2020 · 2 comments
Closed

screen_device::create_composited_bitmap() - missing 'break'? #6372

fasteddo opened this issue Feb 29, 2020 · 2 comments

Comments

@fasteddo
Copy link

\src\emu\screen.cpp
screen_device::create_composited_bitmap()

I'm assuming there's a break missing in the first case statement. If this is intentional, please ignore, I'm still trying to learn the source.

void screen_device::create_composited_bitmap()
{
	screen_bitmap &curbitmap = m_bitmap[m_curtexture];
	if (!curbitmap.valid())
		return;

	s32 dstwidth = std::max(m_max_width, m_visarea.right() + 1);
	int dstheight = curbitmap.height();

	switch (curbitmap.format())
	{
		default:
		case BITMAP_FORMAT_IND16:
		{
			for (int y = 0; y < dstheight; y++)
			{
				bitmap_ind16 &srcbitmap = *(bitmap_ind16 *)m_scan_bitmaps[m_curbitmap][y];
				u16 *dst = &curbitmap.as_ind16().pix16(y);
				const u16 *src = &srcbitmap.pix16(0);
				const int dx = (m_scan_widths[y] << 15) / dstwidth;
				for (int x = 0; x < m_scan_widths[y]; x += dx)
				{
					*dst++ = src[x >> 15];
				}
			}
			//  missing break;   ????
		}

		case BITMAP_FORMAT_RGB32:
		{
			for (int y = 0; y < dstheight; y++)
			{
				bitmap_rgb32 &srcbitmap = *(bitmap_rgb32 *)m_scan_bitmaps[m_curbitmap][y];
				u32 *dst = &curbitmap.as_rgb32().pix32(y);
				const u32 *src = &srcbitmap.pix32(0);
				const int dx = (m_scan_widths[y] << 15) / dstwidth;
				for (int x = 0; x < dstwidth << 15; x += dx)
				{
					*dst++ = src[x >> 15];
				}
			}
			break;
		}
	}
}
@MooglyGuy
Copy link
Contributor

You're absolutely right! Nice catch! 👍

I'm a bit busy installing the latest version of Visual Studio 2019, but as soon as that's done, I'll commit the fix. Many thanks!

@MooglyGuy
Copy link
Contributor

Thanks again for the fix. This has been applied and credited to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants