コード例 #1
0
ファイル: screen_manager.cpp プロジェクト: AReim1982/scummvm
void OSScreenManager::fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g, byte b) {
	DirectDrawSurface *surface = getDDSurface(surfaceNum);
	if (!surface)
		return;

	// If bounds are provided, clip and use them. Otherwise, use entire surface area
	Rect surfaceRect(0, 0, surface->getWidth(), surface->getHeight());
	Rect tempRect;

	if (rect) {
		tempRect = *rect;
		tempRect.clip(surfaceRect);
	} else {
		tempRect = surfaceRect;
	}

	// Constrain the fill area to the set modification area of the surface
	Rect surfaceBounds = (surfaceNum == SURFACE_PRIMARY) ? _frontSurfaceBounds :
		_backSurfaces[surfaceNum]._bounds;
	if (!surfaceBounds.isEmpty())
		tempRect.constrain(surfaceBounds);

	// If there is any area defined, clear it
	if (tempRect.isValidRect())
		surface->fillRect(&tempRect, r, g, b);
}
コード例 #2
0
ファイル: screen_manager.cpp プロジェクト: Tkachov/scummvm
void OSScreenManager::fillRect(SurfaceNum surfaceNum, Rect *rect, byte r, byte g, byte b) {
	DirectDrawSurface *surface = getDDSurface(surfaceNum);
	if (!surface)
		return;

	// If bounds are provided, clip and use them. Otherwise, use entire surface area
	Rect surfaceRect(0, 0, surface->getWidth(), surface->getHeight());
	Rect tempRect;

	if (rect) {
		tempRect = *rect;
		tempRect.clip(surfaceRect);
	} else {
		tempRect = surfaceRect;
	}

	if (tempRect.isValidRect())
		surface->fillRect(&tempRect, r, g, b);
}