示例#1
0
TexDictionary::TexDictionary( const TexDictionary& right ) : RwObject( right )
{
    // Create a new dictionary with all the textures.
    this->hasRecommendedPlatform = right.hasRecommendedPlatform;
    this->recDevicePlatID = right.recDevicePlatID;
    
    this->numTextures = 0;

    LIST_CLEAR( textures.root );

    Interface *engineInterface = right.engineInterface;

    LIST_FOREACH_BEGIN( TextureBase, right.textures.root, texDictNode )

        TextureBase *texture = item;

        // Clone the texture and insert it into us.
        TextureBase *newTex = (TextureBase*)engineInterface->CloneRwObject( texture );

        if ( newTex )
        {
            newTex->AddToDictionary( this );
        }

    LIST_FOREACH_END
}
示例#2
0
inline static void _win32_validateMemory( void )
{
    // Make sure the DebugHeap manager is not damaged.
    LIST_VALIDATE( g_privateMemory.root );

    // Check all blocks in order
    LIST_FOREACH_BEGIN( _memIntro, g_privateMemory.root, memList )
        _win32_checkBlockIntegrity( item + 1 );
    LIST_FOREACH_END
}
示例#3
0
    static LUA_DECLARE( getElements )
    {
        dxElements *dx = (dxElements*)lua_getmethodtrans( L );

        int n = 1;

        lua_createtable( L, dx->numElements, 0 );

        LIST_FOREACH_BEGIN( dxElement, dx->elements.root, envNode )
            item->PushStack( L );
            lua_rawseti( L, -2, n++ );
        LIST_FOREACH_END

        return 1;
    }
示例#4
0
文件: rsys.c 项目: onixion/pandarus
void* rsys_render(void* ptr)
{
    /*
        I didn't want to use any locks in here, but
        it's impossible without. So ... one lock is
        needed for the queue, and one for the flags
        of the renderer.
    */

    struct rsys* rsys = ptr;

    /* make ctt1 the context for this thread */
    if(rsys->table.ctt1_make != NULL)
        rsys->table.ctt1_make();

    int running = 1;
    while(running)
	{
		frame_begin(&rsys->frame);

        /* ### FRAME BEGIN ### */

        glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_ACCUM_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
        glClearColor(rsys->bg_red, rsys->bg_green, rsys->bg_blue, 1.0f); /* read from rsys instead of this */

        //glUseProgram(rsys->vsh);
        //glUseProgram(rsys->fsh);

        /* pull one request from queue per frame */

        rsys_req_t* req = NULL;

        ocn_spin_lock(&rsys->render_reqs_lock);
        queue_pull(&rsys->render_reqs, (void*)&req);
        ocn_spin_unlock(&rsys->render_reqs_lock);

        /*
            Requests with token equal to 0 are NOT! treated special.
            The request struct uses a flag field now ...
        */

        if(req != NULL)
        {
            if(FLAG_GET(req->flags, RSYS_REQ_RENDERER))
            {
                switch(req->type)
                {
                case RSYS_REQ_TYPE_QUIT:
                    running = 0;
                    break;

                case RSYS_REQ_TYPE_BG:
                    break;

                case RSYS_REQ_TYPE_ADD:
                    /* add to render list */
                    break;

                default:
                    break;
                }
            }
        }

        LIST_FOREACH_BEGIN(&rsys->ros)
        ro_entity_t* ro = LIST_ENTRY_DATA;

        if(req != NULL)
        {
            if(!FLAG_GET(req->flags, RSYS_REQ_RENDERER))
            {
                if(ro->token == req->token)
                {
                    switch(req->type)
                    {
                    case RSYS_REQ_TYPE_DEL:
                        break;
                    case RSYS_REQ_TYPE_MAP:
                        break;
                    case RSYS_REQ_TYPE_UNMAP:
                        break;
                    default:
                        break;
                    }
                }
            }
        }

        /* call render function */
/*
        switch(ro->type)
        {
        case RO_TYPE_STATIC_MESH:
            ro_static_mesh_render(&ro->static_mesh);
            break;

        default:
            break;
        }
*/
        LIST_FOREACH_END

        // bad idea... but for now we leave this like this
        // we could make a second queue for cleaning up requests
        free(req);

		if(rsys->table.win_swap != NULL)
            rsys->table.win_swap();

        /* call frame callback */

        //if(ocn.funcs.frame_callback != NULL)
        //    ocn.funcs.frame_callback(0);

        /* ### FRAME END ### */

        frame_wait(&rsys->frame);
        frame_end (&rsys->frame);
        frame_calc(&rsys->frame);
	}

	return NULL;
}