From 922c73eeee7ef01ef2a10fa16e5bac3d3e31aa78 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 20 Jun 2019 14:49:16 +0200 Subject: started CStreaming --- src/Streaming.h | 77 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 63 insertions(+), 14 deletions(-) (limited to 'src/Streaming.h') diff --git a/src/Streaming.h b/src/Streaming.h index 18128cff..f31faf9c 100644 --- a/src/Streaming.h +++ b/src/Streaming.h @@ -8,20 +8,25 @@ enum { enum StreamFlags { - STREAM_DONT_REMOVE = 0x01, - STREAM_SCRIPTOWNED = 0x02, - STREAM_DEPENDENCY = 0x04, - STREAM_PRIORITY = 0x08, - STREAM_NOFADE = 0x10, + STREAMFLAGS_DONT_REMOVE = 0x01, + STREAMFLAGS_SCRIPTOWNED = 0x02, + STREAMFLAGS_DEPENDENCY = 0x04, + STREAMFLAGS_PRIORITY = 0x08, + STREAMFLAGS_NOFADE = 0x10, }; enum StreamLoadState { - STREAM_NOTLOADED = 0, - STREAM_LOADED = 1, - STREAM_INQUEUE = 2, - STREAM_READING = 3, // what is this? - STREAM_BIGFILE = 4, + STREAMSTATE_NOTLOADED = 0, + STREAMSTATE_LOADED = 1, + STREAMSTATE_INQUEUE = 2, + STREAMSTATE_READING = 3, // what is this? + STREAMSTATE_BIGFILE = 4, +}; + +enum ChannelState +{ + CHANNELSTATE_0 = 0, }; class CStreamingInfo @@ -36,18 +41,62 @@ public: uint32 m_position; uint32 m_size; -// bool GetCdPosnAndSize(uint32 *pos, uint32 *size); -// void SetCdPosnAndSize(uint32 pos, uint32 size); -// void AddToList(CStreamingInfo *link); -// void RemoveFromList(void); + bool GetCdPosnAndSize(uint32 &posn, uint32 &size); + void SetCdPosnAndSize(uint32 posn, uint32 size); + void AddToList(CStreamingInfo *link); + void RemoveFromList(void); + uint32 GetCdSize(void) { return m_size; } +}; + +struct CStreamingChannel +{ + int32 modelIds[4]; + int32 offsets[4]; + int32 state; + int32 field24; + int32 position; + int32 size; + int32 field30; + int32 status; // from CdStream }; +class CDirectory; + class CStreaming { public: static bool &ms_disableStreaming; + static bool &ms_bLoadingBigModel; static int32 &ms_numModelsRequested; static CStreamingInfo *ms_aInfoForModel; //[NUMSTREAMINFO] + static CStreamingInfo &ms_startLoadedList; + static CStreamingInfo &ms_endLoadedList; + static CStreamingInfo &ms_startRequestedList; + static CStreamingInfo &ms_endRequestedList; + static int32 &ms_oldSectorX; + static int32 &ms_oldSectorY; + static uint32 &ms_streamingBufferSize; + static uint8 **ms_pStreamingBuffer; //[2] + static int32 &ms_memoryUsed; + static CStreamingChannel *ms_channel; //[2] + static int32 &ms_numVehiclesLoaded; + static int32 *ms_vehiclesLoaded; //[MAXVEHICLESLOADED] + static CDirectory *&ms_pExtraObjectsDir; + static int32 &ms_numPriorityRequests; + static bool &ms_hasLoadedLODs; + static int32 &ms_currentPedGrp; + static int32 ms_lastCullZone; + static uint16 &ms_loadedGangs; + static int32 ms_currentPedLoading; + static int32 *ms_imageOffsets; //[NUMCDIMAGES] + static int32 &ms_lastImageRead; + static int32 &ms_imageSize; + static int32 &ms_memoryAvailable; + + static void Init(void); + static void Shutdown(void); + static void LoadCdDirectory(void); + static void LoadCdDirectory(const char *dirname, int n); static void RemoveModel(int32 id); static void RequestModel(int32 model, int32 flags); -- cgit v1.2.3