Skip to content

Commit

Permalink
DIRECTOR: Remove now useless casts
Browse files Browse the repository at this point in the history
These casts were necessary when color was an int.
It is now an uint32 like the stored colors so warnings are triggered.
  • Loading branch information
lephilousophe committed Jan 11, 2025
1 parent 0cc45aa commit bee4b4e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions engines/director/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ void InkPrimitives<T>::drawPoint(int x, int y, uint32 src, void *data) {
if (p->oneBitImage) {
// One-bit images have a slightly different rendering algorithm for BackgndTrans.
// Foreground colour is used, and background colour is ignored.
*dst = (src == (int)p->colorBlack) ? p->foreColor : *dst;
*dst = (src == p->colorBlack) ? p->foreColor : *dst;
} else {
*dst = (src == (int)p->backColor) ? *dst : src;
*dst = (src == p->backColor) ? *dst : src;
}
break;
case kInkTypeMatte:
Expand Down Expand Up @@ -406,7 +406,7 @@ void InkPrimitives<T>::drawPoint(int x, int y, uint32 src, void *data) {
break;
case kInkTypeTransparent:
if (p->oneBitImage || p->applyColor) {
*dst = src == (int)p->colorBlack ? p->foreColor : *dst;
*dst = src == p->colorBlack ? p->foreColor : *dst;
} else {
// OR dst palette index with src.
// Originally designed for 1-bit mode to make white pixels
Expand All @@ -416,7 +416,7 @@ void InkPrimitives<T>::drawPoint(int x, int y, uint32 src, void *data) {
break;
case kInkTypeNotTrans:
if (p->oneBitImage || p->applyColor) {
*dst = src == (int)p->colorWhite ? p->foreColor : *dst;
*dst = src == p->colorWhite ? p->foreColor : *dst;
} else {
// OR dst palette index with the inverse of src.
*dst = *dst | ~src;
Expand All @@ -435,7 +435,7 @@ void InkPrimitives<T>::drawPoint(int x, int y, uint32 src, void *data) {
break;
case kInkTypeGhost:
if (p->oneBitImage || p->applyColor) {
*dst = src == (int)p->colorBlack ? p->backColor : *dst;
*dst = src == p->colorBlack ? p->backColor : *dst;
} else {
// AND dst palette index with the inverse of src.
// Originally designed for 1-bit mode so that
Expand All @@ -446,7 +446,7 @@ void InkPrimitives<T>::drawPoint(int x, int y, uint32 src, void *data) {
break;
case kInkTypeNotGhost:
if (p->oneBitImage || p->applyColor) {
*dst = src == (int)p->colorWhite ? p->backColor : *dst;
*dst = src == p->colorWhite ? p->backColor : *dst;
} else {
// AND dst palette index with src.
*dst = *dst & src;
Expand Down

0 comments on commit bee4b4e

Please sign in to comment.