descriptor heap rewrite
This commit is contained in:
parent
b4bd0c03c5
commit
f8e142fb06
31 changed files with 429 additions and 1017 deletions
|
|
@ -383,29 +383,7 @@ export namespace Crafter {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case OpaqueType::SemiOpaque: {
|
||||
for (int j = 0; j < h; j++) {
|
||||
for (int i = 0; i < w; i++) {
|
||||
int bufferX = x + i + c_x1 + offsetX;
|
||||
int bufferY = currentY + j + c_y1 + offsetY;
|
||||
|
||||
// Only draw pixels that are within our scaled buffer bounds
|
||||
if constexpr(Scaling) {
|
||||
if (bufferX >= 0 && bufferX < ScalingBase<T, true, Owning, Alignment>::bufferWidth && bufferY >= 0 && bufferY < ScalingBase<T, true, Owning, Alignment>::bufferHeight) {
|
||||
ScalingBase<T, true, Owning, Alignment>::scalingBuffer[bufferY * ScalingBase<T, true, Owning, Alignment>::bufferWidth + bufferX] = {color.r, color.g, color.b, static_cast<T>(bitmap[j * w + i])};
|
||||
}
|
||||
} else {
|
||||
if (bufferX >= 0 && bufferX < (int)this->scaled.size.x && bufferY >= 0 && bufferY < (int)this->scaled.size.y) {
|
||||
std::uint8_t alpha = bitmap[j * w + i];
|
||||
if(alpha != 0) {
|
||||
this->buffer[bufferY * this->scaled.size.x + bufferX] = {color.r, color.g, color.b, static_cast<T>(bitmap[j * w + i])};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case OpaqueType::SemiOpaque:
|
||||
case OpaqueType::Transparent: {
|
||||
for (int j = 0; j < h; j++) {
|
||||
for (int i = 0; i < w; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue