OXYGENHUB
◆ main openmsx / src / video / scalers / GLScaleNxScaler.cc
804 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#include "GLScaleNxScaler.hh"
2
3
namespace openmsx {
4
5
GLScaleNxScaler::GLScaleNxScaler(GLScaler& fallback_)
6
	: GLScaler("scale2x")
7
	, fallback(fallback_)
8
{
9
}
10
11
void GLScaleNxScaler::scaleImage(
12
	gl::ColorTexture& src, gl::ColorTexture* superImpose,
13
	unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
14
	unsigned dstStartY, unsigned dstEndY, unsigned dstWidth,
15
	unsigned logSrcHeight)
16
{
17
	if ((srcWidth % 320) == 0) {
18
		setup(superImpose != nullptr);
19
		execute(src, superImpose,
20
		        srcStartY, srcEndY, srcWidth,
21
		        dstStartY, dstEndY, dstWidth,
22
		        logSrcHeight);
23
	} else {
24
		fallback.scaleImage(src, superImpose,
25
		                    srcStartY, srcEndY, srcWidth,
26
		                    dstStartY, dstEndY, dstWidth,
27
		                    logSrcHeight);
28
	}
29
}
30
31
} // namespace openmsx