Exemplo n.º 1
0
 public virtual void addAsyncCheck(int prim, int vtype, int count, int indices, int vertices)
 {
     if (Memory.isAddressGood(vertices))
     {
         AsyncEntry asyncEntry = new AsyncEntry(prim, vtype, count, indices, vertices);
         asyncVertexCacheThread.addAsyncEntry(asyncEntry);
     }
 }
Exemplo n.º 2
0
 private void asyncCheckVertex(VertexInfo vertex, VertexInfo vertexInfo, AsyncEntry asyncEntry)
 {
     if (!vertex.Equals(vertexInfo, asyncEntry.count))
     {
         VertexAlreadyChecked = vertexInfo;
         vertex.setDirty();
         asyncLoadVertex(vertexInfo, asyncEntry);
     }
 }
Exemplo n.º 3
0
 public override void run()
 {
     while (!done)
     {
         try
         {
             AsyncEntry asyncEntry = asyncEntries.take();
             if (asyncEntry != null && !done)
             {
                 statistics.start();
                 asyncVertexCache.asyncCheck(asyncEntry);
                 statistics.end();
             }
         }
         catch (InterruptedException)
         {
             // Ignore Exception
         }
     }
 }
Exemplo n.º 4
0
        public virtual void asyncCheck(AsyncEntry asyncEntry)
        {
            vinfo.setDirty();
            vinfo.processType(asyncEntry.vtype);
            vinfo.ptr_vertex = asyncEntry.vertices;
            vinfo.ptr_index  = asyncEntry.indices;
            vinfo.prepareForCache(this, asyncEntry.count, null, 0);

            if (useVertexArray)
            {
                int address = vinfo.ptr_vertex;
                int Length  = vinfo.vertexSize * asyncEntry.count;
                if (Length > 0)
                {
                    VertexBuffer vertexBuffer = VertexBufferManager.Instance.getVertexBuffer(null, address, Length, vinfo.vertexSize, useVertexArray);
                    if (vertexBuffer != null)
                    {
                        Buffer buffer = Memory.Instance.getBuffer(address, Length);
                        vertexBuffer.preLoad(buffer, address, Length);
                    }
                }
            }
            else
            {
                VertexInfo vertex = getVertex(vinfo);

                if (vertex == null)
                {
                    asyncLoadVertex(vinfo, asyncEntry);
                }
                else
                {
                    asyncCheckVertex(vertex, vinfo, asyncEntry);
                }
            }
        }
Exemplo n.º 5
0
 private void asyncLoadVertex(VertexInfo vertexInfo, AsyncEntry asyncEntry)
 {
     // TODO
 }
Exemplo n.º 6
0
 public virtual void addAsyncEntry(AsyncEntry asyncEntry)
 {
     asyncEntries.add(asyncEntry);
 }