예제 #1
0
/*
SP_DrawSPLoadScreen

Draws the single player loading screen - used when skipping the logo movies
*/
void SP_DrawSPLoadScreen( void )
{
	// Load the texture:
	extern const char *Sys_RemapPath( const char *filename );
	void *image = SP_LoadFileWithLanguage( Sys_RemapPath("base\\media\\LoadSP") );

	if( image )
	{
		SP_DrawTexture(image, 512, 512, 0);
		Z_Free(image);
	}
}
예제 #2
0
bool StencilShadow::Initialize()
{
	// Create a vertex shader
    DWORD dwVertexDecl[] =
    {
        D3DVSD_STREAM( 0 ),
        D3DVSD_REG( 0, D3DVSDT_FLOAT3 ),     // v0 = Position
		D3DVSD_REG( 1, D3DVSDT_FLOAT1 ),     // v1 = Extrusion determinant
        D3DVSD_END()
    };

    if(!( CreateVertexShader(Sys_RemapPath("base\\media\\shadow.xvu"), dwVertexDecl, &m_dwVertexShaderShadow)))
		return false;

	return true;
}
예제 #3
0
/********
SP_DoLicense

Draws the license splash to the screen
*********/
void SP_DoLicense(void)
{
	if( Sys_QuickStart() )
		return;

	// Load the license screen
	void *license;
	extern const char *Sys_RemapPath( const char *filename );
	license = SP_LoadFileWithLanguage( Sys_RemapPath( "base\\media\\LicenseScreen" ) );

	if (license)
	{
		SP_DrawTexture(license, 512, 512, 0);
		Z_Free(license);
	}

	SP_LicenseDone = true;
}
예제 #4
0
/*
ERR_DiscFail

Draws the damaged/dirty disc message, looping forever
*/
void ERR_DiscFail(bool poll)
{
	// Load the texture:
	extern const char *Sys_RemapPath( const char *filename );
	void *image = SP_LoadFileWithLanguage( Sys_RemapPath("base\\media\\DiscErr") );

	if( image )
	{
		SP_DrawTexture(image, 512, 512, 0);
		Z_Free(image);
	}

	for (;;)
	{
		extern void MuteBinkSystem(void);
		MuteBinkSystem();

		extern void S_Update_(void);
		S_Update_();
	}
}
예제 #5
0
void Sys_StreamInitialize( void )
{
	// open the sound file
	soundfile	= CreateFile(
		Sys_RemapPath("base\\soundbank\\sound.bnk"),
		GENERIC_READ,
		FILE_SHARE_READ,
		NULL,
		OPEN_EXISTING,
		FILE_ATTRIBUTE_READONLY | FILE_FLAG_RANDOM_ACCESS,
		NULL );

	// fill in the lookup table
	HANDLE	table	= INVALID_HANDLE_VALUE;

	table	= CreateFile(
		Sys_RemapPath("base\\soundbank\\sound.tbl"),
		GENERIC_READ,
		FILE_SHARE_READ,
		NULL,
		OPEN_EXISTING,
		FILE_ATTRIBUTE_NORMAL,
		NULL );

	DWORD	fileSize	= 0;
	fileSize = GetFileSize(
		table,
		NULL);

	int numberOfRecords	= fileSize / ((sizeof(unsigned int) * 3) + 1);

	soundLookup = new VVFixedMap<sound_file_t, unsigned int>(numberOfRecords);

	byte*	tempData	= (byte*)Z_Malloc(fileSize, TAG_TEMP_WORKSPACE, true, 32);
	byte*	restore		= tempData;

	DWORD	bytesRead;

	ReadFile(
		table,
		tempData,
		fileSize,
		&bytesRead,
		NULL );

	if(bytesRead != fileSize)
		Com_Error(0,"Could not read sound index file.\n");

	CloseHandle(table);

	for(int i = 0; i < numberOfRecords; i++)
	{
		unsigned int filecode	= *(unsigned int*)tempData;
		tempData += sizeof(unsigned int);
		unsigned int offset		= *(unsigned int*)tempData;
		tempData += sizeof(unsigned int);
		int size				= *(int*)tempData;
		tempData += sizeof(int);
		unsigned char filenameFlags = *(unsigned char*)tempData;
		tempData++;

		sound_file_t sfile;
		sfile.offset	= offset;
		sfile.size		= size;
		sfile.filenameFlags = filenameFlags;

		soundLookup->Insert(sfile, filecode);
	}

	soundLookup->Sort();
	Z_Free(restore);
#if PROFILE_SOUND
	Sys_LoadSoundCRCFile();
#endif
}
예제 #6
0
bool _buildFileListFromSavedList(void)
{
	// open the file up for reading
	FILE*	in;
	extern const char *Sys_RemapPath( const char *filename );
	in = fopen( Sys_RemapPath( "xbx_filelist" ), "rb" );
	if(!in)
	{
		return false;
	}

	// read in the number of files
	int count;
	if(!(fread(&count,sizeof(count),1,in)))
	{
		fclose(in);
		return false;
	}

	// allocate memory for a temp buffer
	byte*	baseAddr;
	int bufferSize;
	bufferSize	= count * ( 2 * sizeof(int) + MAX_OSPATH );
	buffer		= (byte*)Z_Malloc(bufferSize,TAG_TEMP_WORKSPACE,qtrue,32);
	baseAddr	= buffer;

	// read the rest of the file into a big buffer
	if(!(fread(buffer,bufferSize,1,in)))
	{
		fclose(in);
		Z_Free(baseAddr);
		return false;
	}

	// allocate some memory for s_Files
	s_Files = new VVFixedMap<FileInfo, unsigned int>(count);

	// loop through all the files write out the codes
	int i;
	for(i = 0; i < count; i++)
	{
		FileInfo info;
		unsigned int code;

		// read the code for the file
		code	=  *(int*)buffer;
		buffer	+= sizeof(code);

		// read the filename
		info.name = CopyString((char*)buffer);
		buffer	+= (strlen(info.name) + 1);

		// read the size of the file
		info.size	=  *(int*)buffer;
		buffer		+= sizeof(info.size);

		// save the data - optimization: don't check for dupes!
		s_Files->InsertUnsafe(info, code);
	}

	fclose(in);
	Z_Free(baseAddr);
	return true;
}