Пример #1
0
//cbase
//These last few functions are the highest level wrappers.
int Init(char * path, char * argv) {

   char temp[0x100];

   if(TestStructureAlignment() == 0) { return(0); }
   Sys_InitArgv(argv);

   if(FileSystem_Init(path) == 0) { return(0); }
   if(Sys_InitGame() == 0) { return(0); }

   Q_snprintf(temp, sizeof(temp)-1, "exec %s\n", cvar_servercfgfile.string);
   temp[sizeof(temp)-1] = '\0';
   Cbuf_InsertText(temp);

   #ifdef USE_timeGetTime
    timeBeginPeriod(1);
   #endif

   return(1);
}
int main( int argc, char **argv )
{
    CommandLine()->CreateCmdLine( argc, argv );
    FileSystem_Init( "" );
    PrintHeader();
    LoadShaderDLL( "stdshader_dx6.dll" );
    LoadShaderDLL( "stdshader_dx7.dll" );
    LoadShaderDLL( "stdshader_dx8.dll" );
    LoadShaderDLL( "stdshader_dx9.dll" );
    int i;
    for( i = 0; i < g_ShaderDLLs.Count(); i++ )
    {
        PrintShaderContents( i );
    }
    for( i = 0; i < g_ShaderDLLs.Count(); i++ )
    {
        PrintShaderHelp( i );
    }
    PrintFooter();
    FileSystem_Term();
    return 0;
}
Пример #3
0
GLuint demo5_loadTexture(const char *filepath)
{
    GLuint texID;
    /* load texture */
    texture_t *tex = NULL;
    path_t texPath;
    
    filesystem_t fs;
    FileSystem_Init(&fs);
    
    Path_Init(texPath, fs.resPath);
    Path_AppendPath(texPath, filepath);
    
    tex = TextureLoader_LoadFromFile(texPath);
    Texture_Load(tex);
    Texture_SetWrapMode(tex, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE);
    
    texID = tex->texID;
    Texture_Free(tex);
    
    return texID;
}
Пример #4
0
//-----------------------------------------------------------------------------
// Purpose: 
// Input  : argc - 
//			argv[] - 
// Output : int
//-----------------------------------------------------------------------------
int main( int argc, char* argv[] )
{
	SpewOutputFunc( SpewFunc );
	SpewActivate( "demoinfo", 2 );

	int i;

	for ( i=1 ; i<argc ; i++)
	{
		if ( argv[ i ][ 0 ] == '-' )
		{
			switch( argv[ i ][ 1 ] )
			{
			case 'l':
				uselogfile = true;
				break;
			case 'v':
				verbose = true;
				break;
			case 'g':
				++i;
				break;
			default:
				printusage();
				break;
			}
		}
	}

	if ( argc < 2 || ( i != argc ) )
	{
		PrintHeader();
		printusage();
	}

	CheckLogFile();

	PrintHeader();

	vprint( 0, "    Info for %s..\n", argv[ i - 1 ] );

	char workingdir[ 256 ];
	workingdir[0] = 0;
	Q_getwd( workingdir, sizeof( workingdir ) );

	if ( !FileSystem_Init( NULL, 0, FS_INIT_FULL ) )
		return 1;

	// Add this so relative filenames work.
	g_pFullFileSystem->AddSearchPath( workingdir, "game", PATH_ADD_TO_HEAD );

	// Load the demo
	CSmoothingContext	context;

	LoadSmoothingInfo( argv[ i - 1 ], context );

	// Note to tool makers:  
	// Do your work here!!!
	//Performsmoothing( context );

	// Save out updated .dem file
	// UNCOMMENT THIS TO ENABLE OUTPUTTING NEW .DEM FILES!!!
	// SaveSmoothingInfo( argv[ i - 1 ], context );

	FileSystem_Term();

	return 0;
}
Пример #5
0
main (int argc, char *argv[])
{
	int i;
	CommandLine()->CreateCmdLine( argc, argv );
	SpewOutputFunc( HLFacePoserSpewFunc );
	MathLib_Init( 2.2f, 2.2f, 0.0f, 2.0f );
	CoInitialize(NULL);

	// make sure, we start in the right directory
	char szName[256];
	strcpy (szName, mx::getApplicationPath() );

	mx::init (argc, argv);

	sound->Init();

	FileSystem_Init( true );
	filesystem = (IFileSystem *)(FileSystem_GetFactory()( FILESYSTEM_INTERFACE_VERSION, NULL ));
	if ( !filesystem )
	{
		AssertMsg( 0, "Failed to create/get IFileSystem" );
		return 1;
	}

	char workingdir[ 256 ];
	workingdir[0] = 0;
	Q_getwd( workingdir );

	// If they didn't specify -game on the command line, use VPROJECT.
	CmdLib_InitFileSystem( workingdir, true );

	IFacePoserToolWindow::EnableToolRedraw( false );

	new MDLViewer ();

	g_MDLViewer->setMenuBar (g_MDLViewer->getMenuBar ());
	
	g_pStudioModel->Init();

	bool modelloaded = false;
	for ( i = 1; i < CommandLine()->ParmCount(); i++ )
	{
		if ( Q_stristr (CommandLine()->GetParm( i ), ".mdl") )
		{
			modelloaded = true;
			g_MDLViewer->LoadModelFile( CommandLine()->GetParm( i ) );
			break;
		}
	}

	models->LoadModelList();

	if ( models->Count() == 0 )
	{
		g_pFlexPanel->initFlexes( );
	}

	// Load expressions from last time
	int files = workspacefiles->GetNumStoredFiles( IWorkspaceFiles::EXPRESSION );
	for ( i = 0; i < files; i++ )
	{
		expressions->LoadClass( workspacefiles->GetStoredFile( IWorkspaceFiles::EXPRESSION, i ) );
	}

	IFacePoserToolWindow::EnableToolRedraw( true );

	int retval = mx::run();

	soundemitter->BaseShutdown();

	if (g_pStudioModel)
	{
		g_pStudioModel->Shutdown();
		g_pStudioModel = NULL;
	}

	if (g_pMaterialSystem)
	{
		g_pMaterialSystem->Shutdown();
		g_pMaterialSystem = NULL;
	}

	FileSystem_Term();

	CoUninitialize();

	return retval;
}
Пример #6
0
void CmdLib_InitFileSystem( const char *pFilename, int maxMemoryUsage )
{
	FileSystem_Init( pFilename, maxMemoryUsage );
	if ( !g_pFileSystem )
		Error( "CmdLib_InitFileSystem failed." );
}
Пример #7
0
int main(int argc, char* argv[])
{
    SpewOutputFunc( SceneManagerSpewFunc );

    //
    // make sure, we start in the right directory
    //
    char szName[256];

    strcpy (szName, mx::getApplicationPath ());

    if (argc > 1)
    {
        strcpy (cmdline, argv[1]);
        for (int i = 2; i < argc; i++)
        {
            strcat (cmdline, " ");
            strcat (cmdline, argv[i]);
        }
    }

    mx::init (argc, argv);

    FileSystem_Init( true );
    filesystem = (IFileSystem *)(FileSystem_GetFactory()( FILESYSTEM_INTERFACE_VERSION, NULL ));
    if ( !filesystem )
    {
        AssertMsg( 0, "Failed to create/get IFileSystem" );
        return 1;
    }

    char workingdir[ 256 ];
    workingdir[0] = 0;
    Q_getwd( workingdir );

    char *vproject = getenv("VPROJECT");
    if ( !vproject )
    {
        mxMessageBox( NULL, "You must set VPROJECT to run scenemanager.exe", "SceneManager", MB_OK );
        return -1;
    }

    // If they didn't specify -game on the command line, use VPROJECT.
    CmdLib_InitFileSystem( workingdir, true );

    sound->Init();

    CWorkspaceManager *sm = new CWorkspaceManager();

    bool workspace_loaded = false;
    for ( int i = 1; i < argc; i++ )
    {
        if ( !workspace_loaded && strstr (argv[i], ".vsw") )
        {
            workspace_loaded = true;

            // Strip game directory and slash
            char workspace_name[ 512 ];
            filesystem->FullPathToRelativePath( argv[ i ], workspace_name );

            sm->AutoLoad( workspace_name );
        }
    }

    if ( !workspace_loaded )
    {
        sm->AutoLoad( NULL );
    }

    int retval = mx::run ();

    sound->Shutdown();

    soundemitter->BaseShutdown();

    FileSystem_Term();

    return retval;
}
Пример #8
0
FileSystemQ3API(){
	FileSystem_Init();
	m_filesystemq3 = &GetFileSystem();
}
Пример #9
0
int main(void)
{
	Init();

	DBG_MSG("----- Power On -----");

	if(USBDevice_PlugIn())
	{
		DBG_MSG( "Usb Init Started");
		USB_Init();
	}else{
		DBG_MSG("FileSystem_Init");
		FileSystem_Init();
		fileTest();
	}

	while(true);//Stop here

	char color[] = {0xff, 0xff, 0x00};
	WS2812_Set(0, 3, color);
	color[0] = 0x00;
	color[2] = 0xff;
	WS2812_Set(3, 3, color);
	color[0] = 0xff;
	color[1] = 0x00;
	WS2812_Set(6, 3, color);

	LED_RED(true);
	Delay_ms(200);
	LED_GREEN(true);
	Delay_ms(200);
	LED_BLUE(true);
	

	DBG_MSG("Temperature: %f", TMP102_GetTemp());
	DBG_MSG("Temperature: %f", TMP102_GetTemp());

	// WavePlayer_Init();
	// WavePlayerMenu_Start("/", "teq.wav");
	// WavePlayer_Start();

	// Reflective_Start();

	// Analog_SetChannel(PHOTOTRANS_1_CH, true);
	// Analog_SetChannel(PHOTOTRANS_2_CH, true);
	// Analog_SetChannel(PHOTOTRANS_3_CH, true);
	// Analog_SetChannel(PHOTOTRANS_4_CH, true);
	// Analog_SetChannel(PHOTOTRANS_5_CH, true);

	Delay_ms(2000);

	MPU9250_InitProcedure();

	SysTick_t tick = 0;
	while(true) {
		float accel[3], gyro[3], mag[3];
		float yaw, pitch, roll;


		if(GetSystemTick() - tick > 1000){
			if(MPU9250_CheckNewSample()){
				MPU9250_Get9AxisData(accel, gyro, mag);
				MPU9250_CalcOrientation(&yaw, &pitch, &roll);
			}
			DBG_MSG("Temperature: %f", TMP102_GetTemp());

			// DBG_MSG("ADC: %d %d %d %d %d",
			// 	Analog_GetChannelValue(PHOTOTRANS_1_CH),
			// 	Analog_GetChannelValue(PHOTOTRANS_2_CH),
			// 	Analog_GetChannelValue(PHOTOTRANS_3_CH),
			// 	Analog_GetChannelValue(PHOTOTRANS_4_CH),
			// 	Analog_GetChannelValue(PHOTOTRANS_5_CH)
			// );
			for (int i = 0; i < 3; ++i)
			{
				DBG_MSG("MPU-Accel-%c: %f", i+'X', accel[i]);
			}
			for (int i = 0; i < 3; ++i)
			{
				DBG_MSG("MPU-Gyro-%c: %f", i+'X', gyro[i]);
			}
			for (int i = 0; i < 3; ++i)
			{
				DBG_MSG("MPU-Mag-%c: %f", i+'X', mag[i]);
			}
			DBG_MSG("MPU-Temp: %f", MPU9250_GetTemperature());
			DBG_MSG("yaw: %f, pitch: %f, roll: %f", yaw, pitch, roll);
			tick = GetSystemTick();
		}
	}
}