/[gzz]/gzz/gfx/libpaper/textures.py
ViewVC logotype

Diff of /gzz/gfx/libpaper/textures.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13 by jvk, Mon Oct 7 12:14:04 2002 UTC revision 1.14 by jvk, Mon Oct 7 12:43:23 2002 UTC
# Line 9  Line 9 
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
# Line 18  isNV2X = 0 Line 17  isNV2X = 0
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            
# Line 39  def getCachedTexture(args): Line 40  def getCachedTexture(args):
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]
# Line 50  def getCachedTexture(args): Line 51  def getCachedTexture(args):
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:

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26