9 |
# OFFS2 |
# OFFS2 |
10 |
# OFFS3 |
# OFFS3 |
11 |
|
|
|
from gzz.gfx.gl import GL |
|
12 |
|
|
13 |
import java |
import java |
14 |
from math import exp |
from math import exp |
17 |
|
|
18 |
ptextures = {} |
ptextures = {} |
19 |
|
|
|
import os |
|
|
from gfx.libutil.myimport import get_file_ctime |
|
20 |
|
|
21 |
|
# XXX: where should this code be? -------------- |
22 |
|
from gzz.gfx.gl import GL |
23 |
|
from gfx.libutil.myimport import get_file_ctime |
24 |
|
import os |
25 |
if "texcache" not in globals().keys(): |
if "texcache" not in globals().keys(): |
26 |
texcache = {} |
texcache = {} |
27 |
|
|
40 |
os.system("make -C gfx/libtexture " + name + ".bin") |
os.system("make -C gfx/libtexture " + name + ".bin") |
41 |
bintime = get_file_ctime(binfile) |
bintime = get_file_ctime(binfile) |
42 |
|
|
43 |
key = (name, tuple(args[0:7]), tuple(args[7])) |
key = str(args) |
44 |
if texcache.has_key(key) and texcache[(key,"ctime")] == srctime: |
if texcache.has_key(key) and texcache[(key,"ctime")] == srctime: |
45 |
print "Returning cached texture" |
print "Returning cached texture" |
46 |
return texcache[key] |
return texcache[key] |
51 |
texcache[(key,"ctime")] = srctime |
texcache[(key,"ctime")] = srctime |
52 |
print "SHADER: ", res, tex.getTexId() |
print "SHADER: ", res, tex.getTexId() |
53 |
return tex |
return tex |
54 |
|
# ---------------------------------------------- |
55 |
|
|
56 |
|
|
57 |
class NamedTexture: |
class NamedTexture: |