Skip to content

Commit

Permalink
SCI: Remove unneeded casts (thanks to wjp for pointing that out)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegr committed Oct 28, 2011
1 parent 739ceb8 commit 1cc3057
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions engines/sci/engine/kgraphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1666,8 +1666,8 @@ reg_t kBitmap(EngineState *s, int argc, reg_t *argv) {
memset(memoryPtr + BITMAP_HEADER_SIZE, back, width * height);
// Save totalWidth, totalHeight
// TODO: Save the whole bitmap header, like SSCI does
WRITE_LE_UINT16((void *)memoryPtr, width);
WRITE_LE_UINT16((void *)(memoryPtr + 2), height);
WRITE_LE_UINT16(memoryPtr, width);
WRITE_LE_UINT16(memoryPtr + 2, height);
return memoryId;
}
break;
Expand All @@ -1693,8 +1693,8 @@ reg_t kBitmap(EngineState *s, int argc, reg_t *argv) {

byte *memoryPtr = s->_segMan->getHunkPointer(hunkId);
// Get totalWidth, totalHeight
uint16 totalWidth = READ_LE_UINT16((void *)memoryPtr);
uint16 totalHeight = READ_LE_UINT16((void *)(memoryPtr + 2));
uint16 totalWidth = READ_LE_UINT16(memoryPtr);
uint16 totalHeight = READ_LE_UINT16(memoryPtr + 2);
byte *bitmap = memoryPtr + BITMAP_HEADER_SIZE;

GfxView *view = g_sci->_gfxCache->getView(viewNum);
Expand Down Expand Up @@ -1734,8 +1734,8 @@ reg_t kBitmap(EngineState *s, int argc, reg_t *argv) {

byte *memoryPtr = s->_segMan->getHunkPointer(hunkId);
// Get totalWidth, totalHeight
uint16 totalWidth = READ_LE_UINT16((void *)memoryPtr);
uint16 totalHeight = READ_LE_UINT16((void *)(memoryPtr + 2));
uint16 totalWidth = READ_LE_UINT16(memoryPtr);
uint16 totalHeight = READ_LE_UINT16(memoryPtr + 2);
byte *bitmap = memoryPtr + BITMAP_HEADER_SIZE;

GfxFont *font = g_sci->_gfxCache->getFont(fontId);
Expand Down Expand Up @@ -1777,8 +1777,8 @@ reg_t kBitmap(EngineState *s, int argc, reg_t *argv) {

byte *memoryPtr = s->_segMan->getHunkPointer(hunkId);
// Get totalWidth, totalHeight
uint16 totalWidth = READ_LE_UINT16((void *)memoryPtr);
uint16 totalHeight = READ_LE_UINT16((void *)(memoryPtr + 2));
uint16 totalWidth = READ_LE_UINT16(memoryPtr);
uint16 totalHeight = READ_LE_UINT16(memoryPtr + 2);
uint16 width = MIN<uint16>(totalWidth - x, fillWidth);
uint16 height = MIN<uint16>(totalHeight - y, fillHeight);
byte *bitmap = memoryPtr + BITMAP_HEADER_SIZE;
Expand Down
8 changes: 4 additions & 4 deletions engines/sci/graphics/text32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ reg_t GfxText32::createTextBitmap(reg_t textObject, uint16 maxWidth, uint16 maxH
byte *bitmap = memoryPtr + BITMAP_HEADER_SIZE;

// Save totalWidth, totalHeight
WRITE_LE_UINT16((void *)memoryPtr, width);
WRITE_LE_UINT16((void *)(memoryPtr + 2), height);
WRITE_LE_UINT16(memoryPtr, width);
WRITE_LE_UINT16(memoryPtr + 2, height);

int16 charCount = 0;
uint16 curX = 0, curY = 0;
Expand Down Expand Up @@ -141,8 +141,8 @@ void GfxText32::drawTextBitmap(reg_t textObject) {
uint16 textX = planeRect.left + x;
uint16 textY = planeRect.top + y;
// Get totalWidth, totalHeight
uint16 width = READ_LE_UINT16((void *)memoryPtr);
uint16 height = READ_LE_UINT16((void *)(memoryPtr + 2));
uint16 width = READ_LE_UINT16(memoryPtr);
uint16 height = READ_LE_UINT16(memoryPtr + 2);

// Upscale the coordinates/width if the fonts are already upscaled
if (_screen->fontIsUpscaled()) {
Expand Down

0 comments on commit 1cc3057

Please sign in to comment.