[Scummvm-git-logs] scummvm master -> 6b6b49b34d78d48023668b89ac4abc07665863f5
dreammaster
paulfgilbert at gmail.com
Sat Feb 1 23:53:19 UTC 2020
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
df40de7dc7 ULTIMA8: Removed unused scalers and scaler manager
6b6b49b34d NUVIE: Compilation fix
Commit: df40de7dc77f75c920080552d552bec7af7946fb
https://github.com/scummvm/scummvm/commit/df40de7dc77f75c920080552d552bec7af7946fb
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-02-01T15:52:57-08:00
Commit Message:
ULTIMA8: Removed unused scalers and scaler manager
Changed paths:
A engines/ultima/ultima8/graphics/point_scaler.cpp
A engines/ultima/ultima8/graphics/point_scaler.h
R engines/ultima/ultima8/graphics/scaler_manager.cpp
R engines/ultima/ultima8/graphics/scaler_manager.h
R engines/ultima/ultima8/graphics/scalers/2x_saI_scalers.h
R engines/ultima/ultima8/graphics/scalers/2x_sai_scalers.cpp
R engines/ultima/ultima8/graphics/scalers/bilinear_scaler.cpp
R engines/ultima/ultima8/graphics/scalers/bilinear_scaler.h
R engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal.h
R engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_2x.cpp
R engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_arb.cpp
R engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_x1y12.cpp
R engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_x2y24.cpp
R engines/ultima/ultima8/graphics/scalers/hq2x_scaler.cpp
R engines/ultima/ultima8/graphics/scalers/hq2x_scaler.h
R engines/ultima/ultima8/graphics/scalers/hq2x_scaler.inc
R engines/ultima/ultima8/graphics/scalers/hq2x_scaler_16nat.cpp
R engines/ultima/ultima8/graphics/scalers/hq2x_scaler_16sta.cpp
R engines/ultima/ultima8/graphics/scalers/hq2x_scaler_32nat.cpp
R engines/ultima/ultima8/graphics/scalers/hq2x_scaler_32sta.cpp
R engines/ultima/ultima8/graphics/scalers/hq2x_scaler_888a.cpp
R engines/ultima/ultima8/graphics/scalers/hq2x_scaler_a888.cpp
R engines/ultima/ultima8/graphics/scalers/hq3x_scaler.cpp
R engines/ultima/ultima8/graphics/scalers/hq3x_scaler.h
R engines/ultima/ultima8/graphics/scalers/hq3x_scaler.inc
R engines/ultima/ultima8/graphics/scalers/hq3x_scaler_16nat.cpp
R engines/ultima/ultima8/graphics/scalers/hq3x_scaler_16sta.cpp
R engines/ultima/ultima8/graphics/scalers/hq3x_scaler_32nat.cpp
R engines/ultima/ultima8/graphics/scalers/hq3x_scaler_32sta.cpp
R engines/ultima/ultima8/graphics/scalers/hq3x_scaler_888a.cpp
R engines/ultima/ultima8/graphics/scalers/hq3x_scaler_a888.cpp
R engines/ultima/ultima8/graphics/scalers/hq4x_scaler.cpp
R engines/ultima/ultima8/graphics/scalers/hq4x_scaler.h
R engines/ultima/ultima8/graphics/scalers/hq4x_scaler.inc
R engines/ultima/ultima8/graphics/scalers/hq4x_scaler_16nat.cpp
R engines/ultima/ultima8/graphics/scalers/hq4x_scaler_16sta.cpp
R engines/ultima/ultima8/graphics/scalers/hq4x_scaler_32nat.cpp
R engines/ultima/ultima8/graphics/scalers/hq4x_scaler_32sta.cpp
R engines/ultima/ultima8/graphics/scalers/hq4x_scaler_888a.cpp
R engines/ultima/ultima8/graphics/scalers/hq4x_scaler_a888.cpp
R engines/ultima/ultima8/graphics/scalers/hq_scaler.cpp
R engines/ultima/ultima8/graphics/scalers/hq_scaler.h
R engines/ultima/ultima8/graphics/scalers/point_scaler.cpp
R engines/ultima/ultima8/graphics/scalers/point_scaler.h
R engines/ultima/ultima8/graphics/scalers/scale2x_scaler.h
R engines/ultima/ultima8/graphics/scalers/scale_2x_scaler.cpp
engines/ultima/module.mk
engines/ultima/ultima8/graphics/render_surface.h
engines/ultima/ultima8/graphics/scaler.h
engines/ultima/ultima8/graphics/soft_render_surface.cpp
engines/ultima/ultima8/graphics/soft_render_surface.h
engines/ultima/ultima8/gumps/scaler_gump.cpp
engines/ultima/ultima8/gumps/scaler_gump.h
engines/ultima/ultima8/ultima8.h
diff --git a/engines/ultima/module.mk b/engines/ultima/module.mk
index 8cf507c..5470c7e 100644
--- a/engines/ultima/module.mk
+++ b/engines/ultima/module.mk
@@ -368,8 +368,8 @@ MODULE_OBJS := \
ultima8/graphics/palette.o \
ultima8/graphics/palette_fader_process.o \
ultima8/graphics/palette_manager.o \
+ ultima8/graphics/point_scaler.o \
ultima8/graphics/render_surface.o \
- ultima8/graphics/scaler_manager.o \
ultima8/graphics/shape.o \
ultima8/graphics/shape_archive.o \
ultima8/graphics/shape_frame.o \
@@ -394,12 +394,6 @@ MODULE_OBJS := \
ultima8/graphics/fonts/shape_rendered_text.o \
ultima8/graphics/fonts/ttf_rendered_text.o \
ultima8/graphics/fonts/tt_font.o \
- ultima8/graphics/scalers/bilinear_scaler.o \
- ultima8/graphics/scalers/bilinear_scaler_internal_2x.o \
- ultima8/graphics/scalers/bilinear_scaler_internal_arb.o \
- ultima8/graphics/scalers/bilinear_scaler_internal_x1y12.o \
- ultima8/graphics/scalers/bilinear_scaler_internal_x2y24.o \
- ultima8/graphics/scalers/point_scaler.o \
ultima8/gumps/ask_gump.o \
ultima8/gumps/bark_gump.o \
ultima8/gumps/bind_gump.o \
diff --git a/engines/ultima/ultima8/graphics/point_scaler.cpp b/engines/ultima/ultima8/graphics/point_scaler.cpp
new file mode 100644
index 0000000..8cfb999
--- /dev/null
+++ b/engines/ultima/ultima8/graphics/point_scaler.cpp
@@ -0,0 +1,307 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "ultima/ultima8/misc/pent_include.h"
+#include "ultima/ultima8/graphics/point_scaler.h"
+#include "ultima/ultima8/graphics/manips.h"
+
+namespace Ultima {
+namespace Ultima8 {
+namespace Pentagram {
+
+// Very very simple point scaler
+template<class uintX, class Manip, class uintS = uintX> class PointScalerInternal {
+public:
+ static bool Scale(Texture *tex , int32 sx, int32 sy, int32 sw, int32 sh,
+ uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src) {
+ // Source buffer pointers
+ uintS *texel = reinterpret_cast<uintS *>(tex->buffer) + (sy * tex->width + sx);
+ int tpitch = tex->width;
+ uintS *tline_end = texel + sw;
+ uintS *tex_end = texel + sh * tex->width;
+ int tex_diff = tex->width - sw;
+
+
+ // First detect integer up scalings, since they are 'easy'
+ bool x_intscale = ((dw / sw) * sw) == dw;
+ bool y_intscale = ((dh / sh) * sh) == dh;
+
+ //
+ // 2x
+ //
+ if ((sw * 2 == dw) && (sh * 2 == dh)) {
+ uint8 *pixel2 = pixel + pitch;
+ int p_diff = (pitch * 2) - (dw * sizeof(uintX));
+
+ // Src Loop Y
+ do {
+ // Src Loop X
+ do {
+ uintX p = Manip::copy(*texel);
+
+ *(reinterpret_cast<uintX *>(pixel + 0)) = p;
+ *(reinterpret_cast<uintX *>(pixel + sizeof(uintX))) = p;
+ *(reinterpret_cast<uintX *>(pixel2 + 0)) = p;
+ *(reinterpret_cast<uintX *>(pixel2 + sizeof(uintX))) = p;
+ pixel += sizeof(uintX) * 2;
+ pixel2 += sizeof(uintX) * 2;
+ texel++;
+ } while (texel != tline_end);
+
+ pixel += p_diff;
+ pixel2 += p_diff;
+
+ texel += tex_diff;
+ tline_end += tpitch;
+ } while (texel != tex_end);
+
+ }
+ //
+ // Integer scaling, x and y
+ //
+ else if (x_intscale && y_intscale) {
+ int xf = dw / sw;
+ int yf = dh / sh;
+
+ uint8 *px_end = pixel + xf * sizeof(uintX);
+ uint8 *py_end = pixel + yf * pitch;
+
+ int block_w = xf * sizeof(uintX);
+ int block_h = pitch * yf;
+ int block_xdiff = pitch - block_w;
+ int p_diff = block_h - dw * sizeof(uintX);
+
+ // Src Loop Y
+ do {
+ // Src Loop X
+ do {
+ uintX p = Manip::copy(*texel);
+
+ //
+ // Inner loops
+ //
+
+ // Dest Loop Y
+ do {
+ // Dest Loop X
+ do {
+ *(reinterpret_cast<uintX *>(pixel)) = p;
+ pixel += sizeof(uintX);
+ } while (pixel != px_end);
+
+ pixel += block_xdiff;
+ px_end += pitch;
+ } while (pixel != py_end);
+
+ pixel += block_w - block_h;
+ px_end += block_w - block_h;
+ py_end += block_w;
+ texel++;
+ } while (texel != tline_end);
+
+ pixel += p_diff;
+ py_end += p_diff;
+ px_end += p_diff;
+
+ texel += tex_diff;
+ tline_end += tpitch;
+ } while (texel != tex_end);
+
+ }
+ //
+ // 2x X and Arbitrary Upscaled Y
+ // Specifically to handle 320x200 -> 640x480
+ //
+ else if ((sw * 2 == dw) && (dh >= sh)) {
+ uint32 pos_y;
+ uint32 end_y = dh;
+ uint32 dst_y = 0;
+ uint8 *next_block = 0;
+
+ // Src Loop Y
+ do {
+ next_block = pixel;
+
+ // Src Loop X
+ do {
+ pos_y = dst_y;
+
+ uintX p = Manip::copy(*texel);
+
+ //
+ // Inner loops
+ //
+ pixel = next_block;
+ next_block = next_block + sizeof(uintX) * 2;
+
+ // Dest Loop Y
+ do {
+ *(reinterpret_cast<uintX *>(pixel + 0)) = p;
+ *(reinterpret_cast<uintX *>(pixel + sizeof(uintX))) = p;
+ pixel += pitch;
+ pos_y += sh;
+ } while (pos_y < end_y);
+
+ texel++;
+ } while (texel != tline_end);
+
+ pixel -= sizeof(uintX) * (dw - 2);
+ dst_y = pos_y;
+ end_y += dh;
+
+ texel += tex_diff;
+ tline_end += tpitch;
+ } while (texel != tex_end);
+ }
+ //
+ // 1x X and Arbitrary Upscaled Y
+ // Specifically to handle 640x400 -> 640x480
+ //
+ else if ((sw == dw) && (dh >= sh)) {
+ uint32 pos_y;
+ uint32 end_y = dh;
+ uint32 dst_y = 0;
+ uint8 *next_block = 0;
+
+ // Src Loop Y
+ do {
+ next_block = pixel;
+
+ // Src Loop X
+ do {
+ pos_y = dst_y;
+
+ uintX p = Manip::copy(*texel);
+
+ //
+ // Inner loops
+ //
+ pixel = next_block;
+ next_block = next_block + sizeof(uintX);
+
+ // Dest Loop Y
+ do {
+ *(reinterpret_cast<uintX *>(pixel)) = p;
+ pixel += pitch;
+ pos_y += sh;
+ } while (pos_y < end_y);
+
+ texel++;
+ } while (texel != tline_end);
+
+ pixel -= sizeof(uintX) * (dw - 1);
+ dst_y = pos_y;
+ end_y += dh;
+
+ texel += tex_diff;
+ tline_end += tpitch;
+ } while (texel != tex_end);
+ }
+ //
+ // Arbitrary scaling X and Y (optimized for upscaling)
+ //
+ else {
+ uint32 pos_y = 0, pos_x = 0;
+ uint32 end_y = dh;
+ uint32 dst_y = 0;
+ uint8 *blockline_start = 0;
+ uint8 *next_block = 0;
+
+ // Src Loop Y
+ do {
+ uint32 end_x = dw;
+ uint32 dst_x = 0;
+
+ next_block = pixel;
+
+ // Src Loop X
+ do {
+ pos_y = dst_y;
+
+ uintX p = Manip::copy(*texel);
+
+ //
+ // Inner loops
+ //
+ blockline_start = next_block;
+ next_block = 0;
+
+ // Dest Loop Y
+ while (pos_y < end_y) {
+ pos_x = dst_x;
+ pixel = blockline_start;
+
+ // Dest Loop X
+ while (pos_x < end_x) {
+ *(reinterpret_cast<uintX *>(pixel)) = p;
+
+ pixel += sizeof(uintX);
+ pos_x += sw;
+ }
+ if (!next_block) next_block = pixel;
+
+ blockline_start += pitch;
+
+ pos_y += sh;
+ }
+
+ dst_x = pos_x;
+ end_x += dw;
+ texel++;
+ } while (texel != tline_end);
+
+ pixel += pitch - sizeof(uintX) * (dw);
+
+ dst_y = pos_y;
+ end_y += dh;
+
+ texel += tex_diff;
+ tline_end += tpitch;
+ } while (texel != tex_end);
+ }
+
+ return true;
+ }
+
+};
+
+
+PointScaler::PointScaler() : Scaler() {
+ Scale16Nat = PointScalerInternal<uint16, Manip_Nat2Nat_16, uint16>::Scale;
+ Scale16Sta = PointScalerInternal<uint16, Manip_Sta2Nat_16, uint32>::Scale;
+
+ Scale32Nat = PointScalerInternal<uint32, Manip_Nat2Nat_32, uint32>::Scale;
+ Scale32Sta = PointScalerInternal<uint32, Manip_Sta2Nat_32, uint32>::Scale;
+ Scale32_A888 = PointScalerInternal<uint32, Manip_32_A888, uint32>::Scale;
+ Scale32_888A = PointScalerInternal<uint32, Manip_32_888A, uint32>::Scale;
+}
+
+uint32 PointScaler::ScaleBits() const {
+ return 0xFFFFFFFF;
+}
+bool PointScaler::ScaleArbitrary() const {
+ return true;
+}
+
+} // End of namespace Pentagram
+} // End of namespace Ultima8
+} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/point_scaler.h b/engines/ultima/ultima8/graphics/point_scaler.h
new file mode 100644
index 0000000..ffaabd8
--- /dev/null
+++ b/engines/ultima/ultima8/graphics/point_scaler.h
@@ -0,0 +1,44 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef ULTIMA8_GRAPHICS_SCALERS_POINTSCALER_H
+#define ULTIMA8_GRAPHICS_SCALERS_POINTSCALER_H
+
+#include "ultima/ultima8/graphics/scaler.h"
+
+namespace Ultima {
+namespace Ultima8 {
+namespace Pentagram {
+
+class PointScaler : public Scaler {
+public:
+ PointScaler();
+
+ virtual uint32 ScaleBits() const; //< bits for supported integer scaling
+ virtual bool ScaleArbitrary() const; //< supports arbitrary scaling of any degree
+};
+
+} // End of namespace Pentagram
+} // End of namespace Ultima8
+} // End of namespace Ultima
+
+#endif
diff --git a/engines/ultima/ultima8/graphics/render_surface.h b/engines/ultima/ultima8/graphics/render_surface.h
index e73f303..1d5949b 100644
--- a/engines/ultima/ultima8/graphics/render_surface.h
+++ b/engines/ultima/ultima8/graphics/render_surface.h
@@ -245,7 +245,7 @@ public:
virtual void MaskedBlit(Texture *, int32 sx, int32 sy, int32 w, int32 h, int32 dx, int32 dy, uint32 col32, bool alpha_blend = false) = 0;
//! Blit a stretched region from a Texture (Alpha == 0 -> skipped???)
- virtual void StretchBlit(Texture *, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, bool bilinear = false, bool clampedges = false) = 0;
+ virtual void StretchBlit(Texture *, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, bool clampedges = false) = 0;
//! Blit a region from a Texture using a scaler
virtual bool ScalerBlit(Texture *, int32 sx, int32 sy, int32 sw, int32 sh, int32 dx, int32 dy, int32 dw, int32 dh, const Pentagram::Scaler *, bool clampedges = false) = 0;
diff --git a/engines/ultima/ultima8/graphics/scaler.h b/engines/ultima/ultima8/graphics/scaler.h
index b1b4da2..7417a56 100644
--- a/engines/ultima/ultima8/graphics/scaler.h
+++ b/engines/ultima/ultima8/graphics/scaler.h
@@ -25,7 +25,6 @@
#include "ultima/ultima8/graphics/texture.h"
#include "ultima/ultima8/graphics/render_surface.h"
-#include "ultima/ultima8/graphics/scaler_manager.h"
namespace Ultima {
namespace Ultima8 {
@@ -34,7 +33,6 @@ namespace Pentagram {
/// Base Scaler class
class Scaler {
friend class hqScaler;
-
protected:
// Basic scaler function template
typedef bool (*ScalerFunc)(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
@@ -51,9 +49,7 @@ protected:
ScalerFunc Scale32_A888;
ScalerFunc Scale32_888A;
- Scaler() {
- ScalerManager::get_instance()->AddScaler(this);
- }
+ Scaler() {}
public:
//
// Scaler Capabilites
@@ -62,10 +58,6 @@ public:
virtual uint32 ScaleBits() const = 0; //< bits for supported integer scaling
virtual bool ScaleArbitrary() const = 0; //< supports arbitrary scaling of any degree
- virtual const char *ScalerName() const = 0; //< Name Of the Scaler (1 word)
- virtual const char *ScalerDesc() const = 0; //< Desciption of the Scaler
- virtual const char *ScalerCopyright() const = 0; //< Scaler Copyright info
-
//
// Maybe one day... for now we just grab everything from RenderSurface
// virtual bool SetDisplayFormat(const RenderSurface::Format &format);
diff --git a/engines/ultima/ultima8/graphics/scaler_manager.cpp b/engines/ultima/ultima8/graphics/scaler_manager.cpp
deleted file mode 100644
index 068828b..0000000
--- a/engines/ultima/ultima8/graphics/scaler_manager.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-#include "ultima/ultima8/graphics/scaler_manager.h"
-#include "ultima/ultima8/graphics/scaler.h"
-#include "ultima/ultima8/graphics/scalers/point_scaler.h"
-
-namespace Ultima {
-namespace Ultima8 {
-
-ScalerManager *ScalerManager::scaler_man = 0;
-
-//
-// Constructor
-//
-ScalerManager::ScalerManager() {
-}
-
-//
-// Destructor
-//
-ScalerManager::~ScalerManager() {
-}
-
-//
-// Get the total Number of scalers
-//
-uint32 ScalerManager::GetNumScalers() {
- return scalers.size();
-}
-
-//
-// Get the Index of a scaler from its Name
-//
-uint32 ScalerManager::GetIndexForName(const Pentagram::istring name) {
- Std::vector<const Pentagram::Scaler *>::iterator it;
- uint32 index = 0;
-
- for (it = scalers.begin(); it != scalers.end(); ++it, ++index) {
-
- if (name == (*it)->ScalerName()) return index;
- }
-
- return 0xFFFFFFFF;
-}
-
-//
-// Get Name of a Scaler from its Index
-//
-const char *ScalerManager::GetNameForIndex(uint32 index) {
- if (index >= scalers.size()) return 0;
-
- return scalers[index]->ScalerName();
-}
-
-
-//
-// Get a Scaler from its Index
-//
-const Pentagram::Scaler *ScalerManager::GetScaler(uint32 index) {
- if (index >= scalers.size()) return 0;
-
- return scalers[index];
-}
-
-//
-// Get the Index of a scaler from its Name
-//
-const Pentagram::Scaler *ScalerManager::GetScaler(const Pentagram::istring name) {
- Std::vector<const Pentagram::Scaler *>::iterator it;
-
- for (it = scalers.begin(); it != scalers.end(); ++it) {
-
- if (name == (*it)->ScalerName()) return *it;
- }
-
- return 0;
-}
-
-//
-// Adds a scaler
-//
-uint32 ScalerManager::AddScaler(const Pentagram::Scaler *scaler) {
- if (!scaler) return 0xFFFFFFFF;
-
- Std::vector<const Pentagram::Scaler *>::iterator it;
- uint32 index = 0;
-
- for (it = scalers.begin(); it != scalers.end(); ++it, ++index) {
-
- if (scaler == (*it)) return index;
- }
-
- scalers.push_back(scaler);
- return scalers.size() - 1;
-}
-
-//
-// Get the Point Sampling Scaler
-//
-const Pentagram::Scaler *ScalerManager::GetPointScaler() {
- // Point scaler is always first
- return &Pentagram::point_scaler;
-}
-
-} // End of namespace Ultima8
-} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/scaler_manager.h b/engines/ultima/ultima8/graphics/scaler_manager.h
deleted file mode 100644
index cd5cd27..0000000
--- a/engines/ultima/ultima8/graphics/scaler_manager.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef ULTIMA8_GRAPHICS_SCALERMANAGER_H
-#define ULTIMA8_GRAPHICS_SCALERMANAGER_H
-
-#include "ultima/shared/std/containers.h"
-#include "ultima/ultima8/misc/istring.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-class Scaler;
-}
-
-//
-// This entire class is just static
-//
-class ScalerManager {
- Std::vector<const Pentagram::Scaler *> scalers;
-
- static ScalerManager *scaler_man;
-
- // Constructor
- ScalerManager();
-
-public:
- // Destructor
- ~ScalerManager();
-
- //! Get instance, or create
- static ScalerManager *get_instance() {
- if (!scaler_man) scaler_man = new ScalerManager;
- return scaler_man;
- }
-
- //! Adds a scaler, returns the index
- uint32 AddScaler(const Pentagram::Scaler *scaler);
-
-
- //! Get the total Number of scalers
- uint32 GetNumScalers();
-
- //! Get the Scaler Index from its name
- uint32 GetIndexForName(const Pentagram::istring name);
-
- //! Get Name of a Scaler from its Index
- const char *GetNameForIndex(uint32 index);
-
- //! Get a Scaler from its Index
- const Pentagram::Scaler *GetScaler(uint32 index);
-
- //! Get a Scaler from its name
- const Pentagram::Scaler *GetScaler(const Pentagram::istring name);
-
- //! Get the Point Sampling Scaler
- const Pentagram::Scaler *GetPointScaler();
-};
-
-} // End of namespace Ultima8
-} // End of namespace Ultima
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/2x_saI_scalers.h b/engines/ultima/ultima8/graphics/scalers/2x_saI_scalers.h
deleted file mode 100644
index 32d77c8..0000000
--- a/engines/ultima/ultima8/graphics/scalers/2x_saI_scalers.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef ULTIMA8_GRAPHICS_SCALERS_2XSAISCALER_H
-#define ULTIMA8_GRAPHICS_SCALERS_2XSAISCALER_H
-
-#include "ultima/ultima8/graphics/scaler.h"
-
-namespace Pentagram {
-
-class _2xSaIScaler : public Scaler {
-public:
- _2xSaIScaler();
-
- virtual uint32 ScaleBits() const; //< bits for supported integer scaling
- virtual bool ScaleArbitrary() const; //< supports arbitrary scaling of any degree
-
- virtual const char *ScalerName() const; //< Name Of the Scaler (1 word)
- virtual const char *ScalerDesc() const; //< Desciption of the Scaler
- virtual const char *ScalerCopyright() const; //< Scaler Copyright info
-};
-
-class Super2xSaIScaler : public Scaler {
-public:
- Super2xSaIScaler();
-
- virtual uint32 ScaleBits() const; //< bits for supported integer scaling
- virtual bool ScaleArbitrary() const; //< supports arbitrary scaling of any degree
-
- virtual const char *ScalerName() const; //< Name Of the Scaler (1 word)
- virtual const char *ScalerDesc() const; //< Desciption of the Scaler
- virtual const char *ScalerCopyright() const; //< Scaler Copyright info
-};
-
-class SuperEagleScaler : public Scaler {
-public:
- SuperEagleScaler();
-
- virtual uint32 ScaleBits() const; //< bits for supported integer scaling
- virtual bool ScaleArbitrary() const; //< supports arbitrary scaling of any degree
-
- virtual const char *ScalerName() const; //< Name Of the Scaler (1 word)
- virtual const char *ScalerDesc() const; //< Desciption of the Scaler
- virtual const char *ScalerCopyright() const; //< Scaler Copyright info
-};
-
-extern const _2xSaIScaler _2xSaI_scaler;
-extern const Super2xSaIScaler Super2xSaI_scaler;
-extern const SuperEagleScaler SuperEagle_scaler;
-
-#ifdef COMPILE_GAMMA_CORRECT_SCALERS
-
-class GC_2xSaIScaler : public Scaler {
-public:
- GC_2xSaIScaler();
-
- virtual uint32 ScaleBits() const; //< bits for supported integer scaling
- virtual bool ScaleArbitrary() const; //< supports arbitrary scaling of any degree
-
- virtual const char *ScalerName() const; //< Name Of the Scaler (1 word)
- virtual const char *ScalerDesc() const; //< Desciption of the Scaler
- virtual const char *ScalerCopyright() const; //< Scaler Copyright info
-};
-
-class GC_Super2xSaIScaler : public Scaler {
-public:
- GC_Super2xSaIScaler();
-
- virtual uint32 ScaleBits() const; //< bits for supported integer scaling
- virtual bool ScaleArbitrary() const; //< supports arbitrary scaling of any degree
-
- virtual const char *ScalerName() const; //< Name Of the Scaler (1 word)
- virtual const char *ScalerDesc() const; //< Desciption of the Scaler
- virtual const char *ScalerCopyright() const; //< Scaler Copyright info
-};
-
-class GC_SuperEagleScaler : public Scaler {
-public:
- GC_SuperEagleScaler();
-
- virtual uint32 ScaleBits() const; //< bits for supported integer scaling
- virtual bool ScaleArbitrary() const; //< supports arbitrary scaling of any degree
-
- virtual const char *ScalerName() const; //< Name Of the Scaler (1 word)
- virtual const char *ScalerDesc() const; //< Desciption of the Scaler
- virtual const char *ScalerCopyright() const; //< Scaler Copyright info
-};
-
-extern const GC_2xSaIScaler GC_2xSaI_scaler;
-extern const GC_Super2xSaIScaler GC_Super2xSaI_scaler;
-extern const GC_SuperEagleScaler GC_SuperEagle_scaler;
-#endif
-};
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/2x_sai_scalers.cpp b/engines/ultima/ultima8/graphics/scalers/2x_sai_scalers.cpp
deleted file mode 100644
index 5c1fed5..0000000
--- a/engines/ultima/ultima8/graphics/scalers/2x_sai_scalers.cpp
+++ /dev/null
@@ -1,946 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-#include "ultima/ultima8/graphics/scalers/2x_sal_scalers.h"
-#include "ultima/ultima8/graphics/manips.h"
-#include "ultima/ultima8/graphics/texture.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-
-template<class uintX, class Manip, class uintS = uintX> class _2xSaIScalerInternal {
-
-public:
-
-
- /**
- ** 2xSaI scaling filter source code adapted for Exult
- ** August 29 2000, originally written in May 1999
- ** by Derek Liauw Kie Fa (DerekL666 at yahoo.com/D.A.K.L.LiauwKieFa at student.tudelft.nl)
- ** This source is made available under the terms of the GNU GPL
- ** I'd appreciate it I am given credit in the program or documentation
- **/
-
- static inline uintX Interpolate_2xSaI(uintS colorA, uintS colorB) {
- uint8 r0, r1, g0, g1, b0, b1, a0, a1;
- Manip::split(colorA, r0, g0, b0, a0);
- Manip::split(colorB, r1, g1, b1, a1);
- int r = (r0 + r1) >> 1;
- int g = (g0 + g1) >> 1;
- int b = (b0 + b1) >> 1;
- int a = (a0 + a1) >> 1;
- return Manip::merge(r, g, b, a);
- }
-
- static inline uintX OInterpolate_2xSaI(uintS colorA, uintS colorB, uintS colorC) {
- uint8 r0, r1, g0, g1, b0, b1, a0, a1;
- uint8 r2, g2, b2, a2;
- Manip::split(colorA, r0, g0, b0, a0);
- Manip::split(colorB, r1, g1, b1, a1);
- Manip::split(colorC, r2, g2, b2, a2);
- unsigned int r = ((r0 << 2) + (r0 << 1) + r1 + r2) >> 3;
- unsigned int g = ((g0 << 2) + (g0 << 1) + g1 + g2) >> 3;
- unsigned int b = ((b0 << 2) + (b0 << 1) + b1 + b2) >> 3;
- unsigned int a = ((a0 << 2) + (a0 << 1) + a1 + a2) >> 3;
- return Manip::merge(r, g, b, a);
- }
-
- static inline uintX QInterpolate_2xSaI(uintS colorA, uintS colorB, uintS colorC, uintS colorD) {
- uint8 r0, r1, g0, g1, b0, b1, a0, a1;
- uint8 r2, r3, g2, g3, b2, b3, a2, a3;
- Manip::split(colorA, r0, g0, b0, a0);
- Manip::split(colorB, r1, g1, b1, a1);
- Manip::split(colorC, r2, g2, b2, a2);
- Manip::split(colorD, r3, g3, b3, a3);
- unsigned int r = (r0 + r1 + r2 + r3) >> 2;
- unsigned int g = (g0 + g1 + g2 + g3) >> 2;
- unsigned int b = (b0 + b1 + b2 + b3) >> 2;
- unsigned int a = (a0 + a1 + a2 + a3) >> 2;
- return Manip::merge(r, g, b, a);
- }
-
- static inline int GetResult1(uintS A, uintS B, uintS C, uintS D) {
- int x = 0;
- int y = 0;
- int r = 0;
- if (A == C) x += 1;
- else if (B == C) y += 1;
- if (A == D) x += 1;
- else if (B == D) y += 1;
- if (x <= 1) r += 1;
- if (y <= 1) r -= 1;
- return r;
- }
-
- static inline int GetResult2(uintS A, uintS B, uintS C, uintS D) {
- int x = 0;
- int y = 0;
- int r = 0;
- if (A == C) x += 1;
- else if (B == C) y += 1;
- if (A == D) x += 1;
- else if (B == D) y += 1;
- if (x <= 1) r -= 1;
- if (y <= 1) r += 1;
- return r;
- }
-
-//
-// 2xSaI Scaler
-//
- static void Scale_2xSaI
- (
- uintS *source, // ->source pixels.
- int srcx, int srcy, // Start of rectangle within src.
- int srcw, int srch, // Dims. of rectangle.
- const int sline_pixels, // Pixels (words)/line for source.
- const int sheight, // Source height.
- uintX *dest, // ->dest pixels.
- const int dline_pixels // Pixels (words)/line for dest.
- ) {
- uintS *srcPtr = source + (srcx + srcy * sline_pixels);
- uintX *dstPtr = dest;
-
- if (srcx + srcw >= sline_pixels) {
- srcw = sline_pixels - srcx;
- }
- // Init offset to prev. line, next 2.
- int prev1_yoff = srcy ? sline_pixels : 0;
- int next1_yoff = sline_pixels, next2_yoff = 2 * sline_pixels;
- // Figure threshholds for counters.
- int ybeforelast = sheight - 2 - srcy;
- int xbeforelast = sline_pixels - 2 - srcx;
- for (int y = 0; y < srch; y++, prev1_yoff = sline_pixels) {
- if (y >= ybeforelast) // Last/next-to-last row?
- if (y == ybeforelast)
- next2_yoff = sline_pixels;
- else // Very last line?
- next2_yoff = next1_yoff = 0;
-
- uintS *bP = srcPtr;
- uintX *dP = dstPtr;
- int prev1_xoff = srcx ? 1 : 0;
- int next1_xoff = 1, next2_xoff = 2;
-
- for (int x = 0; x < srcw; x++) {
- uintS colorA, colorB;
- uintS colorC, colorD,
- colorE, colorF, colorG, colorH,
- colorI, colorJ, colorK, colorL,
- colorM, colorN, colorO, colorP;
- uintX product, product1, product2, orig;
-
- // Last/next-to-last row?
- if (x >= xbeforelast)
- if (x == xbeforelast)
- next2_xoff = 1;
- else
- next2_xoff = next1_xoff = 0;
-
- //---------------------------------------
- // Map of the pixels: I|E F|J
- // G|A B|K
- // H|C D|L
- // M|N O|P
- colorI = *(bP - prev1_yoff - prev1_xoff);
- colorE = *(bP - prev1_yoff);
- colorF = *(bP - prev1_yoff + next1_xoff);
- colorJ = *(bP - prev1_yoff + next2_xoff);
-
- colorG = *(bP - prev1_xoff);
- colorA = *(bP);
- colorB = *(bP + next1_xoff);
- colorK = *(bP + next2_xoff);
-
- colorH = *(bP + next1_yoff - prev1_xoff);
- colorC = *(bP + next1_yoff);
- colorD = *(bP + next1_yoff + next1_xoff);
- colorL = *(bP + next1_yoff + next2_xoff);
-
- colorM = *(bP + next2_yoff - prev1_xoff);
- colorN = *(bP + next2_yoff);
- colorO = *(bP + next2_yoff + next1_xoff);
- colorP = *(bP + next2_yoff + next2_xoff);
-
- if ((colorA == colorD) && (colorB != colorC)) {
- if (((colorA == colorE) && (colorB == colorL)) ||
- ((colorA == colorC) && (colorA == colorF) && (colorB != colorE) && (colorB == colorJ))) {
- //product = colorA;
- product = Manip::copy(colorA);
- } else {
- //product = INTERPOLATE(colorA, colorB);
- product = Interpolate_2xSaI(colorA, colorB);
- }
-
- if (((colorA == colorG) && (colorC == colorO)) ||
- ((colorA == colorB) && (colorA == colorH) && (colorG != colorC) && (colorC == colorM))) {
- //product1 = colorA;
- product1 = Manip::copy(colorA);
- } else {
- //product1 = INTERPOLATE(colorA, colorC);
- product1 = Interpolate_2xSaI(colorA, colorC);
- }
- //product2 = colorA;
- product2 = Manip::copy(colorA);
- } else if ((colorB == colorC) && (colorA != colorD)) {
- if (((colorB == colorF) && (colorA == colorH)) ||
- ((colorB == colorE) && (colorB == colorD) && (colorA != colorF) && (colorA == colorI))) {
- //product = colorB;
- product = Manip::copy(colorB);
- } else {
- //product = INTERPOLATE(colorA, colorB);
- product = Interpolate_2xSaI(colorA, colorB);
- }
-
- if (((colorC == colorH) && (colorA == colorF)) ||
- ((colorC == colorG) && (colorC == colorD) && (colorA != colorH) && (colorA == colorI))) {
- //product1 = colorC;
- product1 = Manip::copy(colorC);
- } else {
- //product1 = INTERPOLATE(colorA, colorC);
- product1 = Interpolate_2xSaI(colorA, colorC);
- }
- //product2 = colorB;
- product2 = Manip::copy(colorB);
- } else if ((colorA == colorD) && (colorB == colorC)) {
- if (colorA == colorB) {
- //product = colorA;
- product = Manip::copy(colorA);
- //product1 = colorA;
- product1 = Manip::copy(colorA);
- //product2 = colorA;
- product2 = Manip::copy(colorA);
- } else {
- register int r = 0;
- //product1 = INTERPOLATE(colorA, colorC);
- product1 = Interpolate_2xSaI(colorA, colorC);
- //product = INTERPOLATE(colorA, colorB);
- product = Interpolate_2xSaI(colorA, colorB);
-
- r += GetResult1(colorA, colorB, colorG, colorE);
- r += GetResult2(colorB, colorA, colorK, colorF);
- r += GetResult2(colorB, colorA, colorH, colorN);
- r += GetResult1(colorA, colorB, colorL, colorO);
-
- if (r > 0)
- //product2 = colorA;
- product2 = Manip::copy(colorA);
- else if (r < 0)
- //product2 = colorB;
- product2 = Manip::copy(colorB);
- else {
- //product2 = Q_INTERPOLATE(colorA, colorB, colorC, colorD);
- product2 = QInterpolate_2xSaI(colorA, colorB, colorC, colorD);
- }
- }
- } else {
- //product2 = Q_INTERPOLATE(colorA, colorB, colorC, colorD);
- product2 = QInterpolate_2xSaI(colorA, colorB, colorC, colorD);
-
- if ((colorA == colorC) && (colorA == colorF) && (colorB != colorE) && (colorB == colorJ)) {
- //product = colorA;
- product = Manip::copy(colorA);
- } else if ((colorB == colorE) && (colorB == colorD) && (colorA != colorF) && (colorA == colorI)) {
- //product = colorB;
- product = Manip::copy(colorB);
- } else {
- //product = INTERPOLATE(colorA, colorB);
- product = Interpolate_2xSaI(colorA, colorB);
- }
-
- if ((colorA == colorB) && (colorA == colorH) && (colorG != colorC) && (colorC == colorM)) {
- //product1 = colorA;
- product1 = Manip::copy(colorA);
- } else if ((colorC == colorG) && (colorC == colorD) && (colorA != colorH) && (colorA == colorI)) {
- //product1 = colorC;
- product1 = Manip::copy(colorC);
- } else {
- //product1 = INTERPOLATE(colorA, colorC);
- product1 = Interpolate_2xSaI(colorA, colorC);
- }
- }
-
-
- //product = colorA | (product << 16);
- //product1 = product1 | (product2 << 16);
- orig = Manip::copy(colorA);
- *dP = orig;
- *(dP + 1) = product;
- *(dP + dline_pixels) = product1;
- *(dP + dline_pixels + 1) = product2;
-
- bP += 1;
- dP += 2;
- prev1_xoff = 1;
- }//end of for ( finish= width etc..)
-
- srcPtr += sline_pixels;
- dstPtr += 2 * dline_pixels;
- prev1_yoff = 1;
- };
- }
-
-//
-// Super2xSaI Scaler
-//
- static void Scale_Super2xSaI
- (
- uintS *source, // ->source pixels.
- int srcx, int srcy, // Start of rectangle within src.
- int srcw, int srch, // Dims. of rectangle.
- const int sline_pixels, // Pixels (words)/line for source.
- const int sheight, // Source height.
- uintX *dest, // ->dest pixels.
- const int dline_pixels // Pixels (words)/line for dest.
- ) {
-
- uintS *srcPtr = source + (srcx + srcy * sline_pixels);
- uintX *dstPtr = dest;
-
- if (srcx + srcw >= sline_pixels) {
- srcw = sline_pixels - srcx;
- }
-
- int ybeforelast1 = sheight - 1 - srcy;
- int ybeforelast2 = sheight - 2 - srcy;
- int xbeforelast1 = sline_pixels - 1 - srcx;
- int xbeforelast2 = sline_pixels - 2 - srcx;
-
- for (int y = 0; y < srch; y++) {
- uintS *bP = srcPtr;
- uintX *dP = dstPtr;
-
- for (int x = 0; x < srcw; x++) {
- uintS color4, color5, color6;
- uintS color1, color2, color3;
- uintS colorA0, colorA1, colorA2, colorA3,
- colorB0, colorB1, colorB2, colorB3,
- colorS1, colorS2;
- uintX product1a, product1b,
- product2a, product2b;
-
- //--------------------------------------- B0 B1 B2 B3
- // 4 5 6 S2
- // 1 2 3 S1
- // A0 A1 A2 A3
- //--------------------------------------
- int add1, add2;
- int sub1;
- int nextl1, nextl2;
- int prevl1;
-
- if ((x + srcx) == 0)
- sub1 = 0;
- else
- sub1 = 1;
-
- if (x >= xbeforelast2)
- add2 = 0;
- else add2 = 1;
-
- if (x >= xbeforelast1)
- add1 = 0;
- else add1 = 1;
-
- if ((y + srcy) == 0)
- prevl1 = 0;
- else
- prevl1 = sline_pixels;
-
- if (y >= ybeforelast2)
- nextl2 = 0;
- else nextl2 = sline_pixels;
-
- if (y >= ybeforelast1)
- nextl1 = 0;
- else nextl1 = sline_pixels;
-
-
- colorB0 = *(bP - prevl1 - sub1);
- colorB1 = *(bP - prevl1);
- colorB2 = *(bP - prevl1 + add1);
- colorB3 = *(bP - prevl1 + add1 + add2);
-
- color4 = *(bP - sub1);
- color5 = *(bP);
- color6 = *(bP + add1);
- colorS2 = *(bP + add1 + add2);
-
- color1 = *(bP + nextl1 - sub1);
- color2 = *(bP + nextl1);
- color3 = *(bP + nextl1 + add1);
- colorS1 = *(bP + nextl1 + add1 + add2);
-
- colorA0 = *(bP + nextl1 + nextl2 - sub1);
- colorA1 = *(bP + nextl1 + nextl2);
- colorA2 = *(bP + nextl1 + nextl2 + add1);
- colorA3 = *(bP + nextl1 + nextl2 + add1 + add2);
-
- if (color2 == color6 && color5 != color3) {
- //product2b = product1b = color2;
- product2b = product1b = Manip::copy(color2);
- } else if (color5 == color3 && color2 != color6) {
- //product2b = product1b = color5;
- product2b = product1b = Manip::copy(color5);
- } else if (color5 == color3 && color2 == color6) {
- register int r = 0;
-
- //r += GetResult (color6, color5, color1, colorA1);
- //r += GetResult (color6, color5, color4, colorB1);
- //r += GetResult (color6, color5, colorA2, colorS1);
- //r += GetResult (color6, color5, colorB2, colorS2);
- r += GetResult1(color5, color6, color4, colorB1);
- r += GetResult2(color6, color5, colorA2, colorS1);
- r += GetResult2(color6, color5, color1, colorA1);
- r += GetResult1(color5, color6, colorB2, colorS2);
-
- if (r > 0) {
- //product2b = product1b = color6;
- product2b = product1b = Manip::copy(color6);
- } else if (r < 0) {
- //product2b = product1b = color5;
- product2b = product1b = Manip::copy(color5);
- } else {
- //product2b = product1b = INTERPOLATE (color5, color6);
- product1b = product2b = Interpolate_2xSaI(color5, color6);
- }
-
- } else {
-
- if (color6 == color3 && color3 == colorA1 && color2 != colorA2 && color3 != colorA0)
- //product2b = Q_INTERPOLATE (color3, color3, color3, color2);
- product2b = QInterpolate_2xSaI(color3, color3, color3, color2);
- else if (color5 == color2 && color2 == colorA2 && colorA1 != color3 && color2 != colorA3)
- //product2b = Q_INTERPOLATE (color2, color2, color2, color3);
- product2b = QInterpolate_2xSaI(color3, color2, color2, color2);
- else
- //product2b = INTERPOLATE (color2, color3);
- product2b = Interpolate_2xSaI(color2, color3);
-
-
- if (color6 == color3 && color6 == colorB1 && color5 != colorB2 && color6 != colorB0)
- //product1b = Q_INTERPOLATE (color6, color6, color6, color5);
- product1b = QInterpolate_2xSaI(color5, color6, color6, color6);
- else if (color5 == color2 && color5 == colorB2 && colorB1 != color6 && color5 != colorB3)
- //product1b = Q_INTERPOLATE (color6, color5, color5, color5);
- product1b = QInterpolate_2xSaI(color6, color5, color5, color5);
- else
- //product1b = INTERPOLATE (color5, color6);
- product1b = Interpolate_2xSaI(color5, color6);
-
- }
-
- if (color5 == color3 && color2 != color6 && color4 == color5 && color5 != colorA2)
- //product2a = INTERPOLATE (color2, color5);
- product2a = Interpolate_2xSaI(color5, color2);
- else if (color5 == color1 && color6 == color5 && color4 != color2 && color5 != colorA0)
- //product2a = INTERPOLATE(color2, color5);
- product2a = Interpolate_2xSaI(color5, color2);
- else
- //product2a = color2;
- product2a = Manip::copy(color2);
-
-
- if (color2 == color6 && color5 != color3 && color1 == color2 && color2 != colorB2)
- //product1a = INTERPOLATE (color2, color5);
- product1a = Interpolate_2xSaI(color5, color2);
- else if (color4 == color2 && color3 == color2 && color1 != color5 && color2 != colorB0)
- //product1a = INTERPOLATE(color2, color5);
- product1a = Interpolate_2xSaI(color5, color2);
- else
- //product1a = color5;
- product1a = Manip::copy(color5);
-
-
- *dP = product1a;
- *(dP + 1) = product1b;
- *(dP + dline_pixels) = product2a;
- *(dP + dline_pixels + 1) = product2b;
-
- bP += 1;
- dP += 2;
-
- }
- srcPtr += sline_pixels;
- dstPtr += 2 * dline_pixels;
- };
- }
-
-//
-// SuperEagle Scaler
-//
- static void Scale_SuperEagle
- (
- uintS *source, // ->source pixels.
- int srcx, int srcy, // Start of rectangle within src.
- int srcw, int srch, // Dims. of rectangle.
- const int sline_pixels, // Pixels (words)/line for source.
- const int sheight, // Source height.
- uintX *dest, // ->dest pixels.
- const int dline_pixels // Pixels (words)/line for dest.
- ) {
-
- uintS *srcPtr = source + (srcx + srcy * sline_pixels);
- uintX *dstPtr = dest;
-
- if (srcx + srcw >= sline_pixels) {
- srcw = sline_pixels - srcx;
- }
-
- int ybeforelast1 = sheight - 1 - srcy;
- int ybeforelast2 = sheight - 2 - srcy;
- int xbeforelast1 = sline_pixels - 1 - srcx;
- int xbeforelast2 = sline_pixels - 2 - srcx;
-
- for (int y = 0; y < srch; y++) {
- uintS *bP = srcPtr;
- uintX *dP = dstPtr;
-
- for (int x = 0; x < srcw; x++) {
- uintS color4, color5, color6;
- uintS color1, color2, color3;
- uintS colorA0, colorA1, colorA2, colorA3,
- colorB0, colorB1, colorB2, colorB3,
- colorS1, colorS2;
- uintX product1a, product1b,
- product2a, product2b;
-
- //--------------------------------------- B0 B1 B2 B3
- // 4 5 6 S2
- // 1 2 3 S1
- // A0 A1 A2 A3
- //--------------------------------------
- int add1, add2;
- int sub1;
- int nextl1, nextl2;
- int prevl1;
-
- if ((x + srcx) == 0)
- sub1 = 0;
- else
- sub1 = 1;
-
- if (x >= xbeforelast2)
- add2 = 0;
- else add2 = 1;
-
- if (x >= xbeforelast1)
- add1 = 0;
- else add1 = 1;
-
- if ((y + srcy) == 0)
- prevl1 = 0;
- else
- prevl1 = sline_pixels;
-
- if (y >= ybeforelast2)
- nextl2 = 0;
- else nextl2 = sline_pixels;
-
- if (y >= ybeforelast1)
- nextl1 = 0;
- else nextl1 = sline_pixels;
-
-
- colorB0 = *(bP - prevl1 - sub1);
- colorB1 = *(bP - prevl1);
- colorB2 = *(bP - prevl1 + add1);
- colorB3 = *(bP - prevl1 + add1 + add2);
-
- color4 = *(bP - sub1);
- color5 = *(bP);
- color6 = *(bP + add1);
- colorS2 = *(bP + add1 + add2);
-
- color1 = *(bP + nextl1 - sub1);
- color2 = *(bP + nextl1);
- color3 = *(bP + nextl1 + add1);
- colorS1 = *(bP + nextl1 + add1 + add2);
-
- colorA0 = *(bP + nextl1 + nextl2 - sub1);
- colorA1 = *(bP + nextl1 + nextl2);
- colorA2 = *(bP + nextl1 + nextl2 + add1);
- colorA3 = *(bP + nextl1 + nextl2 + add1 + add2);
-
-
- if (color2 == color6 && color5 != color3) {
- //product1b = product2a = color2;
- product1b = product2a = Manip::copy(color2);
-
-
- if ((color1 == color2) || (color6 == colorB2)) {
- //product1a = INTERPOLATE (color2, color5);
- //product1a = INTERPOLATE (color2, product1a);
- product1a = QInterpolate_2xSaI(color2, color2, color2, color5);
-
- } else {
- //product1a = INTERPOLATE (color5, color6);
- product1a = Interpolate_2xSaI(color6, color5);
- }
-
- if ((color6 == colorS2) || (color2 == colorA1)) {
- //product2b = INTERPOLATE (color2, color3);
- //product2b = INTERPOLATE (color2, product2b);
- product2b = QInterpolate_2xSaI(color2, color2, color2, color3);
-
- } else {
- //product2b = INTERPOLATE (color2, color3);
- product2b = Interpolate_2xSaI(color2, color3);
- }
- } else if (color5 == color3 && color2 != color6) {
- //product2b = product1a = color5;
- product2b = product1a = Manip::copy(color5);
-
-
- if ((colorB1 == color5) || (color3 == colorS1)) {
- //product1b = INTERPOLATE (color5, color6);
- //product1b = INTERPOLATE (color5, product1b);
- product1b = QInterpolate_2xSaI(color5, color5, color5, color6);
- } else {
- //product1b = INTERPOLATE (color5, color6);
- product1b = Interpolate_2xSaI(color5, color6);
- }
-
- if ((color3 == colorA2) || (color4 == color5)) {
- //product2a = INTERPOLATE (color5, color2);
- //product2a = INTERPOLATE (color5, product2a);
- product2a = QInterpolate_2xSaI(color2, color5, color5, color5);
- } else {
- //product2a = INTERPOLATE (color2, color3);
- product2a = Interpolate_2xSaI(color3, color2);
- }
-
- } else if (color5 == color3 && color2 == color6) {
- register int r = 0;
-
- //r += GetResult (color6, color5, color1, colorA1);
- //r += GetResult (color6, color5, color4, colorB1);
- //r += GetResult (color6, color5, colorA2, colorS1);
- //r += GetResult (color6, color5, colorB2, colorS2);
- r += GetResult1(color5, color6, color4, colorB1);
- r += GetResult2(color6, color5, colorA2, colorS1);
- r += GetResult2(color6, color5, color1, colorA1);
- r += GetResult1(color5, color6, colorB2, colorS2);
-
- if (r > 0) {
- //product1b = product2a = color2;
- product1b = product2a = Manip::copy(color2);
- //product1a = product2b = INTERPOLATE (color5, color6);
- product1a = product2b = Interpolate_2xSaI(color5, color6);
- } else if (r < 0) {
- //product2b = product1a = color5;
- product2b = product1a = Manip::copy(color5);
- //product1b = product2a = INTERPOLATE (color5, color6);
- product1b = product2a = Interpolate_2xSaI(color5, color6);
- } else {
- //product2b = product1a = color5;
- product2b = product1a = Manip::copy(color5);
- //product1b = product2a = color2;
- product1b = product2a = Manip::copy(color2);
- }
- } else {
- //product2b = product1a = INTERPOLATE (color2, color6);
- //product2b = Q_INTERPOLATE (color3, color3, color3, product2b);
- //product1a = Q_INTERPOLATE (color5, color5, color5, product1a);
- product2b = OInterpolate_2xSaI(color3, color2, color6);
- product1a = OInterpolate_2xSaI(color5, color6, color2);
-
- //product2a = product1b = INTERPOLATE (color5, color3);
- //product2a = Q_INTERPOLATE (color2, color2, color2, product2a);
- //product1b = Q_INTERPOLATE (color6, color6, color6, product1b);
- product2a = OInterpolate_2xSaI(color2, color5, color3);
- product1b = OInterpolate_2xSaI(color6, color5, color3);
- }
-
- *dP = product1a;
- *(dP + 1) = product1b;
- *(dP + dline_pixels) = product2a;
- *(dP + dline_pixels + 1) = product2b;
-
- bP += 1;
- dP += 2;
-
- }
- srcPtr += sline_pixels;
- dstPtr += 2 * dline_pixels;
- }
-
- }
-
- static bool Scale2xSaI(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
- uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src) {
- if (sw * 2 != dw || sh * 2 != dh) return false;
-
- if (clamp_src) {
- Scale_2xSaI(reinterpret_cast<uintS *>(tex->buffer) + sx + sy * tex->width,
- 0, 0, sw, sh, tex->width, sh,
- reinterpret_cast<uintX *>(pixel), pitch / sizeof(uintX));
- } else {
- Scale_2xSaI(reinterpret_cast<uintS *>(tex->buffer),
- sx, sy, sw, sh, tex->width, tex->height,
- reinterpret_cast<uintX *>(pixel), pitch / sizeof(uintX));
- }
- return true;
- }
-
- static bool ScaleSuper2xSaI(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
- uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src) {
- if (sw * 2 != dw || sh * 2 != dh) return false;
-
- if (clamp_src) {
- Scale_Super2xSaI(reinterpret_cast<uintS *>(tex->buffer) + sx + sy * tex->width,
- 0, 0, sw, sh, tex->width, sh,
- reinterpret_cast<uintX *>(pixel), pitch / sizeof(uintX));
- } else {
- Scale_Super2xSaI(reinterpret_cast<uintS *>(tex->buffer),
- sx, sy, sw, sh, tex->width, tex->height,
- reinterpret_cast<uintX *>(pixel), pitch / sizeof(uintX));
- }
- return true;
- }
-
- static bool ScaleSuperEagle(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
- uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src) {
- if (sw * 2 != dw || sh * 2 != dh) return false;
-
- if (clamp_src) {
- Scale_SuperEagle(reinterpret_cast<uintS *>(tex->buffer) + sx + sy * tex->width,
- 0, 0, sw, sh, tex->width, sh,
- reinterpret_cast<uintX *>(pixel), pitch / sizeof(uintX));
- } else {
- Scale_SuperEagle(reinterpret_cast<uintS *>(tex->buffer),
- sx, sy, sw, sh, tex->width, tex->height,
- reinterpret_cast<uintX *>(pixel), pitch / sizeof(uintX));
- }
- return true;
- }
-
-}; // Class
-
-//
-// 2xSaI
-//
-_2xSaIScaler::_2xSaIScaler() : Scaler() {
- Scale16Nat = _2xSaIScalerInternal<uint16, Manip_Nat2Nat_16, uint16>::Scale2xSaI;
- Scale16Sta = _2xSaIScalerInternal<uint16, Manip_Sta2Nat_16, uint32>::Scale2xSaI;
-
- Scale32Nat = _2xSaIScalerInternal<uint32, Manip_Nat2Nat_32, uint32>::Scale2xSaI;
- Scale32Sta = _2xSaIScalerInternal<uint32, Manip_Sta2Nat_32, uint32>::Scale2xSaI;
- Scale32_A888 = _2xSaIScalerInternal<uint32, Manip_32_A888, uint32>::Scale2xSaI;
- Scale32_888A = _2xSaIScalerInternal<uint32, Manip_32_888A, uint32>::Scale2xSaI;
-}
-
-uint32 _2xSaIScaler::ScaleBits() const {
- return 1 << 2;
-}
-bool _2xSaIScaler::ScaleArbitrary() const {
- return false;
-}
-
-const char *_2xSaIScaler::ScalerName() const {
- return "2xSaI";
-}
-const char *_2xSaIScaler::ScalerDesc() const {
- return "2xSaI Scaling Filter";
-}
-const char *_2xSaIScaler::ScalerCopyright() const {
- return "Copyright (c) 1999-2001 Derek Liauw Kie Fa";
-}
-
-const _2xSaIScaler _2xSaI_scaler;
-
-//
-// Super2xSaI
-//
-Super2xSaIScaler::Super2xSaIScaler() : Scaler() {
- Scale16Nat = _2xSaIScalerInternal<uint16, Manip_Nat2Nat_16, uint16>::ScaleSuper2xSaI;
- Scale16Sta = _2xSaIScalerInternal<uint16, Manip_Sta2Nat_16, uint32>::ScaleSuper2xSaI;
-
- Scale32Nat = _2xSaIScalerInternal<uint32, Manip_Nat2Nat_32, uint32>::ScaleSuper2xSaI;
- Scale32Sta = _2xSaIScalerInternal<uint32, Manip_Sta2Nat_32, uint32>::ScaleSuper2xSaI;
- Scale32_A888 = _2xSaIScalerInternal<uint32, Manip_32_A888, uint32>::ScaleSuper2xSaI;
- Scale32_888A = _2xSaIScalerInternal<uint32, Manip_32_888A, uint32>::ScaleSuper2xSaI;
-}
-
-uint32 Super2xSaIScaler::ScaleBits() const {
- return 1 << 2;
-}
-bool Super2xSaIScaler::ScaleArbitrary() const {
- return false;
-}
-
-const char *Super2xSaIScaler::ScalerName() const {
- return "Super2xSaI";
-}
-const char *Super2xSaIScaler::ScalerDesc() const {
- return "Super2xSaI Scaling Filter";
-}
-const char *Super2xSaIScaler::ScalerCopyright() const {
- return "Copyright (c) 1999-2001 Derek Liauw Kie Fa";
-}
-
-const Super2xSaIScaler Super2xSaI_scaler;
-
-//
-// SuperEagle
-//
-SuperEagleScaler::SuperEagleScaler() : Scaler() {
- Scale16Nat = _2xSaIScalerInternal<uint16, Manip_Nat2Nat_16, uint16>::ScaleSuperEagle;
- Scale16Sta = _2xSaIScalerInternal<uint16, Manip_Sta2Nat_16, uint32>::ScaleSuperEagle;
-
- Scale32Nat = _2xSaIScalerInternal<uint32, Manip_Nat2Nat_32, uint32>::ScaleSuperEagle;
- Scale32Sta = _2xSaIScalerInternal<uint32, Manip_Sta2Nat_32, uint32>::ScaleSuperEagle;
- Scale32_A888 = _2xSaIScalerInternal<uint32, Manip_32_A888, uint32>::ScaleSuperEagle;
- Scale32_888A = _2xSaIScalerInternal<uint32, Manip_32_888A, uint32>::ScaleSuperEagle;
-}
-
-uint32 SuperEagleScaler::ScaleBits() const {
- return 1 << 2;
-}
-bool SuperEagleScaler::ScaleArbitrary() const {
- return false;
-}
-
-const char *SuperEagleScaler::ScalerName() const {
- return "SuperEagle";
-}
-const char *SuperEagleScaler::ScalerDesc() const {
- return "SuperEagle Scaling Filter";
-}
-const char *SuperEagleScaler::ScalerCopyright() const {
- return "Copyright (c) 1999-2001 Derek Liauw Kie Fa";
-}
-
-const SuperEagleScaler SuperEagle_scaler;
-
-
-#ifdef COMPILE_GAMMA_CORRECT_SCALERS
-
-//
-// Gamma Corrected 2xSaI
-//
-
-GC_2xSaIScaler::GC_2xSaIScaler() : Scaler() {
- Scale16Nat = _2xSaIScalerInternal<uint16, Manip_Nat2Nat_16_GC, uint16>::Scale2xSaI;
- Scale16Sta = _2xSaIScalerInternal<uint16, Manip_Sta2Nat_16_GC, uint32>::Scale2xSaI;
-
- Scale32Nat = _2xSaIScalerInternal<uint32, Manip_Nat2Nat_32_GC, uint32>::Scale2xSaI;
- Scale32Sta = _2xSaIScalerInternal<uint32, Manip_Sta2Nat_32_GC, uint32>::Scale2xSaI;
- Scale32_A888 = _2xSaIScalerInternal<uint32, Manip_32_A888_GC, uint32>::Scale2xSaI;
- Scale32_888A = _2xSaIScalerInternal<uint32, Manip_32_888A_GC, uint32>::Scale2xSaI;
-
-}
-
-uint32 GC_2xSaIScaler::ScaleBits() const {
- return 1 << 2;
-}
-bool GC_2xSaIScaler::ScaleArbitrary() const {
- return false;
-}
-
-const char *GC_2xSaIScaler::ScalerName() const {
- return "GC-2xSaI";
-}
-const char *GC_2xSaIScaler::ScalerDesc() const {
- return "Gamma 2.2 Correct 2xSaI Scaling Filter";
-}
-const char *GC_2xSaIScaler::ScalerCopyright() const {
- return "Copyright (c) 1999-2001 Derek Liauw Kie Fa";
-}
-
-const GC_2xSaIScaler GC_2xSaI_scaler;
-
-
-//
-// Gamma Corrected Super2xSaI
-//
-
-GC_Super2xSaIScaler::GC_Super2xSaIScaler() : Scaler() {
- Scale16Nat = _2xSaIScalerInternal<uint16, Manip_Nat2Nat_16_GC, uint16>::ScaleSuper2xSaI;
- Scale16Sta = _2xSaIScalerInternal<uint16, Manip_Sta2Nat_16_GC, uint32>::ScaleSuper2xSaI;
-
- Scale32Nat = _2xSaIScalerInternal<uint32, Manip_Nat2Nat_32_GC, uint32>::ScaleSuper2xSaI;
- Scale32Sta = _2xSaIScalerInternal<uint32, Manip_Sta2Nat_32_GC, uint32>::ScaleSuper2xSaI;
- Scale32_A888 = _2xSaIScalerInternal<uint32, Manip_32_A888_GC, uint32>::ScaleSuper2xSaI;
- Scale32_888A = _2xSaIScalerInternal<uint32, Manip_32_888A_GC, uint32>::ScaleSuper2xSaI;
-
-}
-
-uint32 GC_Super2xSaIScaler::ScaleBits() const {
- return 1 << 2;
-}
-bool GC_Super2xSaIScaler::ScaleArbitrary() const {
- return false;
-}
-
-const char *GC_Super2xSaIScaler::ScalerName() const {
- return "GC-Super2xSaI";
-}
-const char *GC_Super2xSaIScaler::ScalerDesc() const {
- return "Gamma 2.2 Correct Super2xSaI Scaling Filter";
-}
-const char *GC_Super2xSaIScaler::ScalerCopyright() const {
- return "Copyright (c) 1999-2001 Derek Liauw Kie Fa";
-}
-
-const GC_Super2xSaIScaler GC_Super2xSaI_scaler;
-
-
-//
-// Gamma Corrected SuperEagle
-//
-GC_SuperEagleScaler::GC_SuperEagleScaler() : Scaler() {
- Scale16Nat = _2xSaIScalerInternal<uint16, Manip_Nat2Nat_16_GC, uint16>::ScaleSuperEagle;
- Scale16Sta = _2xSaIScalerInternal<uint16, Manip_Sta2Nat_16_GC, uint32>::ScaleSuperEagle;
-
- Scale32Nat = _2xSaIScalerInternal<uint32, Manip_Nat2Nat_32_GC, uint32>::ScaleSuperEagle;
- Scale32Sta = _2xSaIScalerInternal<uint32, Manip_Sta2Nat_32_GC, uint32>::ScaleSuperEagle;
- Scale32_A888 = _2xSaIScalerInternal<uint32, Manip_32_A888_GC, uint32>::ScaleSuperEagle;
- Scale32_888A = _2xSaIScalerInternal<uint32, Manip_32_888A_GC, uint32>::ScaleSuperEagle;
-}
-
-uint32 GC_SuperEagleScaler::ScaleBits() const {
- return 1 << 2;
-}
-bool GC_SuperEagleScaler::ScaleArbitrary() const {
- return false;
-}
-
-const char *GC_SuperEagleScaler::ScalerName() const {
- return "GC-SuperEagle";
-}
-const char *GC_SuperEagleScaler::ScalerDesc() const {
- return "Gamma 2.2 Correct SuperEagle Scaling Filter";
-}
-const char *GC_SuperEagleScaler::ScalerCopyright() const {
- return "Copyright (c) 1999-2001 Derek Liauw Kie Fa";
-}
-
-const GC_SuperEagleScaler GC_SuperEagle_scaler;
-
-#endif
-
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler.cpp b/engines/ultima/ultima8/graphics/scalers/bilinear_scaler.cpp
deleted file mode 100644
index f1e19f6..0000000
--- a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-#include "ultima/ultima8/graphics/scalers/bilinear_scaler.h"
-#include "ultima/ultima8/graphics/scalers/bilinear_scaler_internal.h"
-#include "ultima/ultima8/graphics/manips.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-
-template<class uintX, class Manip, class uintS> class BilinearScalerInternal {
-public:
- static bool ScaleBilinear(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
- uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src) {
- // Must be multiples of 4!!!
- if ((sh & 3) || (sw & 3)) return false;
-
- // 2x Scaling
- if ((sw * 2 == dw) && (sh * 2 == dh))
- return BilinearScalerInternal_2x<uintX, Manip, uintS>(tex, sx, sy, sw, sh, pixel, dw, dh, pitch, clamp_src);
- // 2 X 2.4 Y
- else if ((sw * 2 == dw) && (dh * 5 == sh * 12))
- return BilinearScalerInternal_X2Y24<uintX, Manip, uintS>(tex, sx, sy, sw, sh, pixel, dw, dh, pitch, clamp_src);
- // 1 X 1.2 Y
- else if ((sw == dw) && (dh * 5 == sh * 6))
- return BilinearScalerInternal_X1Y12<uintX, Manip, uintS>(tex, sx, sy, sw, sh, pixel, dw, dh, pitch, clamp_src);
- // Arbitrary
- else
- return BilinearScalerInternal_Arb<uintX, Manip, uintS>(tex, sx, sy, sw, sh, pixel, dw, dh, pitch, clamp_src);
- }
-};
-
-
-BilinearScaler::BilinearScaler() : Scaler() {
-#ifdef COMPILE_ALL_BILINEAR_SCALERS
- Scale16Nat = BilinearScalerInternal<uint16, Manip_Nat2Nat_16, uint16>::ScaleBilinear;
- Scale16Sta = BilinearScalerInternal<uint16, Manip_Sta2Nat_16, uint32>::ScaleBilinear;
-
- Scale32Nat = BilinearScalerInternal<uint32, Manip_Nat2Nat_32, uint32>::ScaleBilinear;
- Scale32Sta = BilinearScalerInternal<uint32, Manip_Sta2Nat_32, uint32>::ScaleBilinear;
- Scale32_A888 = BilinearScalerInternal<uint32, Manip_32_A888, uint32>::ScaleBilinear;
- Scale32_888A = BilinearScalerInternal<uint32, Manip_32_888A, uint32>::ScaleBilinear;
-#else
- Scale16Nat = 0;
- Scale16Sta = 0;
-
- Scale32Nat = BilinearScalerInternal<uint32, Manip_Nat2Nat_32, uint32>::ScaleBilinear;
- Scale32Sta = BilinearScalerInternal<uint32, Manip_Sta2Nat_32, uint32>::ScaleBilinear;
- Scale32_A888 = Scale32Nat;
- Scale32_888A = Scale32Nat;
-#endif
-}
-
-uint32 BilinearScaler::ScaleBits() const {
- return 0xFFFFFFFF;
-}
-bool BilinearScaler::ScaleArbitrary() const {
- return true;
-}
-
-const char *BilinearScaler::ScalerName() const {
- return "bilinear";
-}
-const char *BilinearScaler::ScalerDesc() const {
- return "Bilinear Filtering Scaler";
-}
-const char *BilinearScaler::ScalerCopyright() const {
- return "Copyright (C) 2005 The Pentagram Team";
-}
-
-const BilinearScaler bilinear_scaler;
-
-#ifdef COMPILE_GAMMA_CORRECT_SCALERS
-GC_BilinearScaler::GC_BilinearScaler() : Scaler() {
-#ifdef COMPILE_ALL_BILINEAR_SCALERS
- Scale16Nat = BilinearScalerInternal<uint16, Manip_Nat2Nat_16_GC, uint16>::ScaleBilinear;
- Scale16Sta = BilinearScalerInternal<uint16, Manip_Sta2Nat_16_GC, uint32>::ScaleBilinear;
-
- Scale32Nat = BilinearScalerInternal<uint32, Manip_Nat2Nat_32_GC, uint32>::ScaleBilinear;
- Scale32Sta = BilinearScalerInternal<uint32, Manip_Sta2Nat_32_GC, uint32>::ScaleBilinear;
- Scale32_A888 = BilinearScalerInternal<uint32, Manip_32_A888_GC, uint32>::ScaleBilinear;
- Scale32_888A = BilinearScalerInternal<uint32, Manip_32_888A_GC, uint32>::ScaleBilinear;
-#else
- Scale16Nat = 0;
- Scale16Sta = 0;
-
- Scale32Nat = BilinearScalerInternal<uint32, Manip_Nat2Nat_32_GC, uint32>::ScaleBilinear;
- Scale32Sta = BilinearScalerInternal<uint32, Manip_Sta2Nat_32_GC, uint32>::ScaleBilinear;
- Scale32_A888 = Scale32Nat;
- Scale32_888A = Scale32Nat;
-#endif
-}
-
-uint32 GC_BilinearScaler::ScaleBits() const {
- return 0xFFFFFFFF;
-}
-bool GC_BilinearScaler::ScaleArbitrary() const {
- return true;
-}
-
-const char *GC_BilinearScaler::ScalerName() const {
- return "gc-bilinear";
-}
-const char *GC_BilinearScaler::ScalerDesc() const {
- return "Gamma 2.2 Correct Bilinear Filtering Scaler";
-}
-const char *GC_BilinearScaler::ScalerCopyright() const {
- return "Copyright (C) 2005 The Pentagram Team";
-}
-
-const GC_BilinearScaler GC_bilinear_scaler;
-#endif
-
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler.h b/engines/ultima/ultima8/graphics/scalers/bilinear_scaler.h
deleted file mode 100644
index f4a16e2..0000000
--- a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef ULTIMA8_GRAPHICS_SCALERS_BILINEARSCALER_H
-#define ULTIMA8_GRAPHICS_SCALERS_BILINEARSCALER_H
-
-#include "ultima/ultima8/graphics/scaler.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-
-class BilinearScaler : public Scaler {
-public:
- BilinearScaler();
-
- virtual uint32 ScaleBits() const; //< bits for supported integer scaling
- virtual bool ScaleArbitrary() const; //< supports arbitrary scaling of any degree
-
- virtual const char *ScalerName() const; //< Name Of the Scaler (1 word)
- virtual const char *ScalerDesc() const; //< Desciption of the Scaler
- virtual const char *ScalerCopyright() const; //< Scaler Copyright info
-};
-
-extern const BilinearScaler bilinear_scaler;
-
-#ifdef COMPILE_GAMMA_CORRECT_SCALERS
-
-class GC_BilinearScaler : public Scaler {
-public:
- GC_BilinearScaler();
-
- virtual const uint32 ScaleBits() const; //< bits for supported integer scaling
- virtual const bool ScaleArbitrary() const; //< supports arbitrary scaling of any degree
-
- virtual const char *ScalerName() const; //< Name Of the Scaler (1 word)
- virtual const char *ScalerDesc() const; //< Desciption of the Scaler
- virtual const char *ScalerCopyright() const; //< Scaler Copyright info
-};
-
-extern const GC_BilinearScaler GC_bilinear_scaler;
-#endif
-
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal.h b/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal.h
deleted file mode 100644
index a5c57a4..0000000
--- a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal.h
+++ /dev/null
@@ -1,214 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/graphics/scalers/bilinear_scaler.h"
-#include "ultima/ultima8/graphics/manips.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-
-#define SimpleLerp(a,b,fac) ((b<<8)+((a)-(b))*(fac))
-#define SimpleLerp2(a,b,fac) ((b<<16)+((a)-(b))*(fac))
-
-#define CopyLerp(d,a,b,f) { \
- (d)[0] = SimpleLerp2(b[0],a[0],f)>>16;\
- (d)[1] = SimpleLerp2(b[1],a[1],f)>>16;\
- (d)[2] = SimpleLerp2(b[2],a[2],f)>>16;\
- (d)[3] = SimpleLerp2(b[3],a[3],f)>>16;}
-
-#define FilterPixel(a,b,f,g,fx,fy) { \
- *reinterpret_cast<uintX*>(pixel) = Manip::merge( \
- SimpleLerp(SimpleLerp(a[0],f[0],fx),SimpleLerp(b[0],g[0],fx),fy)>>16,\
- SimpleLerp(SimpleLerp(a[1],f[1],fx),SimpleLerp(b[1],g[1],fx),fy)>>16,\
- SimpleLerp(SimpleLerp(a[2],f[2],fx),SimpleLerp(b[2],g[2],fx),fy)>>16,\
- SimpleLerp(SimpleLerp(a[3],f[3],fx),SimpleLerp(b[3],g[3],fx),fy)>>16);}
-
-#define ScalePixel2x(a,b,f,g) { \
- *(reinterpret_cast<uintX*>(pixel)) = Manip::merge(a[0], a[1], a[2], a[3]); \
- *(reinterpret_cast<uintX*>(pixel+sizeof(uintX))) = Manip::merge((a[0]+f[0])>>1, (a[1]+f[1])>>1, (a[2]+f[2])>>1, (a[3]+f[3])>>1); \
- pixel+=pitch; \
- *(reinterpret_cast<uintX*>(pixel)) = Manip::merge((a[0]+b[0])>>1, (a[1]+b[1])>>1, (a[2]+b[2])>>1, (a[3]+b[3])>>1);\
- *(reinterpret_cast<uintX*>(pixel+sizeof(uintX))) = Manip::merge((a[0]+b[0]+f[0]+g[0])>>2, (a[1]+b[1]+f[1]+g[1])>>2, (a[2]+b[2]+f[2]+g[2])>>2, (a[3]+b[3]+f[3]+g[3])>>2);\
- pixel+=pitch; } \
-
-#define X2Xy24xLerps(c0,c1,y) \
- *(reinterpret_cast<uintX*>(pixel)) = Manip::merge( \
- cols[c0][y][0], cols[c0][y][1], cols[c0][y][2], cols[c0][y][3]); \
- *(reinterpret_cast<uintX*>(pixel+sizeof(uintX))) = Manip::merge( \
- (cols[c0][y][0]+cols[c1][y][0])>>1, \
- (cols[c0][y][1]+cols[c1][y][1])>>1, \
- (cols[c0][y][2]+cols[c1][y][2])>>1, \
- (cols[c0][y][3]+cols[c1][y][3])>>1);
-
-#define X2xY24xInnerLoop(c0,c1) { \
- X2Xy24xLerps(c0,c1,0); pixel+=pitch; \
- X2Xy24xLerps(c0,c1,1); pixel+=pitch; \
- X2Xy24xLerps(c0,c1,2); pixel+=pitch; \
- X2Xy24xLerps(c0,c1,3); pixel+=pitch; \
- X2Xy24xLerps(c0,c1,4); pixel+=pitch; \
- X2Xy24xLerps(c0,c1,5); pixel+=pitch; \
- X2Xy24xLerps(c0,c1,6); pixel+=pitch; \
- X2Xy24xLerps(c0,c1,7); pixel+=pitch; \
- X2Xy24xLerps(c0,c1,8); pixel+=pitch; \
- X2Xy24xLerps(c0,c1,9); pixel+=pitch; \
- X2Xy24xLerps(c0,c1,10); pixel+=pitch; \
- X2Xy24xLerps(c0,c1,11); pixel+=pitch; }
-
-#define X2xY24xDoColsA() { \
- CopyLerp(cols[0][0],a,b, 0x0000); \
- CopyLerp(cols[0][1],a,b, 0x6AAA); \
- CopyLerp(cols[0][2],a,b, 0xD554); \
- CopyLerp(cols[0][3],b,c, 0x3FFE); \
- CopyLerp(cols[0][4],b,c, 0xAAA8); \
- CopyLerp(cols[0][5],c,d, 0x1552); \
- CopyLerp(cols[0][6],c,d, 0x7FFC); \
- CopyLerp(cols[0][7],c,d, 0xEAA6); \
- CopyLerp(cols[0][8],d,e, 0x5550); \
- CopyLerp(cols[0][9],d,e, 0xBFFA); \
- CopyLerp(cols[0][10],e,l, 0x2AA4); \
- CopyLerp(cols[0][11],e,l, 0x954E); }
-
-#define X2xY24xDoColsB() { \
- CopyLerp(cols[1][0],f,g, 0x0000); \
- CopyLerp(cols[1][1],f,g, 0x6AAA); \
- CopyLerp(cols[1][2],f,g, 0xD554); \
- CopyLerp(cols[1][3],g,h, 0x3FFE); \
- CopyLerp(cols[1][4],g,h, 0xAAA8); \
- CopyLerp(cols[1][5],h,i, 0x1552); \
- CopyLerp(cols[1][6],h,i, 0x7FFC); \
- CopyLerp(cols[1][7],h,i, 0xEAA6); \
- CopyLerp(cols[1][8],i,j, 0x5550); \
- CopyLerp(cols[1][9],i,j, 0xBFFA); \
- CopyLerp(cols[1][10],j,k, 0x2AA4); \
- CopyLerp(cols[1][11],j,k, 0x954E); }
-
-#define X1xY12xCopy(y) \
- *(reinterpret_cast<uintX*>(pixel)) = Manip::merge( \
- cols[y][0], cols[y][1], cols[y][2], cols[y][3]);
-
-#define X1xY12xInnerLoop() { \
- X1xY12xCopy(0); pixel+=pitch; \
- X1xY12xCopy(1); pixel+=pitch; \
- X1xY12xCopy(2); pixel+=pitch; \
- X1xY12xCopy(3); pixel+=pitch; \
- X1xY12xCopy(4); pixel+=pitch; \
- X1xY12xCopy(5); pixel+=pitch; }
-
-#define X1xY12xDoCols() { \
- CopyLerp(cols[0],a,b, 0x0000); \
- CopyLerp(cols[1],a,b, 0xD554); \
- CopyLerp(cols[2],b,c, 0xAAA8); \
- CopyLerp(cols[3],c,d, 0x7FFC); \
- CopyLerp(cols[4],d,e, 0x5550); \
- CopyLerp(cols[5],e,l, 0x2AA4); }
-
-#define ArbInnerLoop(a,b,f,g) { \
- if (pos_y < end_y) do { \
- pos_x = dst_x; \
- pixel = blockline_start; \
- /* Dest Loop X */ \
- if (pos_x < end_x) do { \
- FilterPixel(a,b,f,g,(end_x-pos_x)>>8,(end_y-pos_y)>>8);\
- pixel+=sizeof(uintX); \
- pos_x += add_x; \
- } while (pos_x < end_x); \
- if (!next_block) next_block = pixel; \
- blockline_start += pitch; \
- pos_y += add_y; \
- } while (pos_y < end_y); \
- end_y += 1 << 16; }
-
-
-#define Read5(a,b,c,d,e) { \
- Manip::split(*(texel+tpitch*0), a[0], a[1], a[2], a[3]);\
- Manip::split(*(texel+tpitch*1), b[0], b[1], b[2], b[3]);\
- Manip::split(*(texel+tpitch*2), c[0], c[1], c[2], c[3]);\
- Manip::split(*(texel+tpitch*3), d[0], d[1], d[2], d[3]);\
- Manip::split(*(texel+tpitch*4), e[0], e[1], e[2], e[3]); }
-
-#define Read5_Clipped(a,b,c,d,e) { \
- Manip::split(*(texel+tpitch*0), a[0], a[1], a[2], a[3]);\
- Manip::split(*(texel+tpitch*1), b[0], b[1], b[2], b[3]);\
- Manip::split(*(texel+tpitch*2), c[0], c[1], c[2], c[3]);\
- Manip::split(*(texel+tpitch*3), d[0], d[1], d[2], d[3]);\
- e[0]=d[0]; e[1]=d[1], e[2]=d[2], e[3]=d[3]; }
-
-#define Read6(a,b,c,d,e,l) { \
- Manip::split(*(texel+tpitch*0), a[0], a[1], a[2], a[3]);\
- Manip::split(*(texel+tpitch*1), b[0], b[1], b[2], b[3]);\
- Manip::split(*(texel+tpitch*2), c[0], c[1], c[2], c[3]);\
- Manip::split(*(texel+tpitch*3), d[0], d[1], d[2], d[3]);\
- Manip::split(*(texel+tpitch*4), e[0], e[1], e[2], e[3]);\
- Manip::split(*(texel+tpitch*5), l[0], l[1], l[2], l[3]); }
-
-#define Read6_Clipped(a,b,c,d,e,l) { \
- Manip::split(*(texel+tpitch*0), a[0], a[1], a[2], a[3]);\
- Manip::split(*(texel+tpitch*1), b[0], b[1], b[2], b[3]);\
- Manip::split(*(texel+tpitch*2), c[0], c[1], c[2], c[3]);\
- Manip::split(*(texel+tpitch*3), d[0], d[1], d[2], d[3]);\
- Manip::split(*(texel+tpitch*4), e[0], e[1], e[2], e[3]);\
- l[0]=e[0]; l[1]=e[1]; l[2]=e[2]; l[3]=e[3]; }
-
-// Very very simple point scaler
- template<class uintX, class Manip, class uintS>
- bool BilinearScalerInternal_2x(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
- uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src);
-
- template<class uintX, class Manip, class uintS>
- bool BilinearScalerInternal_X2Y24(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
- uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src);
-
- template<class uintX, class Manip, class uintS>
- bool BilinearScalerInternal_X1Y12(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
- uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src);
-
- template<class uintX, class Manip, class uintS>
- bool BilinearScalerInternal_Arb(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
- uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src);
-
-#ifdef COMPILE_GAMMA_CORRECT_SCALERS
-#define InstantiateFunc(func,a,b,c) \
- template bool func<a,b,c> (Texture*,int32,int32,int32,int32,uint8*,int32,int32,int32,bool); \
- template bool func<a,b##_GC,c> (Texture*,int32,int32,int32,int32,uint8*,int32,int32,int32,bool)
-#else
-#define InstantiateFunc(func,a,b,c) \
- template bool func<a,b,c> (Texture*,int32,int32,int32,int32,uint8*,int32,int32,int32,bool)
-#endif
-
-#ifdef COMPILE_ALL_BILINEAR_SCALERS
-#define InstantiateBilinearScalerFunc(func) \
- InstantiateFunc(func,uint16,Manip_Nat2Nat_16,uint16); \
- InstantiateFunc(func,uint16,Manip_Sta2Nat_16,uint32); \
- InstantiateFunc(func,uint32,Manip_Nat2Nat_32,uint32); \
- InstantiateFunc(func,uint32,Manip_Sta2Nat_32,uint32); \
- InstantiateFunc(func,uint32,Manip_32_A888,uint32); \
- InstantiateFunc(func,uint32,Manip_32_888A,uint32)
-#else
-#define InstantiateBilinearScalerFunc(func) \
- InstantiateFunc(func,uint32,Manip_Nat2Nat_32,uint32); \
- InstantiateFunc(func,uint32,Manip_Sta2Nat_32,uint32)
-#endif
-
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_2x.cpp b/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_2x.cpp
deleted file mode 100644
index 3864cfd..0000000
--- a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_2x.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-#include "ultima/ultima8/graphics/scalers/bilinear_scaler_internal.h"
-#include "ultima/ultima8/graphics/manips.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-
-template<class uintX, class Manip, class uintS>
-bool BilinearScalerInternal_2x(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
- uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src) {
- // Source buffer pointers
- uintS *texel = reinterpret_cast<uintS *>(tex->buffer) + (sy * tex->width + sx);
- int tpitch = tex->width;
- uintS *tline_end = texel + (sw - 1);
- uintS *tex_end = texel + (sh - 4) * tex->width;
- int tex_diff = (tex->width * 4) - sw;
-
- uint8 a[4], b[4], c[4], d[4], e[4], f[4], g[4], h[4], i[4], j[4];
- int p_diff = (pitch * 8) - (dw * sizeof(uintX));
-
- bool clip_x = true;
- if (sw + sx < tex->width && clamp_src == false) {
- clip_x = false;
- tline_end = texel + (sw + 1);
- tex_diff--;
- }
-
- bool clip_y = true;
- if (sh + sy < tex->height && clamp_src == false) {
- clip_y = false;
- tex_end = texel + (sh) * tex->width;
- }
-
- // Src Loop Y
- do {
- Read5(a, b, c, d, e);
- texel++;
-
- // Src Loop X
- do {
- Read5(f, g, h, i, j);
- texel++;
-
- ScalePixel2x(a, b, f, g);
- ScalePixel2x(b, c, g, h);
- ScalePixel2x(c, d, h, i);
- ScalePixel2x(d, e, i, j);
-
- pixel -= pitch * 8;
- pixel += sizeof(uintX) * 2;
-
- Read5(a, b, c, d, e);
- texel++;
-
- ScalePixel2x(f, g, a, b);
- ScalePixel2x(g, h, b, c);
- ScalePixel2x(h, i, c, d);
- ScalePixel2x(i, j, d, e);
-
- pixel -= pitch * 8;
- pixel += sizeof(uintX) * 2;
-
- } while (texel != tline_end);
-
- // Final X (clipping)
- if (clip_x) {
- Read5(f, g, h, i, j);
- texel++;
-
- ScalePixel2x(a, b, f, g);
- ScalePixel2x(b, c, g, h);
- ScalePixel2x(c, d, h, i);
- ScalePixel2x(d, e, i, j);
-
- pixel -= pitch * 8;
- pixel += sizeof(uintX) * 2;
-
- ScalePixel2x(f, g, f, g);
- ScalePixel2x(g, h, g, h);
- ScalePixel2x(h, i, h, i);
- ScalePixel2x(i, j, i, j);
-
- pixel -= pitch * 8;
- pixel += sizeof(uintX) * 2;
- };
-
- pixel += p_diff;
-
- texel += tex_diff;
- tline_end += tpitch * 4;
- } while (texel != tex_end);
-
- //
- // Final Rows - Clipping
- //
-
- // Src Loop Y
- if (clip_y) {
- Read5_Clipped(a, b, c, d, e);
- texel++;
-
- // Src Loop X
- do {
- Read5_Clipped(f, g, h, i, j);
- texel++;
- ScalePixel2x(a, b, f, g);
- ScalePixel2x(b, c, g, h);
- ScalePixel2x(c, d, h, i);
- ScalePixel2x(d, e, i, j);
- pixel -= pitch * 8;
- pixel += sizeof(uintX) * 2;
-
- Read5_Clipped(a, b, c, d, e);
- texel++;
- ScalePixel2x(f, g, a, b);
- ScalePixel2x(g, h, b, c);
- ScalePixel2x(h, i, c, d);
- ScalePixel2x(i, j, d, e);
- pixel -= pitch * 8;
- pixel += sizeof(uintX) * 2;
- } while (texel != tline_end);
-
- // Final X (clipping)
- if (clip_x) {
- Read5_Clipped(f, g, h, i, j);
- texel++;
-
- ScalePixel2x(a, b, f, g);
- ScalePixel2x(b, c, g, h);
- ScalePixel2x(c, d, h, i);
- ScalePixel2x(d, e, i, j);
-
- pixel -= pitch * 8;
- pixel += sizeof(uintX) * 2;
-
- ScalePixel2x(f, g, f, g);
- ScalePixel2x(g, h, g, h);
- ScalePixel2x(h, i, h, i);
- ScalePixel2x(i, j, i, j);
-
- pixel -= pitch * 8;
- pixel += sizeof(uintX) * 2;
- };
-
- pixel += p_diff;
-
- texel += tex_diff;
- tline_end += tpitch * 4;
- }
-
- return true;
-}
-
-InstantiateBilinearScalerFunc(BilinearScalerInternal_2x);
-
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_arb.cpp b/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_arb.cpp
deleted file mode 100644
index 8a6adca..0000000
--- a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_arb.cpp
+++ /dev/null
@@ -1,254 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-#include "ultima/ultima8/graphics/scalers/bilinear_scaler_internal.h"
-#include "ultima/ultima8/graphics/manips.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-
-template<class uintX, class Manip, class uintS>
-bool BilinearScalerInternal_Arb(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
- uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src) {
- // Source buffer pointers
- uintS *texel = reinterpret_cast<uintS *>(tex->buffer) + (sy * tex->width + sx);
- int tpitch = tex->width;
- uintS *tline_end = texel + (sw - 1);
- uintS *tex_end = texel + (sh - 4) * tex->width;
- int tex_diff = (tex->width * 4) - sw;
-
- uint8 a[4], b[4], c[4], d[4], e[4], f[4], g[4], h[4], i[4], j[4];
-
- uint32 pos_y = 0, pos_x = 0;
-
- uint32 add_y = (sh << 16) / dh;
- uint32 add_x = (sw << 16) / dw;
-
- uint32 start_x = (sw << 16) - (add_x * dw);
- uint32 dst_y = (sh << 16) - (add_y * dh);
- uint32 end_y = 1 << 16;
-
- if (sw == dw * 2) start_x += 0x8000;
- if (sh == dh * 2) dst_y += 0x8000;
-
- uint8 *blockline_start = 0;
- uint8 *next_block = 0;
-
-// uint8* pixel_start = pixel;
-
- bool clip_x = true;
- if (sw + sx < tex->width && clamp_src == false) {
- clip_x = false;
- tline_end = texel + (sw + 1);
- tex_diff--;
- }
-
- bool clip_y = true;
- if (sh + sy < tex->height && clamp_src == false) {
- clip_y = false;
- tex_end = texel + (sh) * tex->width;
- }
-
- // Src Loop Y
- do {
- Read5(a, b, c, d, e);
- texel++;
-
- uint32 end_x = 1 << 16;
- uint32 dst_x = start_x;
-
- next_block = pixel;
-
- // Src Loop X
- do {
- pos_y = dst_y;
-
- Read5(f, g, h, i, j);
- texel++;
-
- blockline_start = next_block;
- next_block = 0;
-
- ArbInnerLoop(a, b, f, g);
- ArbInnerLoop(b, c, g, h);
- ArbInnerLoop(c, d, h, i);
- ArbInnerLoop(d, e, i, j);
-
- end_y -= 4 << 16;
- dst_x = pos_x;
- end_x += 1 << 16;
- pos_y = dst_y;
-
- Read5(a, b, c, d, e);
- texel++;
-
- blockline_start = next_block;
- next_block = 0;
-
- ArbInnerLoop(f, g, a, b);
- ArbInnerLoop(g, h, b, c);
- ArbInnerLoop(h, i, c, d);
- ArbInnerLoop(i, j, d, e);
-
- end_y -= 4 << 16;
- dst_x = pos_x;
- end_x += 1 << 16;
- } while (texel != tline_end);
-
- // Final X (clipping)
- if (clip_x) {
- pos_y = dst_y;
-
- Read5(f, g, h, i, j);
- texel++;
-
- blockline_start = next_block;
- next_block = 0;
-
- ArbInnerLoop(a, b, f, g);
- ArbInnerLoop(b, c, g, h);
- ArbInnerLoop(c, d, h, i);
- ArbInnerLoop(d, e, i, j);
-
- end_y -= 4 << 16;
- dst_x = pos_x;
- end_x += 1 << 16;
- pos_y = dst_y;
-
- blockline_start = next_block;
- next_block = 0;
-
- ArbInnerLoop(f, g, f, g);
- ArbInnerLoop(g, h, g, h);
- ArbInnerLoop(h, i, h, i);
- ArbInnerLoop(i, j, i, j);
-
- end_y -= 4 << 16;
- dst_x = pos_x;
- end_x += 1 << 16;
- };
-
- pixel += pitch - sizeof(uintX) * (dw);
-
- dst_y = pos_y;
- end_y += 4 << 16;
-
- texel += tex_diff;
- tline_end += tpitch * 4;
- } while (texel != tex_end);
-
-
- //
- // Final Rows - Clipping
- //
-
- // Src Loop Y
- if (clip_y) {
- Read5_Clipped(a, b, c, d, e);
- texel++;
-
- uint32 end_x = 1 << 16;
- uint32 dst_x = start_x;
-
- next_block = pixel;
-
- // Src Loop X
- do {
- pos_y = dst_y;
-
- Read5_Clipped(f, g, h, i, j);
- texel++;
-
- blockline_start = next_block;
- next_block = 0;
-
- ArbInnerLoop(a, b, f, g);
- ArbInnerLoop(b, c, g, h);
- ArbInnerLoop(c, d, h, i);
- ArbInnerLoop(d, e, i, j);
-
- end_y -= 4 << 16;
- dst_x = pos_x;
- end_x += 1 << 16;
- pos_y = dst_y;
-
- Read5_Clipped(a, b, c, d, e);
- texel++;
-
- blockline_start = next_block;
- next_block = 0;
-
- ArbInnerLoop(f, g, a, b);
- ArbInnerLoop(g, h, b, c);
- ArbInnerLoop(h, i, c, d);
- ArbInnerLoop(i, j, d, e);
-
- end_y -= 4 << 16;
- dst_x = pos_x;
- end_x += 1 << 16;
- } while (texel != tline_end);
-
- // Final X (clipping)
- if (clip_x) {
- pos_y = dst_y;
-
- Read5_Clipped(f, g, h, i, j);
- texel++;
-
- blockline_start = next_block;
- next_block = 0;
-
- ArbInnerLoop(a, b, f, g);
- ArbInnerLoop(b, c, g, h);
- ArbInnerLoop(c, d, h, i);
- ArbInnerLoop(d, e, i, j);
-
- end_y -= 4 << 16;
- dst_x = pos_x;
- end_x += 1 << 16;
- pos_y = dst_y;
-
- blockline_start = next_block;
- next_block = 0;
-
- ArbInnerLoop(f, g, f, g);
- ArbInnerLoop(g, h, g, h);
- ArbInnerLoop(h, i, h, i);
- ArbInnerLoop(i, j, i, j);
-
- end_y -= 4 << 16;
- dst_x = pos_x;
- end_x += 1 << 16;
- };
- }
-
-
- return true;
-}
-
-InstantiateBilinearScalerFunc(BilinearScalerInternal_Arb);
-
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_x1y12.cpp b/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_x1y12.cpp
deleted file mode 100644
index 03f19af..0000000
--- a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_x1y12.cpp
+++ /dev/null
@@ -1,95 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-#include "ultima/ultima8/graphics/scalers/bilinear_scaler_internal.h"
-#include "ultima/ultima8/graphics/manips.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-
-template<class uintX, class Manip, class uintS>
-bool BilinearScalerInternal_X1Y12(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
- uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src) {
- // Source buffer pointers
- uintS *texel = reinterpret_cast<uintS *>(tex->buffer) + (sy * tex->width + sx);
- int tpitch = tex->width;
- uintS *tline_end = texel + (sw);
- uintS *tex_end = texel + (sh - 5) * tex->width;
- int tex_diff = (tex->width * 5) - sw;
-
- uint8 a[4], b[4], c[4], d[4], e[4], l[4];
- uint8 cols[6][4];
-
- bool clip_y = true;
- if (sh + sy < tex->height && clamp_src == false) {
- clip_y = false;
- tex_end = texel + (sh) * tex->width;
- }
-
- // Src Loop Y
- do {
- // Src Loop X
- do {
- Read6(a, b, c, d, e, l);
- texel++;
-
- X1xY12xDoCols();
- X1xY12xInnerLoop();
- pixel -= pitch * 6 - sizeof(uintX);
-
- } while (texel != tline_end);
-
- pixel += pitch * 6 - sizeof(uintX) * (dw);
- texel += tex_diff;
- tline_end += tpitch * 5;
-
- } while (texel != tex_end);
-
-
- //
- // Final Rows - Clipping
- //
-
- // Src Loop Y
- if (clip_y) {
- // Src Loop X
- do {
- Read6_Clipped(a, b, c, d, e, l);
- texel++;
-
- X1xY12xDoCols();
- X1xY12xInnerLoop();
- pixel -= pitch * 6 - sizeof(uintX);
-
- } while (texel != tline_end);
- }
-
- return true;
-}
-
-InstantiateBilinearScalerFunc(BilinearScalerInternal_X1Y12);
-
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_x2y24.cpp b/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_x2y24.cpp
deleted file mode 100644
index 92df54e..0000000
--- a/engines/ultima/ultima8/graphics/scalers/bilinear_scaler_internal_x2y24.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-#include "ultima/ultima8/graphics/scalers/bilinear_scaler_internal.h"
-#include "ultima/ultima8/graphics/manips.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-
-template<class uintX, class Manip, class uintS>
-bool BilinearScalerInternal_X2Y24(Texture *tex, int32 sx, int32 sy, int32 sw, int32 sh,
- uint8 *pixel, int32 dw, int32 dh, int32 pitch, bool clamp_src) {
- // Source buffer pointers
- uintS *texel = reinterpret_cast<uintS *>(tex->buffer) + (sy * tex->width + sx);
- int tpitch = tex->width;
- uintS *tline_end = texel + (sw - 1);
- uintS *tex_end = texel + (sh - 5) * tex->width;
- int tex_diff = (tex->width * 5) - sw;
-
- uint8 a[4], b[4], c[4], d[4], e[4], f[4], g[4], h[4], i[4], j[4], k[4], l[4];
- uint8 cols[2][12][4];
-
- bool clip_x = true;
- if (sw + sx < tex->width && clamp_src == false) {
- clip_x = false;
- tline_end = texel + (sw + 1);
- tex_diff--;
- }
-
- bool clip_y = true;
- if (sh + sy < tex->height && clamp_src == false) {
- clip_y = false;
- tex_end = texel + (sh) * tex->width;
- }
-
-
- // Src Loop Y
- do {
- Read6(a, b, c, d, e, l);
- texel++;
-
- X2xY24xDoColsA();
-
- // Src Loop X
- do {
- Read6(f, g, h, i, j, k);
- texel++;
-
- X2xY24xDoColsB();
- X2xY24xInnerLoop(0, 1);
- pixel -= pitch * 12 - sizeof(uintX) * 2;
-
- Read6(a, b, c, d, e, l);
- texel++;
-
- X2xY24xDoColsA();
- X2xY24xInnerLoop(1, 0);
- pixel -= pitch * 12 - sizeof(uintX) * 2;
- } while (texel != tline_end);
-
- // Final X (clipping)
- if (clip_x) {
- Read6(f, g, h, i, j, k);
- texel++;
-
- X2xY24xDoColsB();
- X2xY24xInnerLoop(0, 1);
- pixel -= pitch * 12 - sizeof(uintX) * 2;
-
- X2xY24xInnerLoop(1, 1);
- pixel -= pitch * 12 - sizeof(uintX) * 2;
- }
-
- pixel += pitch * 12 - sizeof(uintX) * (dw);
- texel += tex_diff;
- tline_end += tpitch * 5;
- } while (texel != tex_end);
-
-
- //
- // Final Rows - Clipping
- //
-
- // Src Loop Y
- if (clip_y) {
- Read6_Clipped(a, b, c, d, e, l);
- texel++;
-
- X2xY24xDoColsA();
-
- // Src Loop X
- do {
- Read6_Clipped(f, g, h, i, j, k);
- texel++;
-
- X2xY24xDoColsB();
- X2xY24xInnerLoop(0, 1);
- pixel -= pitch * 12 - sizeof(uintX) * 2;
-
- Read6_Clipped(a, b, c, d, e, l);
- texel++;
-
- X2xY24xDoColsA();
- X2xY24xInnerLoop(1, 0);
- pixel -= pitch * 12 - sizeof(uintX) * 2;
- } while (texel != tline_end);
-
- // Final X (clipping)
- if (clip_x) {
- Read6_Clipped(f, g, h, i, j, k);
- texel++;
-
- X2xY24xDoColsB();
-
- X2xY24xInnerLoop(0, 1);
- pixel -= pitch * 12 - sizeof(uintX) * 2;
-
- X2xY24xInnerLoop(1, 1);
- pixel -= pitch * 12 - sizeof(uintX) * 2;
- };
- }
-
- return true;
-}
-
-InstantiateBilinearScalerFunc(BilinearScalerInternal_X2Y24);
-
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
-
diff --git a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler.cpp b/engines/ultima/ultima8/graphics/scalers/hq2x_scaler.cpp
deleted file mode 100644
index 3a2fffd..0000000
--- a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-
-#ifdef USE_HQ2X_SCALER
-
-#include "ultima/ultima8/graphics/scalers/hq2x_scaler.h"
-#include "ultima/ultima8/graphics/manips.h"
-#include "ultima/ultima8/graphics/texture.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-
-hq2xScaler::hq2xScaler() : Scaler() {
- Scale16Nat = GetScaler<uint16, Manip_Nat2Nat_16, uint16>();
- Scale16Sta = GetScaler<uint16, Manip_Sta2Nat_16, uint32>();
-
- Scale32Nat = GetScaler<uint32, Manip_Nat2Nat_32, uint32>();
- Scale32Sta = GetScaler<uint32, Manip_Sta2Nat_32, uint32>();
- Scale32_A888 = GetScaler<uint32, Manip_32_A888, uint32>();
- Scale32_888A = GetScaler<uint32, Manip_32_888A, uint32>();
-}
-
-uint32 hq2xScaler::ScaleBits() const {
- return 1 << 2;
-}
-bool hq2xScaler::ScaleArbitrary() const {
- return false;
-}
-
-const char *hq2xScaler::ScalerName() const {
- return "hq2x";
-}
-const char *hq2xScaler::ScalerDesc() const {
- return "hq2x Magnification Filter";
-}
-const char *hq2xScaler::ScalerCopyright() const {
- return "Copyright (C) 2003 MaxSt";
-}
-
-const hq2xScaler hq2x_scaler;
-
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler.h b/engines/ultima/ultima8/graphics/scalers/hq2x_scaler.h
deleted file mode 100644
index ee67888..0000000
--- a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef ULTIMA8_GRAPHICS_SCALERS_HQ2XSCALER_H
-#define ULTIMA8_GRAPHICS_SCALERS_HQ2XSCALER_H
-
-#ifdef USE_HQ2X_SCALER
-
-#include "ultima/ultima8/graphics/scaler.h"
-
-namespace Pentagram {
-
-class hq2xScaler : public Scaler {
-public:
- hq2xScaler();
-
- virtual uint32 ScaleBits() const; //< bits for supported integer scaling
- virtual bool ScaleArbitrary() const; //< supports arbitrary scaling of any degree
-
- virtual const char *ScalerName() const; //< Name Of the Scaler (1 word)
- virtual const char *ScalerDesc() const; //< Desciption of the Scaler
- virtual const char *ScalerCopyright() const; //< Scaler Copyright info
-private:
- template<class uintX, class Manip, class uintS> ScalerFunc GetScaler();
-};
-
-extern const hq2xScaler hq2x_scaler;
-
-};
-
-#endif
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler.inc b/engines/ultima/ultima8/graphics/scalers/hq2x_scaler.inc
deleted file mode 100644
index 2411b8e..0000000
--- a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler.inc
+++ /dev/null
@@ -1,3021 +0,0 @@
-//hq2x filter demo program
-//----------------------------------------------------------
-//Copyright (C) 2003 MaxSt ( maxst at hiend3d.com )
-//
-//This program is free software; you can redistribute it and/or
-//modify it under the terms of the GNU General Public License
-//as published by the Free Software Foundation; either
-//version 2 of the License, or (at your option) any later
-//version.
-//
-//This program is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-//GNU General Public License for more details.
-//
-//You should have received a copy of the GNU General Public License
-//along with this program; if not, write to the Free Software
-//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-#ifdef USE_HQ2X_SCALER
-
-#include "ultima/ultima8/graphics/scalers/hq2x_scaler.h"
-#include "ultima/ultima8/graphics/manips.h"
-#include "ultima/ultima8/graphics/texture.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-
-static bool InitedLUT = false;
-static uint32 RGBtoYUV[65536];
-static uint32 YUV1;
-static uint32 YUV2;
-static const uint32 Ymask = 0x00FF0000;
-static const uint32 Umask = 0x0000FF00;
-static const uint32 Vmask = 0x000000FF;
-static const uint32 trY = 0x00300000;
-static const uint32 trU = 0x00000700;
-static const uint32 trV = 0x00000006;
-static const uint32 tableMaskR = 0;
-static const uint32 tableMaskG = 0;
-static const uint32 tableMaskB = 0;
-
-template<class uintX, class Manip, class uintS=uintX> class hq2xScalerInternal {
-
- static inline void Interp1(uint8 * pc, uintS c1, uintS c2)
- {
- // *((int*)pc) = (c1*3+c2) >> 2;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*3+rgba2[i])>>2;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
- }
-
- static inline void Interp2(uint8 * pc, uintS c1, uintS c2, uintS c3)
- {
- // *((int*)pc) = (c1*2+c2+c3) >> 2;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 rgba3[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
- Manip::split(c3,rgba3[0], rgba3[1], rgba3[2], rgba3[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*2+rgba2[i]+rgba3[i])>>2;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
-
- }
-
- static inline void Interp5(uint8 * pc, uintS c1, uintS c2)
- {
- // *((int*)pc) = (c1+c2) >> 1;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]+rgba2[i])>>1;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
-
- }
-
- static inline void Interp6(uint8 * pc, uintS c1, uintS c2, uintS c3)
- {
- //*((int*)pc) = (c1*5+c2*2+c3)/8;
-
- //*((int*)pc) = ((((c1 & 0x00FF00)*5 + (c2 & 0x00FF00)*2 + (c3 & 0x00FF00) ) & 0x0007F800) +
- // (((c1 & 0xFF00FF)*5 + (c2 & 0xFF00FF)*2 + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 rgba3[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
- Manip::split(c3,rgba3[0], rgba3[1], rgba3[2], rgba3[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*5+rgba2[i]*2+rgba3[i])>>3;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
- }
-
- static inline void Interp7(uint8 * pc, uintS c1, uintS c2, uintS c3)
- {
- //*((int*)pc) = (c1*6+c2+c3)/8;
-
- //*((int*)pc) = ((((c1 & 0x00FF00)*6 + (c2 & 0x00FF00) + (c3 & 0x00FF00) ) & 0x0007F800) +
- // (((c1 & 0xFF00FF)*6 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 rgba3[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
- Manip::split(c3,rgba3[0], rgba3[1], rgba3[2], rgba3[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*6+rgba2[i]+rgba3[i])>>3;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
-
- }
-
- static inline void Interp9(uint8 * pc, uintS c1, uintS c2, uintS c3)
- {
- //*((int*)pc) = (c1*2+(c2+c3)*3)/8;
-
- //*((int*)pc) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*3 ) & 0x0007F800) +
- // (((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*3 ) & 0x07F807F8)) >> 3;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 rgba3[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
- Manip::split(c3,rgba3[0], rgba3[1], rgba3[2], rgba3[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*2+(rgba2[i]+rgba3[i])*3)>>3;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
- }
-
- static inline void Interp10(uint8 * pc, uintS c1, uintS c2, uintS c3)
- {
- //*((int*)pc) = (c1*14+c2+c3)/16;
-
- //*((int*)pc) = ((((c1 & 0x00FF00)*14 + (c2 & 0x00FF00) + (c3 & 0x00FF00) ) & 0x000FF000) +
- // (((c1 & 0xFF00FF)*14 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x0FF00FF0)) >> 4;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 rgba3[4];
- uint32 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
- Manip::split(c3,rgba3[0], rgba3[1], rgba3[2], rgba3[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*14+rgba2[i]+rgba3[i])>>4;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
- }
-
-
-#define PIXEL00_0 *(reinterpret_cast<uintX*>(pOut)) = Manip::copy(c32[5]);
-#define PIXEL00_10 Interp1(pOut, c32[5], c32[1]);
-#define PIXEL00_11 Interp1(pOut, c32[5], c32[4]);
-#define PIXEL00_12 Interp1(pOut, c32[5], c32[2]);
-#define PIXEL00_20 Interp2(pOut, c32[5], c32[4], c32[2]);
-#define PIXEL00_21 Interp2(pOut, c32[5], c32[1], c32[2]);
-#define PIXEL00_22 Interp2(pOut, c32[5], c32[1], c32[4]);
-#define PIXEL00_60 Interp6(pOut, c32[5], c32[2], c32[4]);
-#define PIXEL00_61 Interp6(pOut, c32[5], c32[4], c32[2]);
-#define PIXEL00_70 Interp7(pOut, c32[5], c32[4], c32[2]);
-#define PIXEL00_90 Interp9(pOut, c32[5], c32[4], c32[2]);
-#define PIXEL00_100 Interp10(pOut, c32[5], c32[4], c32[2]);
-#define PIXEL01_0 *(reinterpret_cast<uintX*>(pOut+sizeof(uintX))) = Manip::copy(c32[5]);
-#define PIXEL01_10 Interp1(pOut+sizeof(uintX), c32[5], c32[3]);
-#define PIXEL01_11 Interp1(pOut+sizeof(uintX), c32[5], c32[2]);
-#define PIXEL01_12 Interp1(pOut+sizeof(uintX), c32[5], c32[6]);
-#define PIXEL01_20 Interp2(pOut+sizeof(uintX), c32[5], c32[2], c32[6]);
-#define PIXEL01_21 Interp2(pOut+sizeof(uintX), c32[5], c32[3], c32[6]);
-#define PIXEL01_22 Interp2(pOut+sizeof(uintX), c32[5], c32[3], c32[2]);
-#define PIXEL01_60 Interp6(pOut+sizeof(uintX), c32[5], c32[6], c32[2]);
-#define PIXEL01_61 Interp6(pOut+sizeof(uintX), c32[5], c32[2], c32[6]);
-#define PIXEL01_70 Interp7(pOut+sizeof(uintX), c32[5], c32[2], c32[6]);
-#define PIXEL01_90 Interp9(pOut+sizeof(uintX), c32[5], c32[2], c32[6]);
-#define PIXEL01_100 Interp10(pOut+sizeof(uintX), c32[5], c32[2], c32[6]);
-#define PIXEL10_0 *(reinterpret_cast<uintX*>(pOut+BpL)) = Manip::copy(c32[5]);
-#define PIXEL10_10 Interp1(pOut+BpL, c32[5], c32[7]);
-#define PIXEL10_11 Interp1(pOut+BpL, c32[5], c32[8]);
-#define PIXEL10_12 Interp1(pOut+BpL, c32[5], c32[4]);
-#define PIXEL10_20 Interp2(pOut+BpL, c32[5], c32[8], c32[4]);
-#define PIXEL10_21 Interp2(pOut+BpL, c32[5], c32[7], c32[4]);
-#define PIXEL10_22 Interp2(pOut+BpL, c32[5], c32[7], c32[8]);
-#define PIXEL10_60 Interp6(pOut+BpL, c32[5], c32[4], c32[8]);
-#define PIXEL10_61 Interp6(pOut+BpL, c32[5], c32[8], c32[4]);
-#define PIXEL10_70 Interp7(pOut+BpL, c32[5], c32[8], c32[4]);
-#define PIXEL10_90 Interp9(pOut+BpL, c32[5], c32[8], c32[4]);
-#define PIXEL10_100 Interp10(pOut+BpL, c32[5], c32[8], c32[4]);
-#define PIXEL11_0 *(reinterpret_cast<uintX*>(pOut+BpL+sizeof(uintX))) = Manip::copy(c32[5]);
-#define PIXEL11_10 Interp1(pOut+BpL+sizeof(uintX), c32[5], c32[9]);
-#define PIXEL11_11 Interp1(pOut+BpL+sizeof(uintX), c32[5], c32[6]);
-#define PIXEL11_12 Interp1(pOut+BpL+sizeof(uintX), c32[5], c32[8]);
-#define PIXEL11_20 Interp2(pOut+BpL+sizeof(uintX), c32[5], c32[6], c32[8]);
-#define PIXEL11_21 Interp2(pOut+BpL+sizeof(uintX), c32[5], c32[9], c32[8]);
-#define PIXEL11_22 Interp2(pOut+BpL+sizeof(uintX), c32[5], c32[9], c32[6]);
-#define PIXEL11_60 Interp6(pOut+BpL+sizeof(uintX), c32[5], c32[8], c32[6]);
-#define PIXEL11_61 Interp6(pOut+BpL+sizeof(uintX), c32[5], c32[6], c32[8]);
-#define PIXEL11_70 Interp7(pOut+BpL+sizeof(uintX), c32[5], c32[6], c32[8]);
-#define PIXEL11_90 Interp9(pOut+BpL+sizeof(uintX), c32[5], c32[6], c32[8]);
-#define PIXEL11_100 Interp10(pOut+BpL+sizeof(uintX), c32[5], c32[6], c32[8]);
-
- static inline bool Diff(unsigned int w1, unsigned int w2)
- {
- YUV1 = RGBtoYUV[w1];
- YUV2 = RGBtoYUV[w2];
- return ( ( (unsigned int)abs(int32(YUV1 & Ymask) - int32(YUV2 & Ymask)) > trY ) ||
- ( (unsigned int)abs(int32(YUV1 & Umask) - int32(YUV2 & Umask)) > trU ) ||
- ( (unsigned int)abs(int32(YUV1 & Vmask) - int32(YUV2 & Vmask)) > trV ) );
- }
-
-public:
-
- static void InitLUTs(void)
- {
- if (InitedLUT) return;
- InitedLUT = true;
-
- int i, j, k, r, g, b, Y, u, v;
-
- for (i=0; i<32; i++)
- for (j=0; j<64; j++)
- for (k=0; k<32; k++)
- {
- r = i << 3;
- g = j << 2;
- b = k << 3;
- Y = (r + g + b) >> 2;
- u = 128 + ((r - b) >> 2);
- v = 128 + ((-r + 2*g -b)>>3);
- RGBtoYUV[ (i << 11) + (j << 5) + k ] = (Y<<16) + (u<<8) + v;
- }
- }
-
- static bool hq2x_32(Texture *tex, int32 sx, int32 sy, int32 Xres, int32 Yres,
- uint8* pOut, int32 dw, int32 dh, int32 BpL, bool clamp_src)
- {
- if (Xres*2!=dw || Yres*2!=dh) return false;
-
- InitLUTs();
-
- int i, j, k;
- int prevline, nextline;
- uint32 w16[10];
- uintS c32[10];
-
- // Source buffer pointers
- int tpitch = tex->width*sizeof(uintS);
- uint8 *pIn = reinterpret_cast<uint8*>(tex->buffer) + sy*tpitch + sx*sizeof(uintS);
- int tex_diff = tpitch - Xres*sizeof(uintX);
-
- int pix_diff = BpL*2-Xres*2*sizeof(uintX);
-
- bool clipX = true;
- bool clipY_Begin = true;
- bool clipY_End = true;
-
- if (!clamp_src && sy!=0) clipY_Begin = false;
- if (!clamp_src && (Yres+sy)<tex->height) clipY_End = false;
-
- // +----+----+----+
- // | | | |
- // | w1 | w2 | w3 |
- // +----+----+----+
- // | | | |
- // | w4 | w5 | w6 |
- // +----+----+----+
- // | | | |
- // | w7 | w8 | w9 |
- // +----+----+----+
-
- for (j=0; j<Yres; j++)
- {
- if (j>0 || !clipY_Begin) prevline = -tpitch; else prevline = 0;
- if (j<Yres-1 || !clipY_End) nextline = tpitch; else nextline = 0;
-
- // Read first 2 columns of pixels
- c32[2] = c32[3] = *reinterpret_cast<uintS*>(pIn + prevline);
- c32[5] = c32[6] = *reinterpret_cast<uintS*>(pIn);
- c32[8] = c32[9] = *reinterpret_cast<uintS*>(pIn + nextline);
-
- w16[2] = w16[3] = Manip::to16bit(c32[2]);
- w16[5] = w16[6] = Manip::to16bit(c32[5]);
- w16[8] = w16[9] = Manip::to16bit(c32[6]);
-
- for (i=0; i<Xres; i++)
- {
- // First col = Prev Second column
- c32[1] = c32[2];
- c32[4] = c32[5];
- c32[7] = c32[8];
- w16[1] = w16[2];
- w16[4] = w16[5];
- w16[7] = w16[8];
-
- // Second col = Prev Third column
- c32[2] = c32[3];
- c32[5] = c32[6];
- c32[8] = c32[9];
- w16[2] = w16[3];
- w16[5] = w16[6];
- w16[8] = w16[9];
-
- // Read Next Pixel
- if (i<Xres-1 || !clipX)
- {
- c32[3] = *reinterpret_cast<uintS*>(pIn + sizeof(uintS) + prevline);
- c32[6] = *reinterpret_cast<uintS*>(pIn + sizeof(uintS));
- c32[9] = *reinterpret_cast<uintS*>(pIn + sizeof(uintS) + nextline);
- w16[3] = Manip::to16bit(c32[3]);
- w16[6] = Manip::to16bit(c32[6]);
- w16[9] = Manip::to16bit(c32[9]);
- }
-
- int pattern = 0;
- int flag = 1;
-
- YUV1 = RGBtoYUV[w16[5]];
-
- for (k=1; k<=9; k++)
- {
- if (k==5) continue;
-
- if ( w16[k] != w16[5] )
- {
- YUV2 = RGBtoYUV[w16[k]];
- if ( ( (unsigned int)abs(int32(YUV1 & Ymask) - int32(YUV2 & Ymask)) > trY ) ||
- ( (unsigned int)abs(int32(YUV1 & Umask) - int32(YUV2 & Umask)) > trU ) ||
- ( (unsigned int)abs(int32(YUV1 & Vmask) - int32(YUV2 & Vmask)) > trV ) )
- pattern |= flag;
- }
- flag <<= 1;
- }
-
- switch (pattern)
- {
- case 0:
- case 1:
- case 4:
- case 32:
- case 128:
- case 5:
- case 132:
- case 160:
- case 33:
- case 129:
- case 36:
- case 133:
- case 164:
- case 161:
- case 37:
- case 165:
- {
- PIXEL00_20
- PIXEL01_20
- PIXEL10_20
- PIXEL11_20
- break;
- }
- case 2:
- case 34:
- case 130:
- case 162:
- {
- PIXEL00_22
- PIXEL01_21
- PIXEL10_20
- PIXEL11_20
- break;
- }
- case 16:
- case 17:
- case 48:
- case 49:
- {
- PIXEL00_20
- PIXEL01_22
- PIXEL10_20
- PIXEL11_21
- break;
- }
- case 64:
- case 65:
- case 68:
- case 69:
- {
- PIXEL00_20
- PIXEL01_20
- PIXEL10_21
- PIXEL11_22
- break;
- }
- case 8:
- case 12:
- case 136:
- case 140:
- {
- PIXEL00_21
- PIXEL01_20
- PIXEL10_22
- PIXEL11_20
- break;
- }
- case 3:
- case 35:
- case 131:
- case 163:
- {
- PIXEL00_11
- PIXEL01_21
- PIXEL10_20
- PIXEL11_20
- break;
- }
- case 6:
- case 38:
- case 134:
- case 166:
- {
- PIXEL00_22
- PIXEL01_12
- PIXEL10_20
- PIXEL11_20
- break;
- }
- case 20:
- case 21:
- case 52:
- case 53:
- {
- PIXEL00_20
- PIXEL01_11
- PIXEL10_20
- PIXEL11_21
- break;
- }
- case 144:
- case 145:
- case 176:
- case 177:
- {
- PIXEL00_20
- PIXEL01_22
- PIXEL10_20
- PIXEL11_12
- break;
- }
- case 192:
- case 193:
- case 196:
- case 197:
- {
- PIXEL00_20
- PIXEL01_20
- PIXEL10_21
- PIXEL11_11
- break;
- }
- case 96:
- case 97:
- case 100:
- case 101:
- {
- PIXEL00_20
- PIXEL01_20
- PIXEL10_12
- PIXEL11_22
- break;
- }
- case 40:
- case 44:
- case 168:
- case 172:
- {
- PIXEL00_21
- PIXEL01_20
- PIXEL10_11
- PIXEL11_20
- break;
- }
- case 9:
- case 13:
- case 137:
- case 141:
- {
- PIXEL00_12
- PIXEL01_20
- PIXEL10_22
- PIXEL11_20
- break;
- }
- case 18:
- case 50:
- {
- PIXEL00_22
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_20
- PIXEL11_21
- break;
- }
- case 80:
- case 81:
- {
- PIXEL00_20
- PIXEL01_22
- PIXEL10_21
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 72:
- case 76:
- {
- PIXEL00_21
- PIXEL01_20
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_22
- break;
- }
- case 10:
- case 138:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_21
- PIXEL10_22
- PIXEL11_20
- break;
- }
- case 66:
- {
- PIXEL00_22
- PIXEL01_21
- PIXEL10_21
- PIXEL11_22
- break;
- }
- case 24:
- {
- PIXEL00_21
- PIXEL01_22
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 7:
- case 39:
- case 135:
- {
- PIXEL00_11
- PIXEL01_12
- PIXEL10_20
- PIXEL11_20
- break;
- }
- case 148:
- case 149:
- case 180:
- {
- PIXEL00_20
- PIXEL01_11
- PIXEL10_20
- PIXEL11_12
- break;
- }
- case 224:
- case 228:
- case 225:
- {
- PIXEL00_20
- PIXEL01_20
- PIXEL10_12
- PIXEL11_11
- break;
- }
- case 41:
- case 169:
- case 45:
- {
- PIXEL00_12
- PIXEL01_20
- PIXEL10_11
- PIXEL11_20
- break;
- }
- case 22:
- case 54:
- {
- PIXEL00_22
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_20
- PIXEL11_21
- break;
- }
- case 208:
- case 209:
- {
- PIXEL00_20
- PIXEL01_22
- PIXEL10_21
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 104:
- case 108:
- {
- PIXEL00_21
- PIXEL01_20
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_22
- break;
- }
- case 11:
- case 139:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_21
- PIXEL10_22
- PIXEL11_20
- break;
- }
- case 19:
- case 51:
- {
- if (Diff(w16[2], w16[6]))
- {
- PIXEL00_11
- PIXEL01_10
- }
- else
- {
- PIXEL00_60
- PIXEL01_90
- }
- PIXEL10_20
- PIXEL11_21
- break;
- }
- case 146:
- case 178:
- {
- PIXEL00_22
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- PIXEL11_12
- }
- else
- {
- PIXEL01_90
- PIXEL11_61
- }
- PIXEL10_20
- break;
- }
- case 84:
- case 85:
- {
- PIXEL00_20
- if (Diff(w16[6], w16[8]))
- {
- PIXEL01_11
- PIXEL11_10
- }
- else
- {
- PIXEL01_60
- PIXEL11_90
- }
- PIXEL10_21
- break;
- }
- case 112:
- case 113:
- {
- PIXEL00_20
- PIXEL01_22
- if (Diff(w16[6], w16[8]))
- {
- PIXEL10_12
- PIXEL11_10
- }
- else
- {
- PIXEL10_61
- PIXEL11_90
- }
- break;
- }
- case 200:
- case 204:
- {
- PIXEL00_21
- PIXEL01_20
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- PIXEL11_11
- }
- else
- {
- PIXEL10_90
- PIXEL11_60
- }
- break;
- }
- case 73:
- case 77:
- {
- if (Diff(w16[8], w16[4]))
- {
- PIXEL00_12
- PIXEL10_10
- }
- else
- {
- PIXEL00_61
- PIXEL10_90
- }
- PIXEL01_20
- PIXEL11_22
- break;
- }
- case 42:
- case 170:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- PIXEL10_11
- }
- else
- {
- PIXEL00_90
- PIXEL10_60
- }
- PIXEL01_21
- PIXEL11_20
- break;
- }
- case 14:
- case 142:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- PIXEL01_12
- }
- else
- {
- PIXEL00_90
- PIXEL01_61
- }
- PIXEL10_22
- PIXEL11_20
- break;
- }
- case 67:
- {
- PIXEL00_11
- PIXEL01_21
- PIXEL10_21
- PIXEL11_22
- break;
- }
- case 70:
- {
- PIXEL00_22
- PIXEL01_12
- PIXEL10_21
- PIXEL11_22
- break;
- }
- case 28:
- {
- PIXEL00_21
- PIXEL01_11
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 152:
- {
- PIXEL00_21
- PIXEL01_22
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 194:
- {
- PIXEL00_22
- PIXEL01_21
- PIXEL10_21
- PIXEL11_11
- break;
- }
- case 98:
- {
- PIXEL00_22
- PIXEL01_21
- PIXEL10_12
- PIXEL11_22
- break;
- }
- case 56:
- {
- PIXEL00_21
- PIXEL01_22
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 25:
- {
- PIXEL00_12
- PIXEL01_22
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 26:
- case 31:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 82:
- case 214:
- {
- PIXEL00_22
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_21
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 88:
- case 248:
- {
- PIXEL00_21
- PIXEL01_22
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 74:
- case 107:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_21
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_22
- break;
- }
- case 27:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_10
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 86:
- {
- PIXEL00_22
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_21
- PIXEL11_10
- break;
- }
- case 216:
- {
- PIXEL00_21
- PIXEL01_22
- PIXEL10_10
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 106:
- {
- PIXEL00_10
- PIXEL01_21
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_22
- break;
- }
- case 30:
- {
- PIXEL00_10
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 210:
- {
- PIXEL00_22
- PIXEL01_10
- PIXEL10_21
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 120:
- {
- PIXEL00_21
- PIXEL01_22
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_10
- break;
- }
- case 75:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_21
- PIXEL10_10
- PIXEL11_22
- break;
- }
- case 29:
- {
- PIXEL00_12
- PIXEL01_11
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 198:
- {
- PIXEL00_22
- PIXEL01_12
- PIXEL10_21
- PIXEL11_11
- break;
- }
- case 184:
- {
- PIXEL00_21
- PIXEL01_22
- PIXEL10_11
- PIXEL11_12
- break;
- }
- case 99:
- {
- PIXEL00_11
- PIXEL01_21
- PIXEL10_12
- PIXEL11_22
- break;
- }
- case 57:
- {
- PIXEL00_12
- PIXEL01_22
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 71:
- {
- PIXEL00_11
- PIXEL01_12
- PIXEL10_21
- PIXEL11_22
- break;
- }
- case 156:
- {
- PIXEL00_21
- PIXEL01_11
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 226:
- {
- PIXEL00_22
- PIXEL01_21
- PIXEL10_12
- PIXEL11_11
- break;
- }
- case 60:
- {
- PIXEL00_21
- PIXEL01_11
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 195:
- {
- PIXEL00_11
- PIXEL01_21
- PIXEL10_21
- PIXEL11_11
- break;
- }
- case 102:
- {
- PIXEL00_22
- PIXEL01_12
- PIXEL10_12
- PIXEL11_22
- break;
- }
- case 153:
- {
- PIXEL00_12
- PIXEL01_22
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 58:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 83:
- {
- PIXEL00_11
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_21
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 92:
- {
- PIXEL00_21
- PIXEL01_11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 202:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- PIXEL01_21
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- PIXEL11_11
- break;
- }
- case 78:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- PIXEL01_12
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- PIXEL11_22
- break;
- }
- case 154:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 114:
- {
- PIXEL00_22
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_12
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 89:
- {
- PIXEL00_12
- PIXEL01_22
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 90:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 55:
- case 23:
- {
- if (Diff(w16[2], w16[6]))
- {
- PIXEL00_11
- PIXEL01_0
- }
- else
- {
- PIXEL00_60
- PIXEL01_90
- }
- PIXEL10_20
- PIXEL11_21
- break;
- }
- case 182:
- case 150:
- {
- PIXEL00_22
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- PIXEL11_12
- }
- else
- {
- PIXEL01_90
- PIXEL11_61
- }
- PIXEL10_20
- break;
- }
- case 213:
- case 212:
- {
- PIXEL00_20
- if (Diff(w16[6], w16[8]))
- {
- PIXEL01_11
- PIXEL11_0
- }
- else
- {
- PIXEL01_60
- PIXEL11_90
- }
- PIXEL10_21
- break;
- }
- case 241:
- case 240:
- {
- PIXEL00_20
- PIXEL01_22
- if (Diff(w16[6], w16[8]))
- {
- PIXEL10_12
- PIXEL11_0
- }
- else
- {
- PIXEL10_61
- PIXEL11_90
- }
- break;
- }
- case 236:
- case 232:
- {
- PIXEL00_21
- PIXEL01_20
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- PIXEL11_11
- }
- else
- {
- PIXEL10_90
- PIXEL11_60
- }
- break;
- }
- case 109:
- case 105:
- {
- if (Diff(w16[8], w16[4]))
- {
- PIXEL00_12
- PIXEL10_0
- }
- else
- {
- PIXEL00_61
- PIXEL10_90
- }
- PIXEL01_20
- PIXEL11_22
- break;
- }
- case 171:
- case 43:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- PIXEL10_11
- }
- else
- {
- PIXEL00_90
- PIXEL10_60
- }
- PIXEL01_21
- PIXEL11_20
- break;
- }
- case 143:
- case 15:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- PIXEL01_12
- }
- else
- {
- PIXEL00_90
- PIXEL01_61
- }
- PIXEL10_22
- PIXEL11_20
- break;
- }
- case 124:
- {
- PIXEL00_21
- PIXEL01_11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_10
- break;
- }
- case 203:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_21
- PIXEL10_10
- PIXEL11_11
- break;
- }
- case 62:
- {
- PIXEL00_10
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 211:
- {
- PIXEL00_11
- PIXEL01_10
- PIXEL10_21
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 118:
- {
- PIXEL00_22
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_12
- PIXEL11_10
- break;
- }
- case 217:
- {
- PIXEL00_12
- PIXEL01_22
- PIXEL10_10
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 110:
- {
- PIXEL00_10
- PIXEL01_12
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_22
- break;
- }
- case 155:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_10
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 188:
- {
- PIXEL00_21
- PIXEL01_11
- PIXEL10_11
- PIXEL11_12
- break;
- }
- case 185:
- {
- PIXEL00_12
- PIXEL01_22
- PIXEL10_11
- PIXEL11_12
- break;
- }
- case 61:
- {
- PIXEL00_12
- PIXEL01_11
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 157:
- {
- PIXEL00_12
- PIXEL01_11
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 103:
- {
- PIXEL00_11
- PIXEL01_12
- PIXEL10_12
- PIXEL11_22
- break;
- }
- case 227:
- {
- PIXEL00_11
- PIXEL01_21
- PIXEL10_12
- PIXEL11_11
- break;
- }
- case 230:
- {
- PIXEL00_22
- PIXEL01_12
- PIXEL10_12
- PIXEL11_11
- break;
- }
- case 199:
- {
- PIXEL00_11
- PIXEL01_12
- PIXEL10_21
- PIXEL11_11
- break;
- }
- case 220:
- {
- PIXEL00_21
- PIXEL01_11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 158:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 234:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- PIXEL01_21
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_11
- break;
- }
- case 242:
- {
- PIXEL00_22
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_12
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 59:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 121:
- {
- PIXEL00_12
- PIXEL01_22
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 87:
- {
- PIXEL00_11
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_21
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 79:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_12
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- PIXEL11_22
- break;
- }
- case 122:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 94:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 218:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 91:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 229:
- {
- PIXEL00_20
- PIXEL01_20
- PIXEL10_12
- PIXEL11_11
- break;
- }
- case 167:
- {
- PIXEL00_11
- PIXEL01_12
- PIXEL10_20
- PIXEL11_20
- break;
- }
- case 173:
- {
- PIXEL00_12
- PIXEL01_20
- PIXEL10_11
- PIXEL11_20
- break;
- }
- case 181:
- {
- PIXEL00_20
- PIXEL01_11
- PIXEL10_20
- PIXEL11_12
- break;
- }
- case 186:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_11
- PIXEL11_12
- break;
- }
- case 115:
- {
- PIXEL00_11
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_12
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 93:
- {
- PIXEL00_12
- PIXEL01_11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 206:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- PIXEL01_12
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- PIXEL11_11
- break;
- }
- case 205:
- case 201:
- {
- PIXEL00_12
- PIXEL01_20
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- PIXEL11_11
- break;
- }
- case 174:
- case 46:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- PIXEL01_12
- PIXEL10_11
- PIXEL11_20
- break;
- }
- case 179:
- case 147:
- {
- PIXEL00_11
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_20
- PIXEL11_12
- break;
- }
- case 117:
- case 116:
- {
- PIXEL00_20
- PIXEL01_11
- PIXEL10_12
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 189:
- {
- PIXEL00_12
- PIXEL01_11
- PIXEL10_11
- PIXEL11_12
- break;
- }
- case 231:
- {
- PIXEL00_11
- PIXEL01_12
- PIXEL10_12
- PIXEL11_11
- break;
- }
- case 126:
- {
- PIXEL00_10
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_10
- break;
- }
- case 219:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_10
- PIXEL10_10
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 125:
- {
- if (Diff(w16[8], w16[4]))
- {
- PIXEL00_12
- PIXEL10_0
- }
- else
- {
- PIXEL00_61
- PIXEL10_90
- }
- PIXEL01_11
- PIXEL11_10
- break;
- }
- case 221:
- {
- PIXEL00_12
- if (Diff(w16[6], w16[8]))
- {
- PIXEL01_11
- PIXEL11_0
- }
- else
- {
- PIXEL01_60
- PIXEL11_90
- }
- PIXEL10_10
- break;
- }
- case 207:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- PIXEL01_12
- }
- else
- {
- PIXEL00_90
- PIXEL01_61
- }
- PIXEL10_10
- PIXEL11_11
- break;
- }
- case 238:
- {
- PIXEL00_10
- PIXEL01_12
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- PIXEL11_11
- }
- else
- {
- PIXEL10_90
- PIXEL11_60
- }
- break;
- }
- case 190:
- {
- PIXEL00_10
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- PIXEL11_12
- }
- else
- {
- PIXEL01_90
- PIXEL11_61
- }
- PIXEL10_11
- break;
- }
- case 187:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- PIXEL10_11
- }
- else
- {
- PIXEL00_90
- PIXEL10_60
- }
- PIXEL01_10
- PIXEL11_12
- break;
- }
- case 243:
- {
- PIXEL00_11
- PIXEL01_10
- if (Diff(w16[6], w16[8]))
- {
- PIXEL10_12
- PIXEL11_0
- }
- else
- {
- PIXEL10_61
- PIXEL11_90
- }
- break;
- }
- case 119:
- {
- if (Diff(w16[2], w16[6]))
- {
- PIXEL00_11
- PIXEL01_0
- }
- else
- {
- PIXEL00_60
- PIXEL01_90
- }
- PIXEL10_12
- PIXEL11_10
- break;
- }
- case 237:
- case 233:
- {
- PIXEL00_12
- PIXEL01_20
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- PIXEL11_11
- break;
- }
- case 175:
- case 47:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- PIXEL01_12
- PIXEL10_11
- PIXEL11_20
- break;
- }
- case 183:
- case 151:
- {
- PIXEL00_11
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- PIXEL10_20
- PIXEL11_12
- break;
- }
- case 245:
- case 244:
- {
- PIXEL00_20
- PIXEL01_11
- PIXEL10_12
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- case 250:
- {
- PIXEL00_10
- PIXEL01_10
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 123:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_10
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_10
- break;
- }
- case 95:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_10
- PIXEL11_10
- break;
- }
- case 222:
- {
- PIXEL00_10
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_10
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 252:
- {
- PIXEL00_21
- PIXEL01_11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- case 249:
- {
- PIXEL00_12
- PIXEL01_22
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 235:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_21
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- PIXEL11_11
- break;
- }
- case 111:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- PIXEL01_12
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_22
- break;
- }
- case 63:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 159:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 215:
- {
- PIXEL00_11
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- PIXEL10_21
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 246:
- {
- PIXEL00_22
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_12
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- case 254:
- {
- PIXEL00_10
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- case 253:
- {
- PIXEL00_12
- PIXEL01_11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- case 251:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_10
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 239:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- PIXEL01_12
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- PIXEL11_11
- break;
- }
- case 127:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_10
- break;
- }
- case 191:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- PIXEL10_11
- PIXEL11_12
- break;
- }
- case 223:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- PIXEL10_10
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 247:
- {
- PIXEL00_11
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- PIXEL10_12
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- case 255:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- }
- pIn+=sizeof(uintS);
- pOut+=sizeof(uintX)*2;
- }
- pIn+=tex_diff;
- pOut+=pix_diff;
- }
-
- return true;
- }
-
-}; // class
-
-template<class uintX, class Manip, class uintS> Scaler::ScalerFunc hq2xScaler::GetScaler()
-{
- return hq2xScalerInternal<uintX, Manip, uintS>::hq2x_32;
-}
-
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_16nat.cpp b/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_16nat.cpp
deleted file mode 100644
index afc96a4..0000000
--- a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_16nat.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-
-#ifdef USE_HQ2X_SCALER
-
-#include "ultima/ultima8/graphics/scalers/hq2x_scaler.inc"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-template Scaler::ScalerFunc hq2xScaler::GetScaler<uint16, Manip_Nat2Nat_16, uint16>();
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_16sta.cpp b/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_16sta.cpp
deleted file mode 100644
index 55bbb05..0000000
--- a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_16sta.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-
-#ifdef USE_HQ2X_SCALER
-
-#include "ultima/ultima8/graphics/scalers/hq2x_scaler.inc"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-template Scaler::ScalerFunc hq2xScaler::GetScaler<uint16, Manip_Sta2Nat_16, uint32>();
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_32nat.cpp b/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_32nat.cpp
deleted file mode 100644
index d9c2bd6..0000000
--- a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_32nat.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-
-#ifdef USE_HQ2X_SCALER
-
-#include "ultima/ultima8/graphics/scalers/hq2x_scaler.inc"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-template Scaler::ScalerFunc hq2xScaler::GetScaler<uint32, Manip_Nat2Nat_32, uint32>();
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_32sta.cpp b/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_32sta.cpp
deleted file mode 100644
index 3a59b49..0000000
--- a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_32sta.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-
-#ifdef USE_HQ2X_SCALER
-
-#include "ultima/ultima8/graphics/scalers/hq2x_scaler.inc"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-template Scaler::ScalerFunc hq2xScaler::GetScaler<uint32, Manip_Sta2Nat_32, uint32>();
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_888a.cpp b/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_888a.cpp
deleted file mode 100644
index f73ffb6..0000000
--- a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_888a.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-
-#ifdef USE_HQ2X_SCALER
-
-#include "ultima/ultima8/graphics/scalers/hq2x_scaler.inc"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-template Scaler::ScalerFunc hq2xScaler::GetScaler<uint32, Manip_32_888A, uint32>();
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_a888.cpp b/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_a888.cpp
deleted file mode 100644
index 2a2b390..0000000
--- a/engines/ultima/ultima8/graphics/scalers/hq2x_scaler_a888.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2004 Ryan Nunn and The Pentagram Team
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-
-#ifdef USE_HQ2X_SCALER
-
-#include "ultima/ultima8/graphics/scalers/hq2x_scaler.inc"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-template Scaler::ScalerFunc hq2xScaler::GetScaler<uint32, Manip_32_A888, uint32>();
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/hq3x_scaler.cpp b/engines/ultima/ultima8/graphics/scalers/hq3x_scaler.cpp
deleted file mode 100644
index d23dd36..0000000
--- a/engines/ultima/ultima8/graphics/scalers/hq3x_scaler.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "ultima/ultima8/misc/pent_include.h"
-
-#ifdef USE_HQ3X_SCALER
-
-#include "ultima/ultima8/graphics/scalers/hq3x_scaler.h"
-#include "ultima/ultima8/graphics/manips.h"
-#include "ultima/ultima8/graphics/texture.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-
-hq3xScaler::hq3xScaler() : Scaler() {
- Scale16Nat = GetScaler<uint16, Manip_Nat2Nat_16, uint16>();
- Scale16Sta = GetScaler<uint16, Manip_Sta2Nat_16, uint32>();
-
- Scale32Nat = GetScaler<uint32, Manip_Nat2Nat_32, uint32>();
- Scale32Sta = GetScaler<uint32, Manip_Sta2Nat_32, uint32>();
- Scale32_A888 = GetScaler<uint32, Manip_32_A888, uint32>();
- Scale32_888A = GetScaler<uint32, Manip_32_888A, uint32>();
-}
-
-uint32 hq3xScaler::ScaleBits() const {
- return 1 << 3;
-}
-bool hq3xScaler::ScaleArbitrary() const {
- return false;
-}
-
-const char *hq3xScaler::ScalerName() const {
- return "hq3x";
-}
-const char *hq3xScaler::ScalerDesc() const {
- return "hq3x Magnification Filter";
-}
-const char *hq3xScaler::ScalerCopyright() const {
- return "Copyright (C) 2003 MaxSt";
-}
-
-const hq3xScaler hq3x_scaler;
-
-} // End of namespace Pentagram
-} // End of namespace Ultima8
-} // End of namespace Ultima
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/hq3x_scaler.h b/engines/ultima/ultima8/graphics/scalers/hq3x_scaler.h
deleted file mode 100644
index 0dcd27a..0000000
--- a/engines/ultima/ultima8/graphics/scalers/hq3x_scaler.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef ULTIMA8_GRAPHICS_SCALERS_HQ3XSCALER_H
-#define ULTIMA8_GRAPHICS_SCALERS_HQ3XSCALER_H
-
-#ifdef USE_HQ3X_SCALER
-
-#include "ultima/ultima8/graphics/scaler.h"
-
-namespace Pentagram {
-
-class hq3xScaler : public Scaler {
-public:
- hq3xScaler();
-
- virtual uint32 ScaleBits() const; //< bits for supported integer scaling
- virtual bool ScaleArbitrary() const; //< supports arbitrary scaling of any degree
-
- virtual const char *ScalerName() const; //< Name Of the Scaler (1 word)
- virtual const char *ScalerDesc() const; //< Desciption of the Scaler
- virtual const char *ScalerCopyright() const; //< Scaler Copyright info
-private:
- template<class uintX, class Manip, class uintS> ScalerFunc GetScaler();
-};
-
-extern const hq3xScaler hq3x_scaler;
-
-};
-
-#endif
-
-#endif
diff --git a/engines/ultima/ultima8/graphics/scalers/hq3x_scaler.inc b/engines/ultima/ultima8/graphics/scalers/hq3x_scaler.inc
deleted file mode 100644
index 9c7f089..0000000
--- a/engines/ultima/ultima8/graphics/scalers/hq3x_scaler.inc
+++ /dev/null
@@ -1,4031 +0,0 @@
-//hq3x filter demo program
-//----------------------------------------------------------
-//Copyright (C) 2003 MaxSt ( maxst at hiend3d.com )
-//
-//This program is free software; you can redistribute it and/or
-//modify it under the terms of the GNU General Public License
-//as published by the Free Software Foundation; either
-//version 2 of the License, or (at your option) any later
-//version.
-//
-//This program is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-//GNU General Public License for more details.
-//
-//You should have received a copy of the GNU General Public License
-//along with this program; if not, write to the Free Software
-//Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-#ifdef USE_HQ3X_SCALER
-
-#include "ultima/ultima8/graphics/scalers/hq3x_scaler.h"
-#include "ultima/ultima8/graphics/manips.h"
-#include "ultima/ultima8/graphics/texture.h"
-
-namespace Ultima {
-namespace Ultima8 {
-namespace Pentagram {
-
-static bool InitedLUT = false;
-static uint32 RGBtoYUV[65536];
-static uint32 YUV1;
-static uint32 YUV2;
-static const uint32 Ymask = 0x00FF0000;
-static const uint32 Umask = 0x0000FF00;
-static const uint32 Vmask = 0x000000FF;
-static const uint32 trY = 0x00300000;
-static const uint32 trU = 0x00000700;
-static const uint32 trV = 0x00000006;
-static const uint32 tableMaskR = 0;
-static const uint32 tableMaskG = 0;
-static const uint32 tableMaskB = 0;
-
-template<class uintX, class Manip, class uintS=uintX> class hq3xScalerInternal {
-
- static inline void Interp1(uint8 * pc, uintS c1, uintS c2)
- {
- // *((int*)pc) = (c1*3+c2) >> 2;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*3+rgba2[i])>>2;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
- }
-
- static inline void Interp2(uint8 * pc, uintS c1, uintS c2, uintS c3)
- {
- // *((int*)pc) = (c1*2+c2+c3) >> 2;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 rgba3[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
- Manip::split(c3,rgba3[0], rgba3[1], rgba3[2], rgba3[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*2+rgba2[i]+rgba3[i])>>2;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
-
- }
-
- static inline void Interp3(uint8 * pc, uintS c1, uintS c2)
- {
-
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*7+rgba2[i])>>3;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
- }
-
- static inline void Interp4(uint8 * pc, uintS c1, uintS c2, uintS c3)
- {
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 rgba3[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
- Manip::split(c3,rgba3[0], rgba3[1], rgba3[2], rgba3[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*2+rgba2[i]+rgba3[i]*7)>>4;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
-
- }
-
- static inline void Interp5(uint8 * pc, uintS c1, uintS c2)
- {
- // *((int*)pc) = (c1+c2) >> 1;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]+rgba2[i])>>1;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
-
- }
-
- static inline void Interp6(uint8 * pc, uintS c1, uintS c2, uintS c3)
- {
- //*((int*)pc) = (c1*5+c2*2+c3)/8;
-
- //*((int*)pc) = ((((c1 & 0x00FF00)*5 + (c2 & 0x00FF00)*2 + (c3 & 0x00FF00) ) & 0x0007F800) +
- // (((c1 & 0xFF00FF)*5 + (c2 & 0xFF00FF)*2 + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 rgba3[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
- Manip::split(c3,rgba3[0], rgba3[1], rgba3[2], rgba3[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*5+rgba2[i]*2+rgba3[i])>>3;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
- }
-
- static inline void Interp7(uint8 * pc, uintS c1, uintS c2, uintS c3)
- {
- //*((int*)pc) = (c1*6+c2+c3)/8;
-
- //*((int*)pc) = ((((c1 & 0x00FF00)*6 + (c2 & 0x00FF00) + (c3 & 0x00FF00) ) & 0x0007F800) +
- // (((c1 & 0xFF00FF)*6 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 rgba3[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
- Manip::split(c3,rgba3[0], rgba3[1], rgba3[2], rgba3[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*6+rgba2[i]+rgba3[i])>>3;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
-
- }
-
- static inline void Interp9(uint8 * pc, uintS c1, uintS c2, uintS c3)
- {
- //*((int*)pc) = (c1*2+(c2+c3)*3)/8;
-
- //*((int*)pc) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*3 ) & 0x0007F800) +
- // (((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*3 ) & 0x07F807F8)) >> 3;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 rgba3[4];
- uint8 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
- Manip::split(c3,rgba3[0], rgba3[1], rgba3[2], rgba3[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*2+(rgba2[i]+rgba3[i])*3)>>3;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
- }
-
- static inline void Interp10(uint8 * pc, uintS c1, uintS c2, uintS c3)
- {
- //*((int*)pc) = (c1*14+c2+c3)/16;
-
- //*((int*)pc) = ((((c1 & 0x00FF00)*14 + (c2 & 0x00FF00) + (c3 & 0x00FF00) ) & 0x000FF000) +
- // (((c1 & 0xFF00FF)*14 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x0FF00FF0)) >> 4;
- uint8 rgba1[4];
- uint8 rgba2[4];
- uint8 rgba3[4];
- uint32 res[4];
-
- Manip::split(c1,rgba1[0], rgba1[1], rgba1[2], rgba1[3]);
- Manip::split(c2,rgba2[0], rgba2[1], rgba2[2], rgba2[3]);
- Manip::split(c3,rgba3[0], rgba3[1], rgba3[2], rgba3[3]);
-
- for (int i=0; i<4; i++) res[i]=(rgba1[i]*14+rgba2[i]+rgba3[i])>>4;
-
- *reinterpret_cast<uintX*>(pc) = Manip::merge(res[0],res[1],res[2],res[3]);
- }
-
-
-#define PIXEL00_1M Interp1(pOut, c32[5], c32[1]);
-#define PIXEL00_1U Interp1(pOut, c32[5], c32[2]);
-#define PIXEL00_1L Interp1(pOut, c32[5], c32[4]);
-#define PIXEL00_2 Interp2(pOut, c32[5], c32[4], c32[2]);
-#define PIXEL00_4 Interp4(pOut, c32[5], c32[4], c32[2]);
-#define PIXEL00_5 Interp5(pOut, c32[4], c32[2]);
-#define PIXEL00_C *(reinterpret_cast<uintX*>(pOut)) = Manip::copy(c32[5]);
-
-#define PIXEL01_1 Interp1(pOut+sizeof(uintX), c32[5], c32[2]);
-#define PIXEL01_3 Interp3(pOut+sizeof(uintX), c32[5], c32[2]);
-#define PIXEL01_6 Interp1(pOut+sizeof(uintX), c32[2], c32[5]);
-#define PIXEL01_C *(reinterpret_cast<uintX*>(pOut+sizeof(uintX))) = Manip::copy(c32[5]);
-
-#define PIXEL02_1M Interp1(pOut+2*sizeof(uintX), c32[5], c32[3]);
-#define PIXEL02_1U Interp1(pOut+2*sizeof(uintX), c32[5], c32[2]);
-#define PIXEL02_1R Interp1(pOut+2*sizeof(uintX), c32[5], c32[6]);
-#define PIXEL02_2 Interp2(pOut+2*sizeof(uintX), c32[5], c32[2], c32[6]);
-#define PIXEL02_4 Interp4(pOut+2*sizeof(uintX), c32[5], c32[2], c32[6]);
-#define PIXEL02_5 Interp5(pOut+2*sizeof(uintX), c32[2], c32[6]);
-#define PIXEL02_C *(reinterpret_cast<uintX*>(pOut+2*sizeof(uintX))) = Manip::copy(c32[5]);
-
-#define PIXEL10_1 Interp1(pOut+BpL, c32[5], c32[4]);
-#define PIXEL10_3 Interp3(pOut+BpL, c32[5], c32[4]);
-#define PIXEL10_6 Interp1(pOut+BpL, c32[4], c32[5]);
-#define PIXEL10_C *(reinterpret_cast<uintX*>(pOut+BpL)) = Manip::copy(c32[5]);
-
-#define PIXEL11 *(reinterpret_cast<uintX*>(pOut+BpL+sizeof(uintX))) = Manip::copy(c32[5]);
-
-#define PIXEL12_1 Interp1(pOut+BpL+2*sizeof(uintX), c32[5], c32[6]);
-#define PIXEL12_3 Interp3(pOut+BpL+2*sizeof(uintX), c32[5], c32[6]);
-#define PIXEL12_6 Interp1(pOut+BpL+2*sizeof(uintX), c32[6], c32[5]);
-#define PIXEL12_C *(reinterpret_cast<uintX*>(pOut+BpL+2*sizeof(uintX))) = Manip::copy(c32[5]);
-
-#define PIXEL20_1M Interp1(pOut+2*BpL, c32[5], c32[7]);
-#define PIXEL20_1D Interp1(pOut+2*BpL, c32[5], c32[8]);
-#define PIXEL20_1L Interp1(pOut+2*BpL, c32[5], c32[4]);
-#define PIXEL20_2 Interp2(pOut+2*BpL, c32[5], c32[8], c32[4]);
-#define PIXEL20_4 Interp4(pOut+2*BpL, c32[5], c32[8], c32[4]);
-#define PIXEL20_5 Interp5(pOut+2*BpL, c32[8], c32[4]);
-#define PIXEL20_C *(reinterpret_cast<uintX*>(pOut+2*BpL)) = Manip::copy(c32[5]);
-
-#define PIXEL21_1 Interp1(pOut+2*BpL+sizeof(uintX), c32[5], c32[8]);
-#define PIXEL21_3 Interp3(pOut+2*BpL+sizeof(uintX), c32[5], c32[8]);
-#define PIXEL21_6 Interp1(pOut+2*BpL+sizeof(uintX), c32[8], c32[5]);
-#define PIXEL21_C *(reinterpret_cast<uintX*>(pOut+2*BpL+sizeof(uintX))) = Manip::copy(c32[5]);
-
-#define PIXEL22_1M Interp1(pOut+2*BpL+2*sizeof(uintX), c32[5], c32[9]);
-#define PIXEL22_1D Interp1(pOut+2*BpL+2*sizeof(uintX), c32[5], c32[8]);
-#define PIXEL22_1R Interp1(pOut+2*BpL+2*sizeof(uintX), c32[5], c32[6]);
-#define PIXEL22_2 Interp2(pOut+2*BpL+2*sizeof(uintX), c32[5], c32[6], c32[8]);
-#define PIXEL22_4 Interp4(pOut+2*BpL+2*sizeof(uintX), c32[5], c32[6], c32[8]);
-#define PIXEL22_5 Interp5(pOut+2*BpL+2*sizeof(uintX), c32[6], c32[8]);
-#define PIXEL22_C *(reinterpret_cast<uintX*>(pOut+2*BpL+2*sizeof(uintX))) = Manip::copy(c32[5]);
-
- static inline bool Diff(unsigned int w1, unsigned int w2)
- {
- YUV1 = RGBtoYUV[w1];
- YUV2 = RGBtoYUV[w2];
- return ( ( (unsigned int)abs(int32(YUV1 & Ymask) - int32(YUV2 & Ymask)) > trY ) ||
- ( (unsigned int)abs(int32(YUV1 & Umask) - int32(YUV2 & Umask)) > trU ) ||
- ( (unsigned int)abs(int32(YUV1 & Vmask) - int32(YUV2 & Vmask)) > trV ) );
- }
-
-public:
-
- static void InitLUTs(void)
- {
- if (InitedLUT) return;
- InitedLUT = true;
-
- int i, j, k, r, g, b, Y, u, v;
-
- for (i=0; i<32; i++)
- for (j=0; j<64; j++)
- for (k=0; k<32; k++)
- {
- r = i << 3;
- g = j << 2;
- b = k << 3;
- Y = (r + g + b) >> 2;
- u = 128 + ((r - b) >> 2);
- v = 128 + ((-r + 2*g -b)>>3);
- RGBtoYUV[ (i << 11) + (j << 5) + k ] = (Y<<16) + (u<<8) + v;
- }
- }
-
- static bool hq3x_32(Texture *tex, int32 sx, int32 sy, int32 Xres, int32 Yres,
- uint8* pOut, int32 dw, int32 dh, int32 BpL, bool clamp_src)
- {
- if (Xres*3!=dw || Yres*3!=dh) return false;
-
- InitLUTs();
-
- int i, j, k;
- int prevline, nextline;
- uint32 w16[10];
- uintS c32[10];
-
- // Source buffer pointers
- int tpitch = tex->width*sizeof(uintS);
- uint8 *pIn = reinterpret_cast<uint8*>(tex->buffer) + sy*tpitch + sx*sizeof(uintS);
- int tex_diff = tpitch - Xres*sizeof(uintX);
-
- int pix_diff = BpL*3-Xres*3*sizeof(uintX);
-
- bool clipX = true;
- bool clipY_Begin = true;
- bool clipY_End = true;
-
- if (!clamp_src && sy!=0) clipY_Begin = false;
- if (!clamp_src && (Yres+sy)<tex->height) clipY_End = false;
-
- // +----+----+----+
- // | | | |
- // | w1 | w2 | w3 |
- // +----+----+----+
- // | | | |
- // | w4 | w5 | w6 |
- // +----+----+----+
- // | | | |
- // | w7 | w8 | w9 |
- // +----+----+----+
-
- for (j=0; j<Yres; j++)
- {
- if (j>0 || !clipY_Begin) prevline = -tpitch; else prevline = 0;
- if (j<Yres-1 || !clipY_End) nextline = tpitch; else nextline = 0;
-
- // Read first 2 columns of pixels
- c32[2] = c32[3] = *reinterpret_cast<uintS*>(pIn + prevline);
- c32[5] = c32[6] = *reinterpret_cast<uintS*>(pIn);
- c32[8] = c32[9] = *reinterpret_cast<uintS*>(pIn + nextline);
-
- w16[2] = w16[3] = Manip::to16bit(c32[2]);
- w16[5] = w16[6] = Manip::to16bit(c32[5]);
- w16[8] = w16[9] = Manip::to16bit(c32[6]);
-
- for (i=0; i<Xres; i++)
- {
- // First col = Prev Second column
- c32[1] = c32[2];
- c32[4] = c32[5];
- c32[7] = c32[8];
- w16[1] = w16[2];
- w16[4] = w16[5];
- w16[7] = w16[8];
-
- // Second col = Prev Third column
- c32[2] = c32[3];
- c32[5] = c32[6];
- c32[8] = c32[9];
- w16[2] = w16[3];
- w16[5] = w16[6];
- w16[8] = w16[9];
-
- // Read Next Pixel
- if (i<Xres-1 || !clipX)
- {
- c32[3] = *reinterpret_cast<uintS*>(pIn + sizeof(uintS) + prevline);
- c32[6] = *reinterpret_cast<uintS*>(pIn + sizeof(uintS));
- c32[9] = *reinterpret_cast<uintS*>(pIn + sizeof(uintS) + nextline);
- w16[3] = Manip::to16bit(c32[3]);
- w16[6] = Manip::to16bit(c32[6]);
- w16[9] = Manip::to16bit(c32[9]);
- }
-
- int pattern = 0;
- int flag = 1;
-
- YUV1 = RGBtoYUV[w16[5]];
-
- for (k=1; k<=9; k++)
- {
- if (k==5) continue;
-
- if ( w16[k] != w16[5] )
- {
- YUV2 = RGBtoYUV[w16[k]];
- if ( ( (unsigned int)abs(int32(YUV1 & Ymask) - int32(YUV2 & Ymask)) > trY ) ||
- ( (unsigned int)abs(int32(YUV1 & Umask) - int32(YUV2 & Umask)) > trU ) ||
- ( (unsigned int)abs(int32(YUV1 & Vmask) - int32(YUV2 & Vmask)) > trV ) )
- pattern |= flag;
- }
- flag <<= 1;
- }
-
- switch (pattern)
- {
- case 0:
- case 1:
- case 4:
- case 32:
- case 128:
- case 5:
- case 132:
- case 160:
- case 33:
- case 129:
- case 36:
- case 133:
- case 164:
- case 161:
- case 37:
- case 165:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_2
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_2
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 2:
- case 34:
- case 130:
- case 162:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_2
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 16:
- case 17:
- case 48:
- case 49:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_2
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 64:
- case 65:
- case 68:
- case 69:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_2
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 8:
- case 12:
- case 136:
- case 140:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_2
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 3:
- case 35:
- case 131:
- case 163:
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_2
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 6:
- case 38:
- case 134:
- case 166:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_2
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 20:
- case 21:
- case 52:
- case 53:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_2
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 144:
- case 145:
- case 176:
- case 177:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_2
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 192:
- case 193:
- case 196:
- case 197:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_2
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 96:
- case 97:
- case 100:
- case 101:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_2
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 40:
- case 44:
- case 168:
- case 172:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_2
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 9:
- case 13:
- case 137:
- case 141:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_2
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 18:
- case 50:
- {
- PIXEL00_1M
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_1M
- PIXEL12_C
- }
- else
- {
- PIXEL01_3
- PIXEL02_4
- PIXEL12_3
- }
- PIXEL10_1
- PIXEL11
- PIXEL20_2
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 80:
- case 81:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL20_1M
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL21_C
- PIXEL22_1M
- }
- else
- {
- PIXEL12_3
- PIXEL21_3
- PIXEL22_4
- }
- break;
- }
- case 72:
- case 76:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_2
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_1M
- PIXEL21_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- PIXEL21_3
- }
- PIXEL22_1M
- break;
- }
- case 10:
- case 138:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL10_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- PIXEL10_3
- }
- PIXEL02_1M
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 66:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 24:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 7:
- case 39:
- case 135:
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_2
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 148:
- case 149:
- case 180:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_2
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 224:
- case 228:
- case 225:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_2
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 41:
- case 169:
- case 45:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_2
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 22:
- case 54:
- {
- PIXEL00_1M
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL01_3
- PIXEL02_4
- PIXEL12_3
- }
- PIXEL10_1
- PIXEL11
- PIXEL20_2
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 208:
- case 209:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL20_1M
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_3
- PIXEL21_3
- PIXEL22_4
- }
- break;
- }
- case 104:
- case 108:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_2
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- PIXEL21_3
- }
- PIXEL22_1M
- break;
- }
- case 11:
- case 139:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL10_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- PIXEL10_3
- }
- PIXEL02_1M
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 19:
- case 51:
- {
- if (Diff(w16[2], w16[6]))
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1M
- PIXEL12_C
- }
- else
- {
- PIXEL00_2
- PIXEL01_6
- PIXEL02_5
- PIXEL12_1
- }
- PIXEL10_1
- PIXEL11
- PIXEL20_2
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 146:
- case 178:
- {
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_1M
- PIXEL12_C
- PIXEL22_1D
- }
- else
- {
- PIXEL01_1
- PIXEL02_5
- PIXEL12_6
- PIXEL22_2
- }
- PIXEL00_1M
- PIXEL10_1
- PIXEL11
- PIXEL20_2
- PIXEL21_1
- break;
- }
- case 84:
- case 85:
- {
- if (Diff(w16[6], w16[8]))
- {
- PIXEL02_1U
- PIXEL12_C
- PIXEL21_C
- PIXEL22_1M
- }
- else
- {
- PIXEL02_2
- PIXEL12_6
- PIXEL21_1
- PIXEL22_5
- }
- PIXEL00_2
- PIXEL01_1
- PIXEL10_1
- PIXEL11
- PIXEL20_1M
- break;
- }
- case 112:
- case 113:
- {
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1M
- }
- else
- {
- PIXEL12_1
- PIXEL20_2
- PIXEL21_6
- PIXEL22_5
- }
- PIXEL00_2
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- break;
- }
- case 200:
- case 204:
- {
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1R
- }
- else
- {
- PIXEL10_1
- PIXEL20_5
- PIXEL21_6
- PIXEL22_2
- }
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_2
- PIXEL11
- PIXEL12_1
- break;
- }
- case 73:
- case 77:
- {
- if (Diff(w16[8], w16[4]))
- {
- PIXEL00_1U
- PIXEL10_C
- PIXEL20_1M
- PIXEL21_C
- }
- else
- {
- PIXEL00_2
- PIXEL10_6
- PIXEL20_5
- PIXEL21_1
- }
- PIXEL01_1
- PIXEL02_2
- PIXEL11
- PIXEL12_1
- PIXEL22_1M
- break;
- }
- case 42:
- case 170:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL10_C
- PIXEL20_1D
- }
- else
- {
- PIXEL00_5
- PIXEL01_1
- PIXEL10_6
- PIXEL20_2
- }
- PIXEL02_1M
- PIXEL11
- PIXEL12_1
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 14:
- case 142:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_C
- }
- else
- {
- PIXEL00_5
- PIXEL01_6
- PIXEL02_2
- PIXEL10_1
- }
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 67:
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 70:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 28:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 152:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 194:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 98:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 56:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 25:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 26:
- case 31:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL10_C
- }
- else
- {
- PIXEL00_4
- PIXEL10_3
- }
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL02_4
- PIXEL12_3
- }
- PIXEL11
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 82:
- case 214:
- {
- PIXEL00_1M
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- }
- else
- {
- PIXEL01_3
- PIXEL02_4
- }
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- if (Diff(w16[6], w16[8]))
- {
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL21_3
- PIXEL22_4
- }
- break;
- }
- case 88:
- case 248:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1M
- PIXEL11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- }
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_3
- PIXEL22_4
- }
- break;
- }
- case 74:
- case 107:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- }
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL20_4
- PIXEL21_3
- }
- PIXEL22_1M
- break;
- }
- case 27:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL10_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- PIXEL10_3
- }
- PIXEL02_1M
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 86:
- {
- PIXEL00_1M
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL01_3
- PIXEL02_4
- PIXEL12_3
- }
- PIXEL10_1
- PIXEL11
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 216:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL20_1M
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_3
- PIXEL21_3
- PIXEL22_4
- }
- break;
- }
- case 106:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1M
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- PIXEL21_3
- }
- PIXEL22_1M
- break;
- }
- case 30:
- {
- PIXEL00_1M
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL01_3
- PIXEL02_4
- PIXEL12_3
- }
- PIXEL10_C
- PIXEL11
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 210:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL20_1M
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_3
- PIXEL21_3
- PIXEL22_4
- }
- break;
- }
- case 120:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1M
- PIXEL11
- PIXEL12_C
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- PIXEL21_3
- }
- PIXEL22_1M
- break;
- }
- case 75:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL10_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- PIXEL10_3
- }
- PIXEL02_1M
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 29:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 198:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 184:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 99:
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 57:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 71:
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 156:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 226:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 60:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 195:
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 102:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 153:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 58:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 83:
- {
- PIXEL00_1L
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 92:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 202:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 78:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 154:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 114:
- {
- PIXEL00_1M
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_1L
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 89:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 90:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 55:
- case 23:
- {
- if (Diff(w16[2], w16[6]))
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL00_2
- PIXEL01_6
- PIXEL02_5
- PIXEL12_1
- }
- PIXEL10_1
- PIXEL11
- PIXEL20_2
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 182:
- case 150:
- {
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- PIXEL22_1D
- }
- else
- {
- PIXEL01_1
- PIXEL02_5
- PIXEL12_6
- PIXEL22_2
- }
- PIXEL00_1M
- PIXEL10_1
- PIXEL11
- PIXEL20_2
- PIXEL21_1
- break;
- }
- case 213:
- case 212:
- {
- if (Diff(w16[6], w16[8]))
- {
- PIXEL02_1U
- PIXEL12_C
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL02_2
- PIXEL12_6
- PIXEL21_1
- PIXEL22_5
- }
- PIXEL00_2
- PIXEL01_1
- PIXEL10_1
- PIXEL11
- PIXEL20_1M
- break;
- }
- case 241:
- case 240:
- {
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_1
- PIXEL20_2
- PIXEL21_6
- PIXEL22_5
- }
- PIXEL00_2
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- break;
- }
- case 236:
- case 232:
- {
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- PIXEL22_1R
- }
- else
- {
- PIXEL10_1
- PIXEL20_5
- PIXEL21_6
- PIXEL22_2
- }
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_2
- PIXEL11
- PIXEL12_1
- break;
- }
- case 109:
- case 105:
- {
- if (Diff(w16[8], w16[4]))
- {
- PIXEL00_1U
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL00_2
- PIXEL10_6
- PIXEL20_5
- PIXEL21_1
- }
- PIXEL01_1
- PIXEL02_2
- PIXEL11
- PIXEL12_1
- PIXEL22_1M
- break;
- }
- case 171:
- case 43:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL10_C
- PIXEL20_1D
- }
- else
- {
- PIXEL00_5
- PIXEL01_1
- PIXEL10_6
- PIXEL20_2
- }
- PIXEL02_1M
- PIXEL11
- PIXEL12_1
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 143:
- case 15:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_C
- }
- else
- {
- PIXEL00_5
- PIXEL01_6
- PIXEL02_2
- PIXEL10_1
- }
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 124:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1U
- PIXEL11
- PIXEL12_C
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- PIXEL21_3
- }
- PIXEL22_1M
- break;
- }
- case 203:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL10_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- PIXEL10_3
- }
- PIXEL02_1M
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 62:
- {
- PIXEL00_1M
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL01_3
- PIXEL02_4
- PIXEL12_3
- }
- PIXEL10_C
- PIXEL11
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 211:
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL20_1M
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_3
- PIXEL21_3
- PIXEL22_4
- }
- break;
- }
- case 118:
- {
- PIXEL00_1M
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL01_3
- PIXEL02_4
- PIXEL12_3
- }
- PIXEL10_1
- PIXEL11
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 217:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL20_1M
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_3
- PIXEL21_3
- PIXEL22_4
- }
- break;
- }
- case 110:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1R
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- PIXEL21_3
- }
- PIXEL22_1M
- break;
- }
- case 155:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL10_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- PIXEL10_3
- }
- PIXEL02_1M
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 188:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 185:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 61:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 157:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 103:
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 227:
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 230:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 199:
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 220:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_C
- PIXEL11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_3
- PIXEL21_3
- PIXEL22_4
- }
- break;
- }
- case 158:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL01_3
- PIXEL02_4
- PIXEL12_3
- }
- PIXEL10_C
- PIXEL11
- PIXEL20_1M
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 234:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- PIXEL01_C
- PIXEL02_1M
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- PIXEL21_3
- }
- PIXEL22_1R
- break;
- }
- case 242:
- {
- PIXEL00_1M
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL10_1
- PIXEL11
- PIXEL20_1L
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_3
- PIXEL21_3
- PIXEL22_4
- }
- break;
- }
- case 59:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL10_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- PIXEL10_3
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL11
- PIXEL12_C
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_1M
- break;
- }
- case 121:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1M
- PIXEL11
- PIXEL12_C
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- PIXEL21_3
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 87:
- {
- PIXEL00_1L
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL01_3
- PIXEL02_4
- PIXEL12_3
- }
- PIXEL10_1
- PIXEL11
- PIXEL20_1M
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 79:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL10_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- PIXEL10_3
- }
- PIXEL02_1R
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 122:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL11
- PIXEL12_C
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- PIXEL21_3
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 94:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL01_3
- PIXEL02_4
- PIXEL12_3
- }
- PIXEL10_C
- PIXEL11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 218:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL10_C
- PIXEL11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_3
- PIXEL21_3
- PIXEL22_4
- }
- break;
- }
- case 91:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL10_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- PIXEL10_3
- }
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL11
- PIXEL12_C
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 229:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_2
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 167:
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_2
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 173:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_2
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 181:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_2
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 186:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 115:
- {
- PIXEL00_1L
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_1L
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 93:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 206:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 205:
- case 201:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_2
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_1M
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 174:
- case 46:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_1M
- }
- else
- {
- PIXEL00_2
- }
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 179:
- case 147:
- {
- PIXEL00_1L
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_1M
- }
- else
- {
- PIXEL02_2
- }
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_2
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 117:
- case 116:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_1L
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_1M
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 189:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 231:
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_1
- PIXEL11
- PIXEL12_1
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 126:
- {
- PIXEL00_1M
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL01_3
- PIXEL02_4
- PIXEL12_3
- }
- PIXEL11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- PIXEL21_3
- }
- PIXEL22_1M
- break;
- }
- case 219:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL10_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- PIXEL10_3
- }
- PIXEL02_1M
- PIXEL11
- PIXEL20_1M
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_3
- PIXEL21_3
- PIXEL22_4
- }
- break;
- }
- case 125:
- {
- if (Diff(w16[8], w16[4]))
- {
- PIXEL00_1U
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL00_2
- PIXEL10_6
- PIXEL20_5
- PIXEL21_1
- }
- PIXEL01_1
- PIXEL02_1U
- PIXEL11
- PIXEL12_C
- PIXEL22_1M
- break;
- }
- case 221:
- {
- if (Diff(w16[6], w16[8]))
- {
- PIXEL02_1U
- PIXEL12_C
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL02_2
- PIXEL12_6
- PIXEL21_1
- PIXEL22_5
- }
- PIXEL00_1U
- PIXEL01_1
- PIXEL10_C
- PIXEL11
- PIXEL20_1M
- break;
- }
- case 207:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_C
- }
- else
- {
- PIXEL00_5
- PIXEL01_6
- PIXEL02_2
- PIXEL10_1
- }
- PIXEL11
- PIXEL12_1
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 238:
- {
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- PIXEL21_C
- PIXEL22_1R
- }
- else
- {
- PIXEL10_1
- PIXEL20_5
- PIXEL21_6
- PIXEL22_2
- }
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1R
- PIXEL11
- PIXEL12_1
- break;
- }
- case 190:
- {
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- PIXEL22_1D
- }
- else
- {
- PIXEL01_1
- PIXEL02_5
- PIXEL12_6
- PIXEL22_2
- }
- PIXEL00_1M
- PIXEL10_C
- PIXEL11
- PIXEL20_1D
- PIXEL21_1
- break;
- }
- case 187:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- PIXEL10_C
- PIXEL20_1D
- }
- else
- {
- PIXEL00_5
- PIXEL01_1
- PIXEL10_6
- PIXEL20_2
- }
- PIXEL02_1M
- PIXEL11
- PIXEL12_C
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 243:
- {
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_1
- PIXEL20_2
- PIXEL21_6
- PIXEL22_5
- }
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_1M
- PIXEL10_1
- PIXEL11
- break;
- }
- case 119:
- {
- if (Diff(w16[2], w16[6]))
- {
- PIXEL00_1L
- PIXEL01_C
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL00_2
- PIXEL01_6
- PIXEL02_5
- PIXEL12_1
- }
- PIXEL10_1
- PIXEL11
- PIXEL20_1L
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 237:
- case 233:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_2
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_C
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 175:
- case 47:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- }
- else
- {
- PIXEL00_2
- }
- PIXEL01_C
- PIXEL02_1R
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- PIXEL20_1D
- PIXEL21_1
- PIXEL22_2
- break;
- }
- case 183:
- case 151:
- {
- PIXEL00_1L
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_C
- }
- else
- {
- PIXEL02_2
- }
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_2
- PIXEL21_1
- PIXEL22_1D
- break;
- }
- case 245:
- case 244:
- {
- PIXEL00_2
- PIXEL01_1
- PIXEL02_1U
- PIXEL10_1
- PIXEL11
- PIXEL12_C
- PIXEL20_1L
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_C
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 250:
- {
- PIXEL00_1M
- PIXEL01_C
- PIXEL02_1M
- PIXEL11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- }
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_3
- PIXEL22_4
- }
- break;
- }
- case 123:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- }
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_C
- PIXEL21_C
- }
- else
- {
- PIXEL20_4
- PIXEL21_3
- }
- PIXEL22_1M
- break;
- }
- case 95:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL10_C
- }
- else
- {
- PIXEL00_4
- PIXEL10_3
- }
- PIXEL01_C
- if (Diff(w16[2], w16[6]))
- {
- PIXEL02_C
- PIXEL12_C
- }
- else
- {
- PIXEL02_4
- PIXEL12_3
- }
- PIXEL11
- PIXEL20_1M
- PIXEL21_C
- PIXEL22_1M
- break;
- }
- case 222:
- {
- PIXEL00_1M
- if (Diff(w16[2], w16[6]))
- {
- PIXEL01_C
- PIXEL02_C
- }
- else
- {
- PIXEL01_3
- PIXEL02_4
- }
- PIXEL10_C
- PIXEL11
- PIXEL12_C
- PIXEL20_1M
- if (Diff(w16[6], w16[8]))
- {
- PIXEL21_C
- PIXEL22_C
- }
- else
- {
- PIXEL21_3
- PIXEL22_4
- }
- break;
- }
- case 252:
- {
- PIXEL00_1M
- PIXEL01_1
- PIXEL02_1U
- PIXEL11
- PIXEL12_C
- if (Diff(w16[8], w16[4]))
- {
- PIXEL10_C
- PIXEL20_C
- }
- else
- {
- PIXEL10_3
- PIXEL20_4
- }
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL22_C
- }
- else
- {
- PIXEL22_2
- }
- break;
- }
- case 249:
- {
- PIXEL00_1U
- PIXEL01_1
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_C
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- if (Diff(w16[6], w16[8]))
- {
- PIXEL12_C
- PIXEL22_C
- }
- else
- {
- PIXEL12_3
- PIXEL22_4
- }
- break;
- }
- case 235:
- {
- if (Diff(w16[4], w16[2]))
- {
- PIXEL00_C
- PIXEL01_C
- }
- else
- {
- PIXEL00_4
- PIXEL01_3
- }
- PIXEL02_1M
- PIXEL10_C
- PIXEL11
- PIXEL12_1
- if (Diff(w16[8], w16[4]))
- {
- PIXEL20_C
- }
- else
- {
- PIXEL20_2
- }
- PIXEL21_C
- PIXEL22_1R
- break;
- }
- case 111:
- {
Commit: 6b6b49b34d78d48023668b89ac4abc07665863f5
https://github.com/scummvm/scummvm/commit/6b6b49b34d78d48023668b89ac4abc07665863f5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-02-01T15:52:57-08:00
Commit Message:
NUVIE: Compilation fix
Changed paths:
engines/ultima/nuvie/lua/llex.cpp
diff --git a/engines/ultima/nuvie/lua/llex.cpp b/engines/ultima/nuvie/lua/llex.cpp
index 2154ae3..9c6949e 100644
--- a/engines/ultima/nuvie/lua/llex.cpp
+++ b/engines/ultima/nuvie/lua/llex.cpp
@@ -225,7 +225,7 @@ static void buffreplace (LexState *ls, char from, char to) {
#if !defined(getlocaledecpoint)
-#define getlocaledecpoint() (localeconv()->decimal_point[0])
+#define getlocaledecpoint() '.'
#endif
More information about the Scummvm-git-logs
mailing list