Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- } else {
- t1 = c_coreSystem->Milliseconds();
- // Parse asset list now.
- char line[1024];
- while( fgets ( line, 1024, mFile ) )
- {
- char *tmp = cstrdup(line);
- char *mTokens[11]; // I don't know why eleven.
- ncUtils::ParseCSV( tmp, mTokens, sizeof mTokens );
- if( !strcmp( mTokens[0], "image" ) ) { // Load materials.
- if( !strcmp( mTokens[1], "tgau" ) ) { // Uncompressed TGA.
- g_materialManager->LoadImage( mTokens[2], mTokens[3], mTokens[4], NCTGA_IMAGE );
- } else if( !strcmp( mTokens[1], "bmp" ) ) { // Classic BMP.
- g_materialManager->LoadImage( mTokens[2], mTokens[3], mTokens[4], NCBMP_IMAGE );
- }
- ++totalAssets;
- } else if( !strcmp( mTokens[0], "sound" ) ) { // Sounds.
- // sound,wav,ocean,1.0,1.0,false,false,oceanwave
- g_soundManager->LoadSound( mTokens[1], mTokens[2], atof(mTokens[3]), atof(mTokens[4]), StringToBool(mTokens[5]), StringToBool(mTokens[6]), mTokens[7] );
- ++totalAssets;
- } else if( !strcmp( mTokens[0], "shader" ) ) { // GLSL shaders.
- g_shaderManager->Load( mTokens[1] );
- ++totalAssets;
- } else {
- g_Core->Print( LOG_WARN, "Unknown asset type \"%s\" in asset list found.\n", mTokens[0] );
- }
- delete [] tmp;
- }
- t2 = c_coreSystem->Milliseconds();
- g_Core->Print( LOG_INFO, "Asset list \"%s\" with %i assets took %4.2f msec to load.\n", mALName, totalAssets, t2 - t1 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement