示例#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);
     }
 }
示例#2
0
 private void asyncCheckVertex(VertexInfo vertex, VertexInfo vertexInfo, AsyncEntry asyncEntry)
 {
     if (!vertex.Equals(vertexInfo, asyncEntry.count))
     {
         VertexAlreadyChecked = vertexInfo;
         vertex.setDirty();
         asyncLoadVertex(vertexInfo, asyncEntry);
     }
 }
示例#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
         }
     }
 }
示例#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);
                }
            }
        }
示例#5
0
 private void asyncLoadVertex(VertexInfo vertexInfo, AsyncEntry asyncEntry)
 {
     // TODO
 }
示例#6
0
 public virtual void addAsyncEntry(AsyncEntry asyncEntry)
 {
     asyncEntries.add(asyncEntry);
 }