mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
No commits in common. "a2a7ecf88eb74c89f905f3035a1a6ae59f718ed8" and "9ce1626bb48b58f40c12ea8ed9af715d3206b876" have entirely different histories.
a2a7ecf88e
...
9ce1626bb4
|
@ -218,7 +218,7 @@ inline void Blitter_32bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel
|
||||||
if (src_px->a != 0) {
|
if (src_px->a != 0) {
|
||||||
src_px += n;
|
src_px += n;
|
||||||
do {
|
do {
|
||||||
*dst = this->LookupColourInPalette(remap[GetNearestColourIndex(*dst)]);
|
*dst = this->LookupColourInPalette(bp->remap[GetNearestColourIndex(*dst)]);
|
||||||
*anim = 0;
|
*anim = 0;
|
||||||
anim++;
|
anim++;
|
||||||
dst++;
|
dst++;
|
||||||
|
|
|
@ -322,7 +322,7 @@ bmcr_alpha_blend_single:
|
||||||
/* Apply custom transparency remap. */
|
/* Apply custom transparency remap. */
|
||||||
for (uint x = (uint) bp->width; x > 0; x--) {
|
for (uint x = (uint) bp->width; x > 0; x--) {
|
||||||
if (src->a != 0) {
|
if (src->a != 0) {
|
||||||
*dst = this->LookupColourInPalette(remap[GetNearestColourIndex(*dst)]);
|
*dst = this->LookupColourInPalette(bp->remap[GetNearestColourIndex(*dst)]);
|
||||||
*anim = 0;
|
*anim = 0;
|
||||||
}
|
}
|
||||||
src_mv++;
|
src_mv++;
|
||||||
|
|
|
@ -209,7 +209,7 @@ inline void Blitter_32bppOptimized::Draw(const Blitter::BlitterParams *bp, ZoomL
|
||||||
if (src_px->a != 0) {
|
if (src_px->a != 0) {
|
||||||
src_px += n;
|
src_px += n;
|
||||||
do {
|
do {
|
||||||
*dst = this->LookupColourInPalette(remap[GetNearestColourIndex(*dst)]);
|
*dst = this->LookupColourInPalette(bp->remap[GetNearestColourIndex(*dst)]);
|
||||||
dst++;
|
dst++;
|
||||||
} while (--n != 0);
|
} while (--n != 0);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -396,7 +396,7 @@ bmcr_alpha_blend_single:
|
||||||
/* Apply custom transparency remap. */
|
/* Apply custom transparency remap. */
|
||||||
for (uint x = (uint) bp->width; x > 0; x--) {
|
for (uint x = (uint) bp->width; x > 0; x--) {
|
||||||
if (src->a != 0) {
|
if (src->a != 0) {
|
||||||
*dst = this->LookupColourInPalette(remap[GetNearestColourIndex(*dst)]);
|
*dst = this->LookupColourInPalette(bp->remap[GetNearestColourIndex(*dst)]);
|
||||||
}
|
}
|
||||||
src_mv++;
|
src_mv++;
|
||||||
dst++;
|
dst++;
|
||||||
|
|
|
@ -267,9 +267,9 @@ inline void Blitter_40bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel
|
||||||
src_px += n;
|
src_px += n;
|
||||||
do {
|
do {
|
||||||
if (*anim != 0) {
|
if (*anim != 0) {
|
||||||
*anim = remap[*anim];
|
*anim = bp->remap[*anim];
|
||||||
} else {
|
} else {
|
||||||
*dst = this->LookupColourInPalette(remap[GetNearestColourIndex(*dst)]);
|
*dst = this->LookupColourInPalette(bp->remap[GetNearestColourIndex(*dst)]);
|
||||||
*anim = 0;
|
*anim = 0;
|
||||||
}
|
}
|
||||||
anim++;
|
anim++;
|
||||||
|
|
|
@ -899,19 +899,8 @@ struct ScriptDebugWindow : public Window {
|
||||||
ScriptLogTypes::LogData &log = this->GetLogData();
|
ScriptLogTypes::LogData &log = this->GetLogData();
|
||||||
if (log.empty()) return;
|
if (log.empty()) return;
|
||||||
|
|
||||||
Rect fr = r.Shrink(WidgetDimensions::scaled.framerect);
|
Rect br = r.Shrink(WidgetDimensions::scaled.bevel);
|
||||||
|
Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
|
||||||
/* Setup a clipping rectangle... */
|
|
||||||
DrawPixelInfo tmp_dpi;
|
|
||||||
if (!FillDrawPixelInfo(&tmp_dpi, fr)) return;
|
|
||||||
/* ...but keep coordinates relative to the window. */
|
|
||||||
tmp_dpi.left += fr.left;
|
|
||||||
tmp_dpi.top += fr.top;
|
|
||||||
|
|
||||||
AutoRestoreBackup dpi_backup(_cur_dpi, &tmp_dpi);
|
|
||||||
|
|
||||||
fr.left -= this->hscroll->GetPosition();
|
|
||||||
|
|
||||||
for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && (size_t)i < log.size(); i++) {
|
for (int i = this->vscroll->GetPosition(); this->vscroll->IsVisible(i) && (size_t)i < log.size(); i++) {
|
||||||
const ScriptLogTypes::LogLine &line = log[i];
|
const ScriptLogTypes::LogLine &line = log[i];
|
||||||
|
|
||||||
|
@ -927,13 +916,12 @@ struct ScriptDebugWindow : public Window {
|
||||||
|
|
||||||
/* Check if the current line should be highlighted */
|
/* Check if the current line should be highlighted */
|
||||||
if (i == this->highlight_row) {
|
if (i == this->highlight_row) {
|
||||||
fr.bottom = fr.top + this->resize.step_height - 1;
|
GfxFillRect(br.left, tr.top, br.right, tr.top + this->resize.step_height - 1, PC_BLACK);
|
||||||
GfxFillRect(fr, PC_BLACK);
|
|
||||||
if (colour == TC_BLACK) colour = TC_WHITE; // Make black text readable by inverting it to white.
|
if (colour == TC_BLACK) colour = TC_WHITE; // Make black text readable by inverting it to white.
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawString(fr, line.text, colour, SA_LEFT | SA_FORCE);
|
DrawString(-this->hscroll->GetPosition(), tr.right, tr.top, line.text, colour, SA_LEFT | SA_FORCE);
|
||||||
fr.top += this->resize.step_height;
|
tr.top += this->resize.step_height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -397,12 +397,6 @@ static bool ResizeSprites(SpriteLoader::SpriteCollection &sprite, uint8_t sprite
|
||||||
if (!HasBit(sprite_avail, zoom)) ResizeSpriteOut(sprite, zoom);
|
if (!HasBit(sprite_avail, zoom)) ResizeSpriteOut(sprite, zoom);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Upscale to desired sprite_min_zoom if provided sprite only had zoomed in versions. */
|
|
||||||
if (first_avail < _settings_client.gui.sprite_zoom_min) {
|
|
||||||
if (_settings_client.gui.sprite_zoom_min >= ZOOM_LVL_OUT_4X) ResizeSpriteIn(sprite, ZOOM_LVL_OUT_4X, ZOOM_LVL_OUT_2X);
|
|
||||||
if (_settings_client.gui.sprite_zoom_min >= ZOOM_LVL_OUT_2X) ResizeSpriteIn(sprite, ZOOM_LVL_OUT_2X, ZOOM_LVL_NORMAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -657,7 +657,7 @@ enum WindowClass {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Script debug window; %Window numbers:
|
* Script debug window; %Window numbers:
|
||||||
* - Ascending value = #ScriptDebugWidgets
|
* - 0 = #ScriptDebugWidgets
|
||||||
*/
|
*/
|
||||||
WC_SCRIPT_DEBUG,
|
WC_SCRIPT_DEBUG,
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue