more work on overlay renderer:
- moved text rendering to overlay - added grid overlay
This commit is contained in:
@@ -38,11 +38,10 @@ public class JobQueue {
|
||||
* the job to be added to this queue.
|
||||
*/
|
||||
public synchronized void setJobs(ArrayList<JobTile> tiles) {
|
||||
mPriorityQueue.clear();
|
||||
// mPriorityQueue.addAll(tiles);
|
||||
// mPriorityQueue.clear();
|
||||
|
||||
for (int i = 0, n = tiles.size(); i < n; i++) {
|
||||
JobTile tile = tiles.get(i);
|
||||
// tile.state = LOADING;
|
||||
tile.isLoading = true;
|
||||
mPriorityQueue.offer(tile);
|
||||
}
|
||||
@@ -52,11 +51,10 @@ public class JobQueue {
|
||||
* Removes all jobs from this queue.
|
||||
*/
|
||||
public synchronized void clear() {
|
||||
for (int i = 0, n = mPriorityQueue.size(); i < n; i++) {
|
||||
JobTile tile = mPriorityQueue.poll();
|
||||
// tile.state = 0;
|
||||
for (JobTile tile : mPriorityQueue) {
|
||||
tile.isLoading = false;
|
||||
}
|
||||
|
||||
mPriorityQueue.clear();
|
||||
}
|
||||
|
||||
@@ -71,8 +69,6 @@ public class JobQueue {
|
||||
* @return the most important job from this queue or null, if empty.
|
||||
*/
|
||||
public synchronized JobTile poll() {
|
||||
JobTile tile = mPriorityQueue.poll();
|
||||
|
||||
return tile;
|
||||
return mPriorityQueue.poll();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,9 +61,11 @@ public class MapWorker extends PausableThread {
|
||||
protected void doWork() {
|
||||
JobTile tile = mJobQueue.poll();
|
||||
|
||||
if (mMapGenerator == null || tile == null)
|
||||
if (tile == null)
|
||||
return;
|
||||
|
||||
// Log.d("...", "load: " + tile);
|
||||
|
||||
boolean success = mMapGenerator.executeJob(tile);
|
||||
|
||||
if (!isInterrupted() && success) {
|
||||
|
||||
Reference in New Issue
Block a user