Monopoly — Portage moderne
0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
ModernMenuRaster.hpp
Go to the documentation of this file.
1
#pragma once
2
#include "
LegacyBitmap.hpp
"
3
4
namespace
monopoly::menu
5
{
6
// For flat 3x shells only: horizontal predicates and source alpha must be
7
// constant over each aligned triplet. Evaluate every output row separately;
8
// the integer vertical gradient can change inside a three-row block.
9
// Photo sampling and token compositing must use the full-resolution path.
10
template
<
class
Pa
int
Pixel>
11
void
paintMenuRaster
(
data::LegacyBitmapRGBA8
&
image
,
bool
horizontalTriplets
,
12
PaintPixel
&&
paintPixel
)
13
{
14
const
unsigned
step =
horizontalTriplets
&&
image
.width % 3 == 0 ? 3 : 1;
15
for
(
unsigned
y
= 0;
y
<
image
.height; ++
y
)
16
for
(
unsigned
x
= 0;
x
<
image
.width;
x
+= step)
17
{
18
const
auto
offset
= (std::size_t(
y
) *
image
.width +
x
) * 4;
19
paintPixel
(
x
,
y
,
offset
);
20
if
(step == 3)
21
{
22
auto
*
pixel
=
image
.pixels.data() +
offset
;
23
pixel
[4] =
pixel
[8] =
pixel
[0];
24
pixel
[5] =
pixel
[9] =
pixel
[1];
25
pixel
[6] =
pixel
[10] =
pixel
[2];
26
pixel
[7] =
pixel
[11] =
pixel
[3];
27
}
28
}
29
}
30
}
offset
std::size_t offset
Definition
AISaveState.cpp:55
image
LegacyBitmapRGBA8 image
Definition
BoardTextureRuntime.cpp:17
y
int y
Definition
EscapeConfirmationPlayback.cpp:16
x
int x
Definition
EscapeConfirmationPlayback.cpp:15
LegacyBitmap.hpp
index
unsigned index
Definition
ModernIBarSkin.cpp:25
monopoly::menu
Definition
ModernMenuRaster.hpp:5
monopoly::menu::paintMenuRaster
void paintMenuRaster(data::LegacyBitmapRGBA8 &image, bool horizontalTriplets, PaintPixel &&paintPixel)
Definition
ModernMenuRaster.hpp:11
monopoly::data::LegacyBitmapRGBA8
Definition
LegacyBitmap.hpp:64
ModernMenuRaster.hpp
Generated by
1.9.8