Wing Commander II
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
streamfile.cpp
Go to the documentation of this file.
1/*
2 * ix stream-file methods. The filename is inferred from the class;
3 * no diagnostic string names this source file in the retail image.
4 *
5 * Retail address range: 0x0046DD00 - 0x0046DF07 (6 functions).
6 * The initial 16-byte boundary follows ten padding bytes after the
7 * thread helpers. See docs/ORDER.md for compilation-unit evidence.
8 */
9#include "ix.h"
10
11/* Function start: 0x46DD00 */
12unsigned int IxStreamFile::ix_stream_file_read(void *newDestination,
13 unsigned int bytes)
14{
16 EnterCriticalSection(&g_csStreamerFileFifo);
17 if (position + bytes > size)
18 bytes = size - position;
19 if (bytes > 0) {
20 destination = (unsigned char *)newDestination;
21 remaining = bytes;
23 if (previous != 0)
25 if (next == 0)
27 else
30 next = 0;
31 if (g_1_pPlayerReadQueue != 0)
34 }
35 LeaveCriticalSection(&g_csStreamerFileFifo);
36 SetEvent(g_1_hStreamRouseEvent);
37 return bytes;
38}
39
40/* Function start: 0x46DE09 */
41void IxStreamFile::ix_stream_file_seek(unsigned int newPosition)
42{
44 if (newPosition >= 0)
45 position = size < newPosition ? size : newPosition;
46 else
47 position = 0;
48}
49
50/* Function start: 0x46DE5B */
52{
54 return position;
55}
56
57/* Function start: 0x46DE7F */
59{
60 return size;
61}
62
63/* Function start: 0x46DE9B */
65{
66 if ((flags & IX_STREAM_FILE_READING) != 0) {
67 WaitForSingleObject(completionEvent, INFINITE);
68 ResetEvent(completionEvent);
69 }
70}
71
72/* Function start: 0x46DED9 */
Audio classes, DirectSound interfaces and shared ix state.
@ IX_STREAM_FILE_READING
Definition ix.h:299
HANDLE g_1_hStreamRouseEvent
Definition streamer.cpp:37
IxStreamFile * g_48_pPumpIdleFiles
Definition streamer.cpp:19
CRITICAL_SECTION g_csStreamerFileFifo
Definition streamer.cpp:32
IxStreamFile * g_1_pPlayerReadQueue
Definition streamer.cpp:22
unsigned int ix_stream_file_tell(void)
unsigned int ix_stream_file_read(void *destination, unsigned int bytes)
unsigned int remaining
Definition ix.h:392
unsigned char * destination
Definition ix.h:393
unsigned int size
Definition ix.h:388
IxStreamFile * previous
Definition ix.h:395
unsigned int position
Definition ix.h:391
int ix_stream_file_is_reading()
unsigned int ix_stream_file_size(void)
IxStreamFile * next
Definition ix.h:396
void ix_stream_file_seek(unsigned int position)
unsigned int flags
Definition ix.h:385
HANDLE completionEvent
Definition ix.h:394
void ix_stream_file_wait()