コード例 #1
0
ファイル: 3dsLoader.cpp プロジェクト: foxostro/arbarlith2
void _3dsLoader::processNextChunk(Chunk &parentChunk, Wrapper &model) const
{
	while(!parentChunk.endOfFile())
	{
		Chunk currentChunk(parentChunk);

		// It is normal to encounter unknown chunks every once in a while.
		switch(currentChunk.getID())
		{
		case VERSION:		processVersionChunk(currentChunk);				break;
		case OBJECTINFO:	processObjectInfoChunk(currentChunk, model);	break;
		case OBJECT:		processObjectChunk(currentChunk, model);		break;
		case MATERIAL:		processMaterialChunk(currentChunk, model);		break;
		}
	}
}
コード例 #2
0
ファイル: soundfile.cpp プロジェクト: Guildenstern/Tartini
bool SoundFile::setupPlayChunk() {
    int c;
    int n = framesPerChunk();
    int ret = blockingRead(stream, tempWindowBuffer, n);
    if(equalLoudness()) ret = blockingRead(filteredStream, tempWindowBufferFiltered, n);
    if(ret < n) return false;

    lock();
    for(c=0; c<numChannels(); c++) {
        channels(c)->shift_left(n);
        toChannelBuffer(c, n);
        if(gdata->doingActive() && channels(c) == gdata->getActiveChannel()) {
            channels(c)->processChunk(currentChunk()+1);
        }
    }
    setCurrentChunk(currentStreamChunk());
    unlock();
    return true;
}
コード例 #3
0
ファイル: 3dsLoader.cpp プロジェクト: foxostro/arbarlith2
Engine::Model _3dsLoader::loadKeyFrame(const string &fileName) const
{
	// Open the file
	File file(fileName, true);
	if(!file.loaded())
	{
		FAIL("Failed to open 3DS file: " + fileName);
	}

	// Make sure this is a 3DS file
	Chunk currentChunk(file);
	if(currentChunk.getID() != PRIMARY)
	{
		FAIL("PRIMARY chunk not found!  This is not a valid 3DS file: " + fileName);
	}

	// recursively load all chunks
	Wrapper wrapper;
	processNextChunk(currentChunk, wrapper);

	return wrapper.model;
}
コード例 #4
0
ファイル: soundfile.hpp プロジェクト: quicky2000/tartini
//------------------------------------------------------------------------------
double SoundFile::timeAtCurrentChunk(void) const
{
  return timeAtChunk(currentChunk());
}
コード例 #5
0
ファイル: soundfile.cpp プロジェクト: Guildenstern/Tartini
bool SoundFile::inFile()
{
    int c = currentChunk();
    return (c >= 0 && c < totalChunks());
}