[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ff-cvs] fenfire/org/fenfire/spanimages/gl DefaultSpanIm...
From: |
Tuomas J. Lukka |
Subject: |
[ff-cvs] fenfire/org/fenfire/spanimages/gl DefaultSpanIm... |
Date: |
Sun, 02 Nov 2003 14:20:51 -0500 |
CVSROOT: /cvsroot/fenfire
Module name: fenfire
Branch:
Changes by: Tuomas J. Lukka <address@hidden> 03/11/02 14:20:51
Modified files:
org/fenfire/spanimages/gl: DefaultSpanImageFactory.java
PoolManager.java
Log message:
sync
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/spanimages/gl/DefaultSpanImageFactory.java.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/spanimages/gl/PoolManager.java.diff?tr1=1.16&tr2=1.17&r1=text&r2=text
Patches:
Index: fenfire/org/fenfire/spanimages/gl/DefaultSpanImageFactory.java
diff -u fenfire/org/fenfire/spanimages/gl/DefaultSpanImageFactory.java:1.11
fenfire/org/fenfire/spanimages/gl/DefaultSpanImageFactory.java:1.12
--- fenfire/org/fenfire/spanimages/gl/DefaultSpanImageFactory.java:1.11 Fri Oct
17 05:25:33 2003
+++ fenfire/org/fenfire/spanimages/gl/DefaultSpanImageFactory.java Sun Nov
2 14:20:51 2003
@@ -40,7 +40,7 @@
private static void p(String s) {
System.out.println("DefaultSpanImageFactory: "+s); }
- public PoolManager poolManager = new PoolManager();
+ public PoolManager poolManager = PoolManager.getInstance();
public PaperMaker paperMaker = new PlainPaperMaker();
public ScrollBlockImager scrollBlockImager;
Index: fenfire/org/fenfire/spanimages/gl/PoolManager.java
diff -u fenfire/org/fenfire/spanimages/gl/PoolManager.java:1.16
fenfire/org/fenfire/spanimages/gl/PoolManager.java:1.17
--- fenfire/org/fenfire/spanimages/gl/PoolManager.java:1.16 Fri Oct 31
02:21:15 2003
+++ fenfire/org/fenfire/spanimages/gl/PoolManager.java Sun Nov 2 14:20:51 2003
@@ -38,6 +38,16 @@
private static void p(String s) {
System.out.println("PoolManager: "+s); }
+
+ private static PoolManager instance;
+ /** PoolManager is a singleton class; get (maybe create) the instance.
+ */
+ public static PoolManager getInstance() {
+ if(instance == null)
+ instance = new PoolManager();
+ return instance;
+ }
+
// public int POOLSIZE = 64 * 1024 * 1024;
public float DICELENGTH = 1;
@@ -96,7 +106,7 @@
int[] allocations;
VirtualTexture[][] slotContents;
- public PoolManager() {
+ private PoolManager() {
int scheme = Integer.parseInt(System.getProperty("fenfire.poolalloc",
"1"));
@@ -115,6 +125,10 @@
slotContents = new VirtualTexture[allocations.length][];
for(int i=0; i<allocations.length; i++)
slotContents[i] = new VirtualTexture[allocations[i]];
+
+ bgThread.setDaemon(true);
+ bgThread.setPriority(Thread.MIN_PRIORITY);
+ bgThread.start();
}
/** Make a SpanImageVob whose SingleImage's texture allocation will
@@ -194,11 +208,6 @@
}
};
- {
- bgThread.setDaemon(true);
- bgThread.setPriority(Thread.MIN_PRIORITY);
- bgThread.start();
- }
/** A set of singleimages that are to be locked at
* maximum resolution.
@@ -208,7 +217,7 @@
SingleImage[] templ = new SingleImage[0];
public void updateAllocs() {
SingleImage[] actives = (SingleImage[])activeSet.toArray(templ);
- if(dbg) p("UpdateAllocs start "+actives.length);
+ if(dbg) p("UpdateAllocs start "+actives.length+" "+this);
Arrays.sort(actives, sortPriority);
int level=0; int ind = 0;
for(int i=0; level < slotContents.length &&
@@ -233,7 +242,7 @@
level++;
}
}
- if(dbg) p("UpdateAllocs finish ");
+ if(dbg) p("UpdateAllocs finish "+this);
indirectMipzipManager.setSlotContents(slotContents);
/*
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ff-cvs] fenfire/org/fenfire/spanimages/gl DefaultSpanIm...,
Tuomas J. Lukka <=