diff --git a/sc2/src/sc2code/comm/melnorm/melnorm.c b/sc2/src/sc2code/comm/melnorm/melnorm.c index f5819f765..e1306719a 100644 --- a/sc2/src/sc2code/comm/melnorm/melnorm.c +++ b/sc2/src/sc2code/comm/melnorm/melnorm.c @@ -230,10 +230,10 @@ ShipWorth (void) } static COUNT rescue_fuel = 0; -static SIS_STATE SIS_copy = -{ - .log_x = 0, -}; + +/* We're relying on this large, #define-dependent-size structure to be + automatically initialized to 0 across the board here. */ +static SIS_STATE SIS_copy; static BOOLEAN StripShip (COUNT fuel_required) diff --git a/sc2/src/sc2code/fmv.c b/sc2/src/sc2code/fmv.c index 8135a1932..ec333cbd9 100644 --- a/sc2/src/sc2code/fmv.c +++ b/sc2/src/sc2code/fmv.c @@ -30,15 +30,6 @@ void LoadMasterShipList (void); //End Added by Chris -static void -DoFMV (char *name, char *loopname, BOOLEAN uninit) -{ - VidPlay ((MEM_HANDLE)name, loopname, uninit); - while (VidPlaying ()) - ; - VidStop (); -} - void DoShipSpin (COUNT index, MUSIC_REF hMusic) { diff --git a/sc2/src/sc2code/intro.c b/sc2/src/sc2code/intro.c index 3be553514..82d4a02f0 100644 --- a/sc2/src/sc2code/intro.c +++ b/sc2/src/sc2code/intro.c @@ -28,13 +28,16 @@ void LoadMasterShipList (void); //End Added by Chris void -DoFMV (char *name, char *loopname) +DoFMV (char *name, char *loopname, BOOLEAN uninit) { - VidPlay((MEM_HANDLE)name, loopname,FALSE); - while(VidPlaying ()) + MEM_HANDLE vidref = 0; + VidPlay (vidref, loopname, uninit); + while(VidPlaying ()) ; - VidStop(); + VidStop(); + (void) name; } + /* //Already defined in fmv.c void Introduction (void) @@ -71,7 +74,7 @@ Introduction (void) SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2)); if (InputState == 0) - DoFMV ("intro", NULL); + DoFMV ("intro", NULL, FALSE); InitGameKernel (); } @@ -86,7 +89,7 @@ Victory (void) xform_buf[0] = FadeAllToBlack; SleepThreadUntil (XFormColorMap ((COLORMAPPTR)xform_buf, ONE_SECOND / 2)); - DoFMV ("victory", NULL); + DoFMV ("victory", NULL, TRUE); InitGameKernel (); } diff --git a/sc2/src/sc2code/libs/graphics/frame.c b/sc2/src/sc2code/libs/graphics/frame.c index 4c20cb7af..ffbfdbe22 100644 --- a/sc2/src/sc2code/libs/graphics/frame.c +++ b/sc2/src/sc2code/libs/graphics/frame.c @@ -142,7 +142,6 @@ DrawBatch (PPRIMITIVE lpBasePrim, PRIM_LINKS PrimLinks, register register GRAPHICS_PRIM PrimType; PPRIMITIVE lpWorkPrim; RECT ClipRect; - FRAMEPTR SrcFramePtr; TFB_Palette color; DWORD c32k; diff --git a/sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c b/sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c index 5eaff8aa2..a0237b243 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c +++ b/sc2/src/sc2code/libs/graphics/sdl/3do_getbody.c @@ -306,7 +306,8 @@ FRAMEPTR Build_Font_Effect (FRAMEPTR FramePtr, Uint32 from, Uint32 to, BYTE type width = GetFrameWidth (FramePtr); height = GetFrameHeight (FramePtr); - NewFrame = CaptureDrawable (CreateDrawable (RAM_DRAWABLE, (SIZE)width, (SIZE)height, 1)); + NewFrame = CaptureDrawable (CreateDrawable ((CREATE_FLAGS)RAM_DRAWABLE, + (SIZE)width, (SIZE)height, 1)); tfbOrigImg = FramePtr->image; OrigImg = (SDL_Surface *)tfbOrigImg->NormalImg; SDL_LockSurface (OrigImg); diff --git a/sc2/src/sc2code/libs/sound/decoders/decoder.c b/sc2/src/sc2code/libs/sound/decoders/decoder.c index a0fde339b..c06c8ee9d 100644 --- a/sc2/src/sc2code/libs/sound/decoders/decoder.c +++ b/sc2/src/sc2code/libs/sound/decoders/decoder.c @@ -427,7 +427,7 @@ uint32 SoundDecoder_Decode (TFB_SoundDecoder *decoder) if (rc < 0) { decoder->error = SOUNDDECODER_ERROR; - fprintf (stderr, "SoundDecoder_Decode(): error decoding %s, code %d\n", decoder->filename, rc); + fprintf (stderr, "SoundDecoder_Decode(): error decoding %s, code %ld\n", decoder->filename, rc); return decoded_bytes; } if (rc == 0 || (close_on_done && buffer_size == (decoded_bytes + rc))) @@ -568,7 +568,7 @@ uint32 SoundDecoder_DecodeAll (TFB_SoundDecoder *decoder) { decoder->error = SOUNDDECODER_ERROR; fprintf (stderr, "SoundDecoder_DecodeAll(): " - "error decoding %s, code %d\n", + "error decoding %s, code %ld\n", decoder->filename, rc); return decoded_bytes; } diff --git a/sc2/src/sc2code/libs/sound/stream.c b/sc2/src/sc2code/libs/sound/stream.c index bc39677d2..1c8bf281a 100644 --- a/sc2/src/sc2code/libs/sound/stream.c +++ b/sc2/src/sc2code/libs/sound/stream.c @@ -375,7 +375,7 @@ StreamDecoderTaskFunc (void *data) if ((error = TFBSound_GetError()) != TFBSOUND_NO_ERROR) { fprintf (stderr, "StreamDecoderTaskFunc(): TFBSound error after TFBSound_SourceQueueBuffers: %x, file %s, source %d, decoded_bytes %d\n", - error, i, soundSource[i].sample->decoder->filename, decoded_bytes); + error, soundSource[i].sample->decoder->filename, i, decoded_bytes); } } } diff --git a/sc2/src/sc2code/libs/sound/trackplayer.c b/sc2/src/sc2code/libs/sound/trackplayer.c index c47f3e81d..378cf05e6 100644 --- a/sc2/src/sc2code/libs/sound/trackplayer.c +++ b/sc2/src/sc2code/libs/sound/trackplayer.c @@ -696,7 +696,7 @@ GetSoundData (void *data) if (delta < 0) { - fprintf (stderr, "GetSoundData(): something's messed with timing, delta %d\n", delta); + fprintf (stderr, "GetSoundData(): something's messed with timing, delta %ld\n", delta); delta = 0; } else if (delta > (int)(soundSource[SPEECH_SOURCE].sbuf_size * 2)) @@ -711,7 +711,8 @@ GetSoundData (void *data) if (pos % 2 == 1) pos++; - assert (pos >= 0); + // pos is an unsigned data type; this assertion cannot fail! + // assert (pos >= 0); for (i = 0; i < RADAR_WIDTH - 2; ++i) { @@ -783,7 +784,8 @@ GetSoundData (void *data) if (pos % 2 == 1) pos++; - assert (pos >= 0); + // pos is an unsigned type; this assertion cannot fail! + // assert (pos >= 0); for (i = 0; i < RADAR_WIDTH - 2; ++i) { diff --git a/sc2/src/sc2code/libs/vidlib.h b/sc2/src/sc2code/libs/vidlib.h index 5b686c56d..71d8c147a 100644 --- a/sc2/src/sc2code/libs/vidlib.h +++ b/sc2/src/sc2code/libs/vidlib.h @@ -43,6 +43,9 @@ extern BOOLEAN DestroyVideo (VIDEO_REF VideoRef); extern VIDEO_TYPE VidPlay (VIDEO_REF VidRef, char *loopname, BOOLEAN uninit); extern void VidStop (void); + +void DoFMV (char *name, char *loopname, BOOLEAN uninit); + /* extern BOOLEAN VidPlaying (void);*/ diff --git a/sc2/src/sc2code/planets/planets.c b/sc2/src/sc2code/planets/planets.c index 16da4007f..9c82173b5 100644 --- a/sc2/src/sc2code/planets/planets.c +++ b/sc2/src/sc2code/planets/planets.c @@ -79,12 +79,15 @@ LoadPlanet (BOOLEAN IsDefined) pPlanetDesc = pSolarSysState->pOrbitalDesc; + + /* if (pPlanetDesc->data_index & PLANET_SHIELDED) - ; /* pSolarSysState->PlanetSideFrame[2] = CaptureDrawable ( + pSolarSysState->PlanetSideFrame[2] = CaptureDrawable ( LoadGraphic (PLANET_SHIELDED_MASK_PMAP_ANIM) - ); */ -// else if (pSolarSysState->SysInfo.PlanetInfo.AtmoDensity != GAS_GIANT_ATMOSPHERE) -// LoadLanderData (); + ); + else if (pSolarSysState->SysInfo.PlanetInfo.AtmoDensity != GAS_GIANT_ATMOSPHERE) + LoadLanderData (); + */ { extern void GeneratePlanetMask (PPLANET_DESC diff --git a/sc2/src/sc2code/planets/solarsys.c b/sc2/src/sc2code/planets/solarsys.c index 657a4a653..ab83198a1 100644 --- a/sc2/src/sc2code/planets/solarsys.c +++ b/sc2/src/sc2code/planets/solarsys.c @@ -1904,8 +1904,13 @@ ExploreSolarSys (void) universe.x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x)); universe.y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y)); + CurStarDescPtr = FindStar (0, &universe, 1, 1); + /* + // The following code used to be there, but the test is + // pointless. Maybe we should panic here? if ((CurStarDescPtr = FindStar (0, &universe, 1, 1)) == 0) ; + */ } GLOBAL_SIS (log_x) = UNIVERSE_TO_LOGX (CurStarDescPtr->star_pt.x); GLOBAL_SIS (log_y) = UNIVERSE_TO_LOGY (CurStarDescPtr->star_pt.y);