Ejemplo n.º 1
0
void ObjectParent::SetupTable( char *basename ){
	int		file;
	char	filename[_MAX_PATH];

	#ifdef USE_SH_POOLS
	if ( gBSPLibMemPool == NULL )
	{
		gBSPLibMemPool = MemPoolInit( 0 );
	}
	#endif

	// COBRA - DX - Switching btw Old and New Engine - Select the right Header File
	strcpy( filename, basename );
	// Open the master object file
	strcat( filename, ".DXH" );

	file = open( filename, _O_RDONLY | _O_BINARY | _O_SEQUENTIAL );

	if (file < 0) {
		char message[256];
		sprintf(message, "Failed to open object header file %s\n", filename);
		ShiError( message );
	}

	// Read the format version
	VerifyVersion( file );

	// Read the Color Table from the master file
	TheColorBank.ReadPool( file );

	// Read the Palette Table from the master file
	ThePaletteBank.ReadPool( file );

	// Read the Texture Table from the master file
	TheTextureBank.ReadPool(file,basename);

	// Read the object LOD headers from the master file
	ObjectLOD::SetupTable( file, basename );

	// Read the parent object records from the master file
	ReadParentList( file );

	// Close the master file
	close(file);
}
Ejemplo n.º 2
0
bool CNetworkModule::Init()
{
	// Create the library instance
	m_pLibrary = new CLibrary();

	// Load the net module
	if(!m_pLibrary->Load(SharedUtility::GetAbsolutePath(NETWORK_MODULE_NAME DEBUG_SUFFIX LIBRARY_EXTENSION)))
	{
		//CLogFile::Printf("Failed to load network module!\n");
		return false;
	}

	// Verify the net module version
	if(!VerifyVersion(NETWORK_MODULE_VERSION))
	{
		CLogFile::Printf("Invalid net module version!\n");
		return false;
	}

	// Get pointers to the net module functions
	m_pfnGetNetServerInterface = (GetNetServerInterface_t)m_pLibrary->GetProcedureAddress("GetNetServerInterface");
	m_pfnDestroyNetServerInterface = (DestroyNetServerInterface_t)m_pLibrary->GetProcedureAddress("DestroyNetServerInterface");
	m_pfnGetNetClientInterface = (GetNetClientInterface_t)m_pLibrary->GetProcedureAddress("GetNetClientInterface");
	m_pfnDestroyNetClientInterface = (DestroyNetClientInterface_t)m_pLibrary->GetProcedureAddress("DestroyNetClientInterface");

	// Verify the pointers to the net module functions

	if(!m_pfnGetNetServerInterface || !m_pfnDestroyNetServerInterface 
#ifndef _LINUX
	|| !m_pfnGetNetClientInterface || 
		!m_pfnDestroyNetClientInterface
	#endif
	)
	{
		//CLogFile::Printf("Net module is corrupt!\n");
		return false;
	}
	return true;
}
Ejemplo n.º 3
0
bool
EffectPattern::EffectPatLoad (String file)
{
    bool result = false;
    
    ShowFile show (file);
	
    if (show.open())
    {
		// If we got here, it is structured storage and
		// is supposed to be an EffectFile
		// Try to read the info and points
        if (VerifyVersion(show) == true)
            if (ReadInfo (show) == true)
                if (ReadPoints (show) == true)
                    result = true;

        show.close();
	}

    return result;
}