Update to 12.0-beta1

This commit is contained in:
dP
2021-08-15 14:57:29 +03:00
parent ac7d3eba75
commit 9df4f2c4fc
666 changed files with 61302 additions and 20466 deletions
+1 -1
View File
@@ -307,7 +307,7 @@ void Blitter_32bppAnim::DrawColourMappingRect(void *dst, int width, int height,
return;
}
DEBUG(misc, 0, "32bpp blitter doesn't know how to draw this colour table ('%d')", pal);
Debug(misc, 0, "32bpp blitter doesn't know how to draw this colour table ('{}')", pal);
}
void Blitter_32bppAnim::SetPixel(void *video, int x, int y, uint8 colour)
+3 -2
View File
@@ -155,6 +155,7 @@ bmno_full_transparency:
if ((bt_last == BT_NONE && effective_width & 1) || bt_last == BT_ODD) {
if (src->a == 0) {
/* Complete transparency. */
} else if (src->a == 255) {
*anim = *(const uint16*) src_mv;
*dst = (src_mv->m >= PALETTE_ANIM_START) ? AdjustBrightneSSE(LookupColourInPalette(src_mv->m), src_mv->v) : *src;
@@ -197,7 +198,7 @@ bmno_full_transparency:
m_colour = r == 0 ? m_colour : cmap; \
m_colour = m != 0 ? m_colour : srcm; \
}
#ifdef _SQ64
#ifdef POINTER_IS_64BIT
uint64 srcs = _mm_cvtsi128_si64(srcABCD);
uint64 dsts;
if (animated) dsts = _mm_cvtsi128_si64(dstABCD);
@@ -379,7 +380,7 @@ bm_normal:
else Draw<BM_NORMAL, RM_WITH_SKIP, BT_ODD, true, true>(bp, zoom);
}
} else {
#ifdef _SQ64
#ifdef POINTER_IS_64BIT
if (sprite_flags & SF_TRANSLUCENT) {
if (sprite_flags & SF_NO_ANIM) Draw<BM_NORMAL, RM_WITH_MARGIN, BT_NONE, true, false>(bp, zoom);
else Draw<BM_NORMAL, RM_WITH_MARGIN, BT_NONE, true, true>(bp, zoom);
+1 -1
View File
@@ -106,7 +106,7 @@ void Blitter_32bppSimple::DrawColourMappingRect(void *dst, int width, int height
return;
}
DEBUG(misc, 0, "32bpp blitter doesn't know how to draw this colour table ('%d')", pal);
Debug(misc, 0, "32bpp blitter doesn't know how to draw this colour table ('{}')", pal);
}
Sprite *Blitter_32bppSimple::Encode(const SpriteLoader::Sprite *sprite, AllocatorProc *allocator)
+2 -2
View File
@@ -34,7 +34,7 @@ static inline void InsertSecondUint32(const uint32 value, __m128i &into)
static inline void LoadUint64(const uint64 value, __m128i &into)
{
#ifdef _SQ64
#ifdef POINTER_IS_64BIT
into = _mm_cvtsi64_si128(value);
#else
#if (SSE_VERSION >= 4)
@@ -297,7 +297,7 @@ inline void Blitter_32bppSSE4::Draw(const Blitter::BlitterParams *bp, ZoomLevel
m_colour = r == 0 ? m_colour : cmap; \
m_colour = m != 0 ? m_colour : srcm; \
}
#ifdef _SQ64
#ifdef POINTER_IS_64BIT
uint64 srcs = _mm_cvtsi128_si64(srcABCD);
uint64 remapped_src = 0;
CMOV_REMAP(c0, 0, srcs, mvX2);
+28 -28
View File
@@ -16,14 +16,14 @@
#include <utility>
template <typename SetPixelT>
void Blitter::DrawLineGeneric(int x, int y, int x2, int y2, int screen_width, int screen_height, int width, int dash, SetPixelT set_pixel)
void Blitter::DrawLineGeneric(int x1, int y1, int x2, int y2, int screen_width, int screen_height, int width, int dash, SetPixelT set_pixel)
{
int dy;
int dx;
int stepx;
int stepy;
dy = (y2 - y) * 2;
dy = (y2 - y1) * 2;
if (dy < 0) {
dy = -dy;
stepy = -1;
@@ -31,7 +31,7 @@ void Blitter::DrawLineGeneric(int x, int y, int x2, int y2, int screen_width, in
stepy = 1;
}
dx = (x2 - x) * 2;
dx = (x2 - x1) * 2;
if (dx < 0) {
dx = -dx;
stepx = -1;
@@ -41,7 +41,7 @@ void Blitter::DrawLineGeneric(int x, int y, int x2, int y2, int screen_width, in
if (dx == 0 && dy == 0) {
/* The algorithm below cannot handle this special case; make it work at least for line width 1 */
if (x >= 0 && x < screen_width && y >= 0 && y < screen_height) set_pixel(x, y);
if (x1 >= 0 && x1 < screen_width && y1 >= 0 && y1 < screen_height) set_pixel(x1, y1);
return;
}
@@ -67,14 +67,14 @@ void Blitter::DrawLineGeneric(int x, int y, int x2, int y2, int screen_width, in
int dash_count = 0;
if (dx > dy) {
if (stepx < 0) {
std::swap(x, x2);
std::swap(y, y2);
std::swap(x1, x2);
std::swap(y1, y2);
stepy = -stepy;
}
if (x2 < 0 || x >= screen_width) return;
if (x2 < 0 || x1 >= screen_width) return;
int y_low = y;
int y_high = y;
int y_low = y1;
int y_high = y1;
int frac_low = dy - frac_diff / 2;
int frac_high = dy + frac_diff / 2;
@@ -87,10 +87,10 @@ void Blitter::DrawLineGeneric(int x, int y, int x2, int y2, int screen_width, in
y_high += stepy;
}
if (x < 0) {
dash_count = (-x) % (dash + gap);
if (x1 < 0) {
dash_count = (-x1) % (dash + gap);
auto adjust_frac = [&](int64 frac, int &y_bound) -> int {
frac -= ((int64) dy) * ((int64) x);
frac -= ((int64) dy) * ((int64) x1);
if (frac >= 0) {
int quotient = frac / dx;
int remainder = frac % dx;
@@ -101,17 +101,17 @@ void Blitter::DrawLineGeneric(int x, int y, int x2, int y2, int screen_width, in
};
frac_low = adjust_frac(frac_low, y_low);
frac_high = adjust_frac(frac_high, y_high);
x = 0;
x1 = 0;
}
x2++;
if (x2 > screen_width) {
x2 = screen_width;
}
while (x != x2) {
while (x1 != x2) {
if (dash_count < dash) {
for (int y = y_low; y != y_high; y += stepy) {
if (y >= 0 && y < screen_height) set_pixel(x, y);
if (y >= 0 && y < screen_height) set_pixel(x1, y);
}
}
if (frac_low >= 0) {
@@ -122,21 +122,21 @@ void Blitter::DrawLineGeneric(int x, int y, int x2, int y2, int screen_width, in
y_high += stepy;
frac_high -= dx;
}
x++;
x1++;
frac_low += dy;
frac_high += dy;
if (++dash_count >= dash + gap) dash_count = 0;
}
} else {
if (stepy < 0) {
std::swap(x, x2);
std::swap(y, y2);
std::swap(x1, x2);
std::swap(y1, y2);
stepx = -stepx;
}
if (y2 < 0 || y >= screen_height) return;
if (y2 < 0 || y1 >= screen_height) return;
int x_low = x;
int x_high = x;
int x_low = x1;
int x_high = x1;
int frac_low = dx - frac_diff / 2;
int frac_high = dx + frac_diff / 2;
@@ -149,10 +149,10 @@ void Blitter::DrawLineGeneric(int x, int y, int x2, int y2, int screen_width, in
x_high += stepx;
}
if (y < 0) {
dash_count = (-y) % (dash + gap);
if (y1 < 0) {
dash_count = (-y1) % (dash + gap);
auto adjust_frac = [&](int64 frac, int &x_bound) -> int {
frac -= ((int64) dx) * ((int64) y);
frac -= ((int64) dx) * ((int64) y1);
if (frac >= 0) {
int quotient = frac / dy;
int remainder = frac % dy;
@@ -163,17 +163,17 @@ void Blitter::DrawLineGeneric(int x, int y, int x2, int y2, int screen_width, in
};
frac_low = adjust_frac(frac_low, x_low);
frac_high = adjust_frac(frac_high, x_high);
y = 0;
y1 = 0;
}
y2++;
if (y2 > screen_height) {
y2 = screen_height;
}
while (y != y2) {
while (y1 != y2) {
if (dash_count < dash) {
for (int x = x_low; x != x_high; x += stepx) {
if (x >= 0 && x < screen_width) set_pixel(x, y);
if (x >= 0 && x < screen_width) set_pixel(x, y1);
}
}
if (frac_low >= 0) {
@@ -184,7 +184,7 @@ void Blitter::DrawLineGeneric(int x, int y, int x2, int y2, int screen_width, in
x_high += stepx;
frac_high -= dy;
}
y++;
y1++;
frac_low += dx;
frac_high += dx;
if (++dash_count >= dash + gap) dash_count = 0;
+3 -3
View File
@@ -70,7 +70,7 @@ protected:
*/
blitters.insert(Blitters::value_type(this->name, this));
} else {
DEBUG(driver, 1, "Not registering blitter %s as it is not usable", name);
Debug(driver, 1, "Not registering blitter {} as it is not usable", name);
}
}
@@ -91,7 +91,7 @@ public:
}
/**
* Find the requested blitter and return his class.
* Find the requested blitter and return its class.
* @param name the blitter to select.
* @post Sets the blitter so GetCurrentBlitter() returns it too.
*/
@@ -104,7 +104,7 @@ public:
delete *GetActiveBlitter();
*GetActiveBlitter() = newb;
DEBUG(driver, 1, "Successfully %s blitter '%s'", name.empty() ? "probed" : "loaded", newb->GetName());
Debug(driver, 1, "Successfully {} blitter '{}'", name.empty() ? "probed" : "loaded", newb->GetName());
return newb;
}