Skip to content

Commit

Permalink
GG::GetFixed and PutFixed now take a size argument
Browse files Browse the repository at this point in the history
  • Loading branch information
beholdnec committed Jun 17, 2022
1 parent aa2a3dd commit c1f9b20
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 157 deletions.
114 changes: 57 additions & 57 deletions SRC/ENGINE/ACTOR.CPP

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions SRC/ENGINE/ACTREDIT.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ bool ACTR::FCopy(PACTR *ppactr, bool fEntireScene)
//
for (iaev = _iaevAddCur; iaev < _iaevCur; iaev++)
{
_pggaev->GetFixed(iaev, &aev);
_pggaev->GetFixed(iaev, &aev, sizeof(aev));

// Is this an event we want to copy?
switch (aev.aet)
Expand Down Expand Up @@ -144,7 +144,7 @@ bool ACTR::FCopy(PACTR *ppactr, bool fEntireScene)
//
for (iaev = _iaevCur; iaev < _pggaev->IvMac(); iaev++)
{
_pggaev->GetFixed(iaev, &aev);
_pggaev->GetFixed(iaev, &aev, sizeof(aev));

if ((!fEntireScene) && (aetAdd == aev.aet) && (*ppactr)->_pggaev->IvMac() > 0)
{
Expand Down Expand Up @@ -638,11 +638,11 @@ bool ACTR::FPasteRte(PACTR pactr)
//
for (iaev = _iaevCur; iaev < _pggaev->IvMac(); iaev++)
{
_pggaev->GetFixed(iaev, &aev);
_pggaev->GetFixed(iaev, &aev, sizeof(aev));
if (aev.rtel.irpt > _rtelCur.irpt + crptDel)
{
aev.rtel.irpt += crptNew - crptDel;
_pggaev->PutFixed(iaev, &aev);
_pggaev->PutFixed(iaev, &aev, sizeof(aev));
continue;
}
else
Expand Down Expand Up @@ -799,7 +799,7 @@ bool ACTR::FPaste(long nfrm, SCEN *pscen)
_GetNewOrigin(&xr, &yr, &zr);

Assert(_pggaev->IvMac() > 0, "Nothing to paste!");
_pggaev->GetFixed(0, &aev);
_pggaev->GetFixed(0, &aev, sizeof(AEV));
if (aev.aet != aetAdd)
return fFalse;
dnfrm = aev.nfrm - nfrm;
Expand Down Expand Up @@ -827,11 +827,11 @@ bool ACTR::FPaste(long nfrm, SCEN *pscen)
// Update sound events
for (iaev = 0; iaev < _pggaev->IvMac(); iaev++)
{
_pggaev->GetFixed(iaev, &aev);
_pggaev->GetFixed(iaev, &aev, sizeof(AEV));
if (dnfrm != 0)
{
aev.nfrm -= dnfrm;
_pggaev->PutFixed(iaev, &aev);
_pggaev->PutFixed(iaev, &aev, sizeof(AEV));
}
if (aetSnd != aev.aet)
continue;
Expand Down
10 changes: 5 additions & 5 deletions SRC/ENGINE/ACTRSND.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ bool ACTR::FSetVlmSnd(long sty, bool fMotionMatch, long vlm)
// Set the volume for any events in the actor list for this frame
for (iaev = _iaevFrmMin; iaev < _iaevCur; iaev++)
{
_pggaev->GetFixed(iaev, &aev);
_pggaev->GetFixed(iaev, &aev, sizeof(aev));
if (aev.aet == aetActn)
fActnThisFrame = fTrue;

Expand All @@ -465,7 +465,7 @@ bool ACTR::FSetVlmSnd(long sty, bool fMotionMatch, long vlm)
{
for (iaev = _iaevFrmMin - 1; iaev > 0; iaev--)
{
_pggaev->GetFixed(iaev, &aev);
_pggaev->GetFixed(iaev, &aev, sizeof(aev));

// Quit when the action changes
if (aev.aet == aetActn || (nfrmMM != ivNil && nfrmMM > aev.nfrm))
Expand Down Expand Up @@ -543,7 +543,7 @@ bool ACTR::FQuerySnd(long sty, bool fMotionMatch, PGL *pglTagSnd, long *pvlm, bo
// Non-motion match sounds
for (iaev = _iaevFrmMin; iaev < _iaevCur; iaev++)
{
_pggaev->GetFixed(iaev, &aev);
_pggaev->GetFixed(iaev, &aev, sizeof(aev));
if (aev.aet != aetSnd)
continue;

Expand Down Expand Up @@ -637,7 +637,7 @@ bool ACTR::FDeleteSndCore(long sty, bool fMotionMatch)
iaevFirst = (fMotionMatch) ? _iaevActnCur : _iaevFrmMin;
for (iaev = _iaevCur - 1; iaev >= iaevFirst; iaev--)
{
_pggaev->GetFixed(iaev, &aev);
_pggaev->GetFixed(iaev, &aev, sizeof(aev));
if (fMotionMatch && nfrmMM != ivNil && nfrmMM > aev.nfrm)
break;

Expand Down Expand Up @@ -705,7 +705,7 @@ bool ACTR::FSoundInFrm(void)
{
AEV aev;

_pggaev->GetFixed(iaev, &aev);
_pggaev->GetFixed(iaev, &aev, sizeof(aev));
if (aev.aet == aetSnd)
return fTrue;
}
Expand Down
38 changes: 19 additions & 19 deletions SRC/ENGINE/MOVIE.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ bool MVIE::FReadRollCall(PCRF pcrf, CNO cno, PGST *ppgst, long *paridLim)
imactrMac = (*ppgst)->IvMac();
for (imactr = 0; imactr < imactrMac; imactr++)
{
(*ppgst)->GetExtra(imactr, &mactr, sizeof(MACTR));
(*ppgst)->GetExtra(imactr, &mactr, sizeof(mactr));
if (bo == kboOther)
SwapBytesBom(&mactr, kbomMactr);

Expand All @@ -489,7 +489,7 @@ bool MVIE::FReadRollCall(PCRF pcrf, CNO cno, PGST *ppgst, long *paridLim)
// Open the tags, since they might be TDTs
AssertDo(vptagm->FOpenTag(&mactr.tagTmpl, pcrf), "Should never fail when not copying the tag");

(*ppgst)->PutExtra(imactr, &mactr, sizeof(MACTR));
(*ppgst)->PutExtra(imactr, &mactr, sizeof(mactr));
}

return fTrue;
Expand Down Expand Up @@ -622,7 +622,7 @@ MVIE::~MVIE(void)
{
for (imactr = 0; imactr < _pgstmactr->IvMac(); imactr++)
{
_pgstmactr->GetExtra(imactr, &mactr, sizeof(MACTR));
_pgstmactr->GetExtra(imactr, &mactr, sizeof(mactr));
vptagm->CloseTag(&mactr.tagTmpl);
}
ReleasePpo(&_pgstmactr);
Expand Down Expand Up @@ -774,7 +774,7 @@ bool MVIE::FGetArid(long iarid, long *parid, PSTN pstn, long *pcactRef, PTAG pta
}

_pgstmactr->GetStn(iarid, pstn);
_pgstmactr->GetExtra(iarid, &mactr, sizeof(MACTR));
_pgstmactr->GetExtra(iarid, &mactr, sizeof(mactr));
*parid = mactr.arid;
*pcactRef = mactr.cactRef;
if (pvNil != ptagTmpl)
Expand Down Expand Up @@ -851,7 +851,7 @@ bool MVIE::FChooseArid(long arid)
//
for (imactr = 0; imactr < _pgstmactr->IvMac(); imactr++)
{
_pgstmactr->GetExtra(imactr, &mactr, sizeof(MACTR));
_pgstmactr->GetExtra(imactr, &mactr, sizeof(mactr));
if (mactr.arid == arid)
{
pactr = ACTR::PactrNew(&(mactr.tagTmpl));
Expand Down Expand Up @@ -928,7 +928,7 @@ bool MVIE::FGetName(long arid, PSTN pstn)

for (imactr = 0; imactr < _pgstmactr->IvMac(); imactr++)
{
_pgstmactr->GetExtra(imactr, &mactr, sizeof(MACTR));
_pgstmactr->GetExtra(imactr, &mactr, sizeof(mactr));
if (mactr.arid == arid)
{
_pgstmactr->GetStn(imactr, pstn);
Expand Down Expand Up @@ -963,7 +963,7 @@ bool MVIE::FNameActr(long arid, PSTN pstn)
for (imactr = 0; imactr < _pgstmactr->IvMac(); imactr++)
{

_pgstmactr->GetExtra(imactr, &mactr, sizeof(MACTR));
_pgstmactr->GetExtra(imactr, &mactr, sizeof(mactr));
if (mactr.arid == arid)
{

Expand Down Expand Up @@ -998,7 +998,7 @@ bool MVIE::FIsPropBrwsIarid(long iarid)
AssertIn(iarid, 0, _pgstmactr->IvMac());

MACTR mactr;
_pgstmactr->GetExtra(iarid, &mactr, sizeof(MACTR));
_pgstmactr->GetExtra(iarid, &mactr, sizeof(mactr));
return FPure(mactr.grfbrws & fbrwsProp);
}

Expand All @@ -1019,7 +1019,7 @@ bool MVIE::FIsIaridTdt(long iarid)
AssertIn(iarid, 0, _pgstmactr->IvMac());

MACTR mactr;
_pgstmactr->GetExtra(iarid, &mactr, sizeof(MACTR));
_pgstmactr->GetExtra(iarid, &mactr, sizeof(mactr));
return FPure(mactr.grfbrws & fbrwsTdt);
}

Expand Down Expand Up @@ -1047,12 +1047,12 @@ void MVIE::ChangeActrTag(long arid, PTAG ptag)
for (imactr = 0; imactr < _pgstmactr->IvMac(); imactr++)
{

_pgstmactr->GetExtra(imactr, &mactr, sizeof(MACTR));
_pgstmactr->GetExtra(imactr, &mactr, sizeof(mactr));
if (mactr.arid == arid)
{

mactr.tagTmpl = *ptag;
_pgstmactr->PutExtra(imactr, &mactr, sizeof(MACTR));
_pgstmactr->PutExtra(imactr, &mactr, sizeof(mactr));
return;
}
}
Expand Down Expand Up @@ -1089,7 +1089,7 @@ bool MVIE::FAddToRollCall(ACTR *pactr, PSTN pstn)
for (imactr = 0; imactr < _pgstmactr->IvMac(); imactr++)
{

_pgstmactr->GetExtra(imactr, &mactr, sizeof(MACTR));
_pgstmactr->GetExtra(imactr, &mactr, sizeof(mactr));
if (mactr.arid == pactr->Arid())
{
TAG tagTmpl;
Expand All @@ -1103,7 +1103,7 @@ bool MVIE::FAddToRollCall(ACTR *pactr, PSTN pstn)
// ACTR::GetTagTmpl doesn't AddRef the pcrf, so do it here:
TAGM::DupTag(&tagTmpl);
}
_pgstmactr->PutExtra(imactr, &mactr, sizeof(MACTR));
_pgstmactr->PutExtra(imactr, &mactr, sizeof(mactr));
Pmcc()->UpdateRollCall();
return (fTrue);
}
Expand Down Expand Up @@ -1167,7 +1167,7 @@ void MVIE::RemFromRollCall(ACTR *pactr, bool fDelIfOnlyRef)
//
for (imactr = 0; imactr < _pgstmactr->IvMac(); imactr++)
{
_pgstmactr->GetExtra(imactr, &mactr, sizeof(MACTR));
_pgstmactr->GetExtra(imactr, &mactr, sizeof(mactr));
if (mactr.arid == pactr->Arid())
{
mactr.cactRef--;
Expand All @@ -1179,7 +1179,7 @@ void MVIE::RemFromRollCall(ACTR *pactr, bool fDelIfOnlyRef)
}
else
{
_pgstmactr->PutExtra(imactr, &mactr, sizeof(MACTR));
_pgstmactr->PutExtra(imactr, &mactr, sizeof(mactr));
}

if (mactr.cactRef == 0)
Expand Down Expand Up @@ -2540,7 +2540,7 @@ LRetry:

for (imactr = 0; imactr < _pgstmactr->IvMac();)
{
_pgstmactr->GetExtra(imactr, &mactr, sizeof(MACTR));
_pgstmactr->GetExtra(imactr, &mactr, sizeof(mactr));
if (mactr.cactRef == 0)
{
_pgstmactr->Delete(imactr);
Expand Down Expand Up @@ -4981,7 +4981,7 @@ bool MVIE::_FAddMvieToRollCall(CNO cno, long aridMin)
MACTR mactr;

pgstmactr->GetStn(imactr, &stn);
pgstmactr->GetExtra(imactr, &mactr, sizeof(MACTR));
pgstmactr->GetExtra(imactr, &mactr, sizeof(mactr));

mactr.arid += aridMin;
mactr.cactRef = 0;
Expand Down Expand Up @@ -5067,7 +5067,7 @@ LFail:
imactrMac = _pgstmactr->IvMac();
while (imactr--)
{
_pgstmactr->GetExtra(--imactrMac, &mactr, sizeof(MACTR));
_pgstmactr->GetExtra(--imactrMac, &mactr, sizeof(mactr));
vptagm->CloseTag(&mactr.tagTmpl);
_pgstmactr->Delete(imactrMac);
pgstmactr->Delete(imactr);
Expand All @@ -5077,7 +5077,7 @@ LFail:
imactrMac = pgstmactr->IvMac();
while (imactrMac--)
{
pgstmactr->GetExtra(imactrMac, &mactr, sizeof(MACTR));
pgstmactr->GetExtra(imactrMac, &mactr, sizeof(mactr));
vptagm->CloseTag(&mactr.tagTmpl);
}
ReleasePpo(&pgstmactr);
Expand Down
Loading

0 comments on commit c1f9b20

Please sign in to comment.