コード例 #1
0
void OctreeBrickPoolManagerDisk::BrickEntry::decreaseAllInUse() {
    tgtAssert(isInUse(0,0), "Underflow. No thread is using the brick in 1.channel!");
    tgtAssert(isInUse(1,0), "Underflow. No thread is using the brick in 2.channel!");
    tgtAssert(isInUse(2,0), "Underflow. No thread is using the brick in 3.channel!");
    tgtAssert(isInUse(3,0), "Underflow. No thread is using the brick in 4.channel!");
    entry_ -= 9360; //0010010010010000
}
コード例 #2
0
void OctreeBrickPoolManagerDisk::BrickEntry::increaseAllInUse() {
    tgtAssert(!isInUse(0,6), "Overflow. More than 7 threads are using the brick in 1.channel!");
    tgtAssert(!isInUse(1,6), "Overflow. More than 7 threads are using the brick in 2.channel!");
    tgtAssert(!isInUse(2,6), "Overflow. More than 7 threads are using the brick in 3.channel!");
    tgtAssert(!isInUse(3,6), "Overflow. More than 7 threads are using the brick in 4.channel!");
    entry_ += 9360; //0010010010010000
}
コード例 #3
0
	void ShaderProgram::setUniform(const GLchar *name, float x, float y, float z, float w)
	{
		if (!isInUse())
			use();

		glUniform4f(getUniformLocation(name), x, y, z, w);
	}
コード例 #4
0
ファイル: Resource.cpp プロジェクト: jameshanlon/tool_axe
void EventableResource::eventableSetInUseOff()
{
    if (!isInUse())
        return;
    clearOwner();
    Resource::setInUse(false);
}
コード例 #5
0
ファイル: GLSLProgram.cpp プロジェクト: npapier/oglpp
const std::vector< GLSLProgram::UniformInformations > GLSLProgram::getActiveUniforms() const
{
	if ( isInUse() )
	{
		// number of active uniforms
		GLint numUniforms;
		glGetProgramiv( getProgramObject(), GL_ACTIVE_UNIFORMS, &numUniforms );

		GLint maxLength;
		glGetProgramiv( getProgramObject(), GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxLength );

		std::vector< UniformInformations > uniforms(numUniforms, UniformInformations(maxLength) );

		// for each uniform, do
		for( GLint index = 0; index< numUniforms; ++index )
		{
			UniformInformations& uniform = uniforms[index];
			glGetActiveUniform(	getProgramObject(), index,
								uniform.name.size(), 0,
								&uniform.size, &uniform.type, &uniform.name[0] );
		}
		return uniforms;
	}
	else
	{
		std::vector< UniformInformations > uniforms;
		return uniforms;
	}
}
コード例 #6
0
	void ShaderProgram::setUniform(const GLchar *name, bool x)
	{
		if (!isInUse())
			use();

		glUniform1i(getUniformLocation(name), x);
	}
コード例 #7
0
	void ShaderProgram::setUniform(const GLchar *name, unsigned int x)
	{
		if (!isInUse())
			use();

		glUniform1ui(getUniformLocation(name), x);
	}
コード例 #8
0
ファイル: Resource.cpp プロジェクト: jameshanlon/tool_axe
void EventableResource::eventableSetInUseOn(Thread &t)
{
    if (isInUse())
        clearOwner();
    vector = 0;
    EV = getID();
    eventsEnabled = false;
    interruptMode = false;
    owner = &t;
    Resource::setInUse(true);
}
コード例 #9
0
ファイル: setpoint.cpp プロジェクト: item28/tosqa-ssb
// add a next setpoint for the stepper to go to, will wait if queue is full
void setpointAdd (const Setpoint& s) {
    // TODO: silly approach, should use first/last indices into circular buffer
    for (int i = 0; i <= SETPOINT_QUEUE_SIZE; ++i)
        if (!isInUse(i)) {
            setInUse(i);
            setpoint.setpoints[i] = s;
            chMBPost(&setpoint.mailbox, i, TIME_INFINITE);
            return;
        }
    // never reached
}
コード例 #10
0
// Spins until frame becomes available or decoding
// gets canceled.
// If the requested frame is available the method returns true.
// If decoding was interupted before the requested frame becomes
// available, the method returns false.
bool
FrameQueue::waitUntilFrameAvailable(int nPictureIndex)
{
    while (isInUse(nPictureIndex))
    {
        sleep(1);   // Decoder is getting too far ahead from display
        if (isEndOfDecode())
            return false;
    }

    return true;
}
コード例 #11
0
static ScheduledLightEvent * findUnusedEvent(void)
{
    int i;
    ScheduledLightEvent * event = eventList;

    for (i = 0; i < MAX_EVENTS; i++, event++)
    {
        if (!isInUse(event))
            return event;
    }
    return NULL;
}
コード例 #12
0
ファイル: FrameQueue.cpp プロジェクト: ttyio/videopp
bool FrameQueue::waitUntilFrameAvailable(int nPictureIndex)
{
    while (isInUse(nPictureIndex))
    {
        sleep(1);   

        if (bEndOfDecode_){
            return false;
        }
    }

    return true;
}
コード例 #13
0
ファイル: auxeffectslot.cpp プロジェクト: kcat/alure
void ALAuxiliaryEffectSlot::release()
{
    CheckContext(mContext);
    if(isInUse())
        throw std::runtime_error("AuxiliaryEffectSlot is in use");

    alGetError();
    mContext->alDeleteAuxiliaryEffectSlots(1, &mId);
    if(alGetError() != AL_NO_ERROR)
        throw std::runtime_error("AuxiliaryEffectSlot failed to delete");
    mId = 0;

    delete this;
}
コード例 #14
0
static ScheduledLightEvent * findUnusedEvent(void)
{
    int i;
    ScheduledLightEvent * event = 0;

    for (i = 0; i < MAX_EVENTS; i++)
    {
        if (!isInUse(&eventList[i]))
        {
            event = &eventList[i];
            return event;
        }
    }
    return NULL;
}
コード例 #15
0
ファイル: anim.cpp プロジェクト: Nitrus/residualvm
void AnimSkeleton::onGameLoop() {
	Anim::onGameLoop();

	if (isInUse() && _totalTime) {
		uint32 newTime = _currentTime + StarkGlobal->getMillisecondsPerGameloop();

		if (!_loop && newTime > _totalTime) {
			if (_actionItem) {
				_actionItem->resetActionAnim();
				_actionItem = nullptr;
			}
		} else {
			_currentTime = newTime % _totalTime;
			_visual->setTime(_currentTime);
		}
	}
}
コード例 #16
0
ファイル: anim.cpp プロジェクト: Nitrus/residualvm
void AnimVideo::onGameLoop() {
	if (!_smacker || !isInUse()) {
		return; // Animation not in use, no need to update the movie
	}

	if (_smacker->isDone()) {
		// The last frame has been reached
		if (!_loop && _actionItem) {
			// Reset our item if needed
			_actionItem->resetActionAnim();
			_actionItem = nullptr;
		}

		if (_loop) {
			_smacker->rewind();
		}
	}

	if (!_smacker->isDone()) {
		_smacker->update();
		updateSmackerPosition();
	}
}
コード例 #17
0
ファイル: TankEngine.cpp プロジェクト: drkvogel/retrasst
bool  TankEngine::findNextSlot(  TankSectionRackSlot & tsrs )
{

// Is there a currently selected tank to use

	if( sli.rackSlots == BRUNKNOWN_INT ){return false; }

	TankSectionRackSlot t1=tsrs;
//
	if( t1.slot >= sli.rackSlots )
	{
// Move on to the first slot in the next Rack
		t1.slot = 1;
		int lastRack,firstRack;
		lastRack= BRUNKNOWN_INT;
		for( Range< LCDbSectionDef > r = LCDbSectionDefs::records(); r.isValid(); ++ r )
		{
			if( r->getTankLayoutCID() == sli.rackLayoutID  && tsrs.fillOrder == r->getFillOrder() )
			{
				lastRack= r->getLastRack();
				firstRack= r->getFirstRack();
			}
		}

		if( t1.rack >= lastRack )
		{
// All the racks in the section are full move on to the next section.
			t1.rack = firstRack;
			bool isNextSection;		isNextSection = false;
			std::string nextSection;		nextSection = "";
			int nextFillOrder;		nextFillOrder= BRUNKNOWN_INT;

//			isNextSection=incSection(t1.section,nextSection,sli.tankCID);
			isNextSection=incSection(t1.fillOrder,sli.tankCID, nextFillOrder,nextSection,t1.rack);

			if( ! isNextSection )
			{
// All the sections in the tank have been used up. Ask for a new tank.
				return false;
			}
			t1.fillOrder= nextFillOrder;
//			t1.section=nextSection;
		}
		else t1.rack++;		// moved: NG, 19/5/09

	}else
	{
		t1.slot ++;
	}

// The next slot in the storage system has already been taken up.
	if(isInUse(t1))
	{
		return false;
	}else
	{
		tsrs.tank    = t1.tank;
		tsrs.fillOrder = t1.fillOrder;
//		tsrs.section = t1.section;
		tsrs.rack    = t1.rack;
		tsrs.slot	 = t1.slot;
		return true;
	}
}
コード例 #18
0
	void ShaderProgram::use() const
	{
		if (!isInUse())
			glUseProgram(m_program);
	}
コード例 #19
0
ファイル: ShaderProgram.cpp プロジェクト: Kitsune001/Dunjun
void ShaderProgram::checkInUse() const
{
	if (!isInUse())
		panic("ShaderProgram not is use.");
}
コード例 #20
0
ファイル: ShaderProgram.cpp プロジェクト: Kitsune001/Dunjun
void ShaderProgram::stopUsing() const
{
	if (isInUse())
		glUseProgram(0);
}
コード例 #21
0
ファイル: ShaderProgram.cpp プロジェクト: Kitsune001/Dunjun
void ShaderProgram::use() const
{
	if (!isInUse())
		glUseProgram(handle);
}
コード例 #22
0
bool OctreeBrickPoolManagerDisk::BrickEntry::isInUse(uint16_t threshold) {
    return (isInUse(0,threshold) || isInUse(1,threshold) || isInUse(2,threshold) || isInUse(3,threshold));

}
コード例 #23
0
void OctreeBrickPoolManagerDisk::BrickEntry::decreaseInUse(size_t channel) {
    tgtAssert(channel < 4, "channel not between 0 and 3!");
    tgtAssert(isInUse(channel,0), "Underflow. No thread is using the brick!");
    entry_ -= (uint16_t)(1) << (4+3*channel);
}
コード例 #24
0
void ShaderProgram::stopUsing()const{
    assert(isInUse());
    glUseProgram(0);
}
コード例 #25
0
void ShaderProgram::setUniform(const GLchar* name, const glm::mat4& m, GLboolean transpose) {
    assert(isInUse());
    glUniformMatrix4fv(uniform(name), 1, transpose, glm::value_ptr(m));
}
コード例 #26
0
void ShaderProgram::setUniformMatrix4(const GLchar* name, const GLfloat* v, GLsizei count, GLboolean transpose) {
    assert(isInUse());
    glUniformMatrix4fv(uniform(name), count, transpose, v);
}
コード例 #27
0
 // test if an index position is valid in this table.
 inline bool isIndexValid(ItemLink i)
 {
     return i < totalSize && isInUse(i);
 }