Migrate image storage from PICT to BMP

This commit is contained in:
elasota
2020-01-18 21:15:07 -05:00
parent 69ef542969
commit 93b4554961
28 changed files with 438 additions and 344 deletions

View File

@@ -97,7 +97,7 @@ void DoAbout (void)
static void HiLiteOkayButton (DrawSurface *surface)
{
#define kOkayButtPICTHiLit 151 // res ID of unhilit button PICT
THandle<Picture> thePict;
THandle<BitmapImage> thePict;
if (!okayButtIsHiLit)
{
@@ -119,7 +119,7 @@ static void HiLiteOkayButton (DrawSurface *surface)
static void UnHiLiteOkayButton (DrawSurface *surface)
{
#define kOkayButtPICTNotHiLit 150 // res ID of hilit button PICT
THandle<Picture> thePict;
THandle<BitmapImage> thePict;
if (okayButtIsHiLit)
{

View File

@@ -679,7 +679,7 @@ void DrawDialogUserText2 (Dialog *dial, short item, StringPtr text)
void LoadDialogPICT (Dialog *theDialog, short item, short theID)
{
THandle<Picture> thePict;
THandle<BitmapImage> thePict;
Rect iRect = theDialog->GetItems()[item - 1].GetWidget()->GetRect();;

View File

@@ -165,12 +165,12 @@ void FindNewActiveRoomRect (void)
void LoadGraphicPlus (DrawSurface *surface, short resID, const Rect &theRect)
{
THandle<Picture> thePicture;
THandle<BitmapImage> thePicture;
thePicture = GetPicture(resID);
if (thePicture == nil)
{
thePicture = GetResource('Date', resID).StaticCast<Picture>();
thePicture = GetResource('Date', resID).StaticCast<BitmapImage>();
if (thePicture == nil)
{
return;

View File

@@ -5,7 +5,7 @@
//----------------------------------------------------------------------------
//============================================================================
#include "BitmapImage.h"
#include "PLResources.h"
#include "PLTextUtils.h"
#include "PLPasStr.h"
@@ -1043,11 +1043,11 @@ void DrawWallWindow (Rect *window)
void DrawCalendar (Rect *theRect)
{
DateTimeRec timeRec;
Rect bounds;
THandle<Picture> thePicture;
Str255 monthStr;
DrawSurface *wasCPort;
DateTimeRec timeRec;
Rect bounds;
THandle<BitmapImage> thePicture;
Str255 monthStr;
DrawSurface *wasCPort;
wasCPort = GetGraphicsPort();
SetGraphicsPort(backSrcMap);
@@ -1056,7 +1056,7 @@ void DrawCalendar (Rect *theRect)
if (thePicture == nil)
RedAlert(kErrFailedGraphicLoad);
bounds = (*thePicture)->picFrame.ToRect();
bounds = (*thePicture)->GetRect();
QOffsetRect(&bounds, -bounds.left, -bounds.top);
QOffsetRect(&bounds, theRect->left, theRect->top);
backSrcMap->DrawPicture(thePicture, bounds);
@@ -1075,14 +1075,14 @@ void DrawCalendar (Rect *theRect)
void DrawBulletin (Rect *theRect)
{
Rect bounds;
THandle<Picture> thePicture;
Rect bounds;
THandle<BitmapImage> thePicture;
thePicture = GetPicture(kBulletinPictID);
if (thePicture == nil)
RedAlert(kErrFailedGraphicLoad);
bounds = (*thePicture)->picFrame.ToRect();
bounds = (*thePicture)->GetRect();
QOffsetRect(&bounds, -bounds.left, -bounds.top);
QOffsetRect(&bounds, theRect->left, theRect->top);
backSrcMap->DrawPicture(thePicture, bounds);
@@ -1093,9 +1093,9 @@ void DrawBulletin (Rect *theRect)
void DrawPictObject (short what, Rect *theRect)
{
Rect bounds;
THandle<Picture> thePicture;
short pictID;
Rect bounds;
THandle<BitmapImage> thePicture;
short pictID;
switch (what)
{

View File

@@ -8,6 +8,7 @@
#include "PLSound.h"
#include "PLToolUtils.h"
#include "PLPasStr.h"
#include "BitmapImage.h"
#include "Externs.h"
#include "House.h"
#include "InputManager.h"
@@ -2005,7 +2006,7 @@ void SelectPrevObject (void)
#ifndef COMPILEDEMO
void GetThisRoomsObjRects (void)
{
THandle<Picture> thePict;
THandle<BitmapImage> thePict;
short i, wide, tall;
isFirstRoom = (GetFirstRoomNumber() == thisRoomNumber);
@@ -2244,7 +2245,7 @@ void GetThisRoomsObjRects (void)
}
else
{
roomObjectRects[i] = (*thePict)->picFrame.ToRect();
roomObjectRects[i] = (*thePict)->GetRect();
}
ZeroRectCorner(&roomObjectRects[i]);
QOffsetRect(&roomObjectRects[i],

View File

@@ -5,7 +5,7 @@
//----------------------------------------------------------------------------
//============================================================================
#include "BitmapImage.h"
#include "Externs.h"
#include "RectUtils.h"
@@ -31,7 +31,7 @@ extern short nHotSpots, numChimes;
void GetObjectRect (objectPtr who, Rect *itsRect)
{
THandle<Picture> thePict;
THandle<BitmapImage> thePict;
short wide, tall;
switch (who->what)
@@ -226,7 +226,7 @@ void GetObjectRect (objectPtr who, Rect *itsRect)
}
else
{
*itsRect = (*thePict)->picFrame.ToRect();
*itsRect = (*thePict)->GetRect();
}
ZeroRectCorner(itsRect);
QOffsetRect(itsRect,

View File

@@ -9,6 +9,7 @@
#include "PLToolUtils.h"
#include "PLPasStr.h"
#include "PLStandardColors.h"
#include "BitmapImage.h"
#include "Externs.h"
#include "FontFamily.h"
#include "House.h"
@@ -237,9 +238,9 @@ Boolean CreateNewRoom (short h, short v)
void ReadyBackground (short theID, short *theTiles)
{
Rect src, dest;
THandle<Picture> thePicture;
short i;
Rect src, dest;
THandle<BitmapImage> thePicture;
short i;
if ((noRoomAtAll) || (!houseUnlocked))
{
@@ -263,7 +264,7 @@ void ReadyBackground (short theID, short *theTiles)
thePicture = GetPicture(theID);
if (thePicture == nil)
{
thePicture = GetResource('Date', theID).StaticCast<Picture>();
thePicture = GetResource('Date', theID).StaticCast<BitmapImage>();
if (thePicture == nil)
{
YellowAlert(kYellowNoBackground, 0);
@@ -271,7 +272,7 @@ void ReadyBackground (short theID, short *theTiles)
}
}
dest = (*thePicture)->picFrame.ToRect();
dest = (*thePicture)->GetRect();
QOffsetRect(&dest, -dest.left, -dest.top);
workSrcMap->DrawPicture(thePicture, dest);
thePicture.Dispose();

View File

@@ -12,6 +12,7 @@
#include "MainWindow.h"
#include "RectUtils.h"
#include "Room.h"
#include "BitmapImage.h"
#define kManholeThruFloor 3957
@@ -131,12 +132,12 @@ void DrawLocale (void)
void LoadGraphicSpecial (DrawSurface *surface, short resID)
{
Rect bounds;
THandle<Picture> thePicture;
THandle<BitmapImage> thePicture;
thePicture = GetPicture(resID);
if (thePicture == nil)
{
thePicture = GetResource('Date', resID).StaticCast<Picture>();
thePicture = GetResource('Date', resID).StaticCast<BitmapImage>();
if (thePicture == nil)
{
thePicture = GetPicture(2000);
@@ -145,7 +146,7 @@ void LoadGraphicSpecial (DrawSurface *surface, short resID)
}
}
bounds = (*thePicture)->picFrame.ToRect();
bounds = (*thePicture)->GetRect();
OffsetRect(&bounds, -bounds.left, -bounds.top);
surface->DrawPicture(thePicture, bounds);

View File

@@ -857,7 +857,7 @@ short ChooseOriginalArt (short was)
Boolean PictIDExists (short theID)
{
THandle<Picture> thePicture;
THandle<BitmapImage> thePicture;
// Handle resHandle;
// Str255 resName;
// ResType resType;
@@ -870,7 +870,7 @@ Boolean PictIDExists (short theID)
thePicture = GetPicture(theID);
if (thePicture == nil)
{
thePicture = GetResource('Date', theID).StaticCast<Picture>();
thePicture = GetResource('Date', theID).StaticCast<BitmapImage>();
if (thePicture == nil)
{
foundIt = false;

View File

@@ -6,6 +6,7 @@
#include "PLResources.h"
#include "BitmapImage.h"
#include "Externs.h"
#include "FontFamily.h"
#include "FontManager.h"
@@ -60,11 +61,11 @@ extern short wasScoreboardMode;
void InitScoreboardMap (void)
{
Rect bounds;
THandle<Picture> thePicture;
DrawSurface *wasCPort;
PLError_t theErr;
short hOffset;
Rect bounds;
THandle<BitmapImage> thePicture;
DrawSurface *wasCPort;
PLError_t theErr;
short hOffset;
wasScoreboardMode = kScoreboardHigh;
boardSrcRect = houseRect;
@@ -79,7 +80,7 @@ void InitScoreboardMap (void)
thePicture = GetPicture(kScoreboardPictID);
if (thePicture == nil)
RedAlert(kErrFailedGraphicLoad);
bounds = (*thePicture)->picFrame.ToRect();
bounds = (*thePicture)->GetRect();
QOffsetRect(&bounds, -bounds.left, -bounds.top);
QOffsetRect(&bounds, hOffset, 0);
boardSrcMap->DrawPicture(thePicture, bounds);

View File

@@ -12,6 +12,7 @@
#include "PLSound.h"
#include "PLTimeTaggedVOSEvent.h"
#include "QDPixMap.h"
#include "BitmapImage.h"
#include "Externs.h"
#include "IconLoader.h"
#include "InputManager.h"
@@ -251,14 +252,14 @@ void KillOffScreenBitMap (GrafPtr offScreen)
void LoadGraphic (DrawSurface *surface, short resID)
{
Rect bounds;
THandle<Picture> thePicture;
Rect bounds;
THandle<BitmapImage> thePicture;
thePicture = GetPicture(resID);
if (thePicture == nil)
RedAlert(kErrFailedGraphicLoad);
bounds = (*thePicture)->picFrame.ToRect();
bounds = (*thePicture)->GetRect();
OffsetRect(&bounds, -bounds.left, -bounds.top);
surface->DrawPicture(thePicture, bounds);
@@ -272,7 +273,7 @@ void LoadGraphic (DrawSurface *surface, short resID)
void LoadScaledGraphic (DrawSurface *surface, short resID, Rect *theRect)
{
THandle<Picture> thePicture;
THandle<BitmapImage> thePicture;
thePicture = GetPicture(resID);
if (thePicture == nil)