summaryrefslogtreecommitdiff
path: root/src/resources/dye/dye.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/dye/dye.cpp')
-rw-r--r--src/resources/dye/dye.cpp125
1 files changed, 0 insertions, 125 deletions
diff --git a/src/resources/dye/dye.cpp b/src/resources/dye/dye.cpp
index 4b6c3e593..0e8f87a78 100644
--- a/src/resources/dye/dye.cpp
+++ b/src/resources/dye/dye.cpp
@@ -159,68 +159,6 @@ void Dye::normalDye(uint32_t *restrict pixels,
if (pixels == nullptr)
return;
-#ifdef ENABLE_CILKPLUS
- cilk_for (int ptr = 0; ptr < bufSize; ptr ++)
- {
- const uint32_t p = pixels[ptr];
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- const int alpha = p & 0xff000000;
-#else // SDL_BYTEORDER == SDL_BIG_ENDIAN
-
- const int alpha = p & 0xff;
-#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
-
- if (alpha)
- {
- unsigned int color[3];
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- color[0] = (p) & 255U;
- color[1] = (p >> 8U) & 255U;
- color[2] = (p >> 16U) & 255U;
-#else // SDL_BYTEORDER == SDL_BIG_ENDIAN
-
- color[0] = (p >> 24U) & 255U;
- color[1] = (p >> 16U) & 255U;
- color[2] = (p >> 8U) & 255U;
-#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
-
- const unsigned int cmax = std::max(
- color[0], std::max(color[1], color[2]));
- if (cmax == 0)
- goto endlabel;
-
- const unsigned int cmin = std::min(
- color[0], std::min(color[1], color[2]));
- const unsigned int intensity = color[0] + color[1] + color[2];
- unsigned int i;
-
- if (cmin != cmax && (cmin != 0 || (intensity != cmax
- && intensity != 2 * cmax)))
- {
- // not pure
- goto endlabel;
- }
-
- i = (color[0] != 0) | ((color[1] != 0) << 1)
- | ((color[2] != 0) << 2);
-
- if (mDyePalettes[i - 1])
- mDyePalettes[i - 1]->getColor(cmax, color);
-
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- pixels[ptr] = (color[0]) | (color[1] << 8)
- | (color[2] << 16) | alpha;
-#else // SDL_BYTEORDER == SDL_BIG_ENDIAN
-
- pixels[ptr] = (color[0] << 24) | (color[1] << 16)
- | (color[2] << 8) | alpha;
-#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
- }
-endlabel:{}
- }
-
-#else // ENABLE_CILKPLUS
-
for (const uint32_t *const p_end = pixels + CAST_SIZE(bufSize);
pixels != p_end;
++ pixels)
@@ -279,7 +217,6 @@ endlabel:{}
| (color[2] << 8) | alpha;
#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
}
-#endif // ENABLE_CILKPLUS
}
void Dye::normalOGLDye(uint32_t *restrict pixels,
@@ -288,67 +225,6 @@ void Dye::normalOGLDye(uint32_t *restrict pixels,
if (pixels == nullptr)
return;
-#ifdef ENABLE_CILKPLUS
- cilk_for (int ptr = 0; ptr < bufSize; ptr ++)
- {
- const uint32_t p = pixels[ptr];
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- const int alpha = p & 255;
-#else // SDL_BYTEORDER == SDL_BIG_ENDIAN
-
- const int alpha = p & 0xff000000;
-#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
-
- if (alpha)
- {
- unsigned int color[3];
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- color[0] = (p >> 24U) & 255U;
- color[1] = (p >> 16U) & 255U;
- color[2] = (p >> 8U) & 255U;
-#else // SDL_BYTEORDER == SDL_BIG_ENDIAN
-
- color[0] = (p) & 255U;
- color[1] = (p >> 8U) & 255U;
- color[2] = (p >> 16U) & 255U;
-#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
-
- const unsigned int cmax = std::max(
- color[0], std::max(color[1], color[2]));
- if (cmax == 0)
- goto endlabel;
-
- const unsigned int cmin = std::min(
- color[0], std::min(color[1], color[2]));
- const unsigned int intensity = color[0] + color[1] + color[2];
-
- if (cmin != cmax && (cmin != 0 || (intensity != cmax
- && intensity != 2 * cmax)))
- {
- // not pure
- goto endlabel;
- }
-
- const unsigned int i = (color[0] != 0) | ((color[1] != 0) << 1)
- | ((color[2] != 0) << 2);
-
- if (mDyePalettes[i - 1])
- mDyePalettes[i - 1]->getColor(cmax, color);
-
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
- pixels[ptr] = (color[0] << 24) | (color[1] << 16)
- | (color[2] << 8) | alpha;
-#else // SDL_BYTEORDER == SDL_BIG_ENDIAN
-
- pixels[ptr] = (color[0]) | (color[1] << 8)
- | (color[2] << 16) | alpha;
-#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
- }
-endlabel:{}
- }
-
-#else // ENABLE_CILKPLUS
-
for (const uint32_t *const p_end = pixels + CAST_SIZE(bufSize);
pixels != p_end;
++ pixels)
@@ -407,5 +283,4 @@ endlabel:{}
| (color[2] << 16) | alpha;
#endif // SDL_BYTEORDER == SDL_BIG_ENDIAN
}
-#endif // ENABLE_CILKPLUS
}