annotate pytouhou/ui/texture.pyx @ 421:b1248bab2d0f

Add back music and SFX playback using SDL_mixer instead of pyglet, and add FLAC and Vorbis support.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 16 Jul 2013 21:07:15 +0200
parents 3a7b36324611
children d8630c086926
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
52
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
1 # -*- encoding: utf-8 -*-
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
2 ##
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
3 ## Copyright (C) 2011 Thibaut Girka <thib@sitedethib.com>
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
4 ##
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
5 ## This program is free software; you can redistribute it and/or modify
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
6 ## it under the terms of the GNU General Public License as published
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
7 ## by the Free Software Foundation; version 3 only.
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
8 ##
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
9 ## This program is distributed in the hope that it will be useful,
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
12 ## GNU General Public License for more details.
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
13 ##
ab826bc29aa2 Add some documentation, GPLv3 headers, README and COPYING file.
Thibaut Girka <thib@sitedethib.com>
parents: 25
diff changeset
14
393
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
15 from pyglet.gl import (glTexParameteri, GL_TEXTURE_MIN_FILTER,
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
16 GL_TEXTURE_MAG_FILTER, GL_LINEAR, GL_BGRA, GL_RGBA,
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
17 GL_RGB, GL_LUMINANCE, GL_UNSIGNED_BYTE,
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
18 GL_UNSIGNED_SHORT_5_6_5, GL_UNSIGNED_SHORT_4_4_4_4_REV,
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
19 glGenTextures, glBindTexture, glTexImage2D,
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
20 GL_TEXTURE_2D)
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
21 from ctypes import c_uint, byref
420
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
22 from pytouhou.lib.sdl import load_png, create_rgb_surface
14
07a7f28c8aaa Minor refactoring
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
23 import os
07a7f28c8aaa Minor refactoring
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
24
393
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
25 from pytouhou.formats.thtx import Texture #TODO: perhaps define that elsewhere?
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
26
14
07a7f28c8aaa Minor refactoring
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
27
223
98c64ffcbdff Make pytouhou.ui.{background,texture} Cython modules as they are only used by Cython modules.
Thibaut Girka <thib@sitedethib.com>
parents: 205
diff changeset
28 cdef class TextureManager:
97
ac2e5e1c2c3c Refactor \o/
Thibaut Girka <thib@sitedethib.com>
parents: 83
diff changeset
29 def __init__(self, loader=None):
ac2e5e1c2c3c Refactor \o/
Thibaut Girka <thib@sitedethib.com>
parents: 83
diff changeset
30 self.loader = loader
16
66ce9bb440ac Refactor in order to support multiple textures
Thibaut Girka <thib@sitedethib.com>
parents: 15
diff changeset
31 self.textures = {}
66ce9bb440ac Refactor in order to support multiple textures
Thibaut Girka <thib@sitedethib.com>
parents: 15
diff changeset
32
158
7769ce7be03c Minor cleanup
Thibaut Girka <thib@sitedethib.com>
parents: 119
diff changeset
33
16
66ce9bb440ac Refactor in order to support multiple textures
Thibaut Girka <thib@sitedethib.com>
parents: 15
diff changeset
34 def __getitem__(self, key):
66ce9bb440ac Refactor in order to support multiple textures
Thibaut Girka <thib@sitedethib.com>
parents: 15
diff changeset
35 if not key in self.textures:
66ce9bb440ac Refactor in order to support multiple textures
Thibaut Girka <thib@sitedethib.com>
parents: 15
diff changeset
36 self.textures[key] = self.load_texture(key)
66ce9bb440ac Refactor in order to support multiple textures
Thibaut Girka <thib@sitedethib.com>
parents: 15
diff changeset
37 return self.textures[key]
14
07a7f28c8aaa Minor refactoring
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
38
16
66ce9bb440ac Refactor in order to support multiple textures
Thibaut Girka <thib@sitedethib.com>
parents: 15
diff changeset
39
83
fc0294c745b6 Basic bullet handling! Clean up as soon as possible :p
Thibaut Girka <thib@sitedethib.com>
parents: 52
diff changeset
40 def preload(self, anm_wrapper):
393
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
41 for anm in anm_wrapper:
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
42 anm.texture = self.load_png_texture(anm.first_name, anm.secondary_name)
25
cc864aadc733 Preload enemy and background textures
Thibaut Girka <thib@sitedethib.com>
parents: 16
diff changeset
43
cc864aadc733 Preload enemy and background textures
Thibaut Girka <thib@sitedethib.com>
parents: 16
diff changeset
44
393
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
45 def load_png_texture(self, first_name, secondary_name):
420
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
46 image_file = load_png(self.loader.get_file(os.path.basename(first_name)))
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
47 width, height = image_file.width, image_file.height
368
71cd4461bb7f Minor optimizations
Thibaut Girka <thib@sitedethib.com>
parents: 223
diff changeset
48
420
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
49 # Support only 32 bits RGBA. Paletted surfaces are awful to work with.
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
50 #TODO: verify it doesn’t blow up on big-endian systems.
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
51 new_image = create_rgb_surface(width, height, 32, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000)
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
52 new_image.blit(image_file)
14
07a7f28c8aaa Minor refactoring
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
53
16
66ce9bb440ac Refactor in order to support multiple textures
Thibaut Girka <thib@sitedethib.com>
parents: 15
diff changeset
54 if secondary_name:
420
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
55 alpha_file = load_png(self.loader.get_file(os.path.basename(secondary_name)))
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
56 assert (width == alpha_file.width and
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
57 height == alpha_file.height)
14
07a7f28c8aaa Minor refactoring
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
58
420
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
59 new_alpha_file = create_rgb_surface(width, height, 24)
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
60 new_alpha_file.blit(alpha_file)
14
07a7f28c8aaa Minor refactoring
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
61
420
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
62 new_image.set_alpha(new_alpha_file)
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
63
3a7b36324611 Replace Pyglet’s image loader with our SDL2_image-based one.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 393
diff changeset
64 return Texture(width, height, -4, new_image.pixels)
393
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
65
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
66
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
67 def load_texture(self, key):
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
68 if not isinstance(key, Texture):
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
69 first_name, secondary_name = key
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
70 key = self.load_png_texture(first_name, secondary_name)
15
07fba4e1da65 Refactor
Thibaut Girka <thib@sitedethib.com>
parents: 14
diff changeset
71
393
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
72 if key.fmt == 1:
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
73 format_ = GL_BGRA
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
74 type_ = GL_UNSIGNED_BYTE
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
75 composants = GL_RGBA
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
76 elif key.fmt == 3:
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
77 format_ = GL_RGB
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
78 type_ = GL_UNSIGNED_SHORT_5_6_5
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
79 composants = GL_RGB
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
80 elif key.fmt == 5:
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
81 format_ = GL_BGRA
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
82 type_ = GL_UNSIGNED_SHORT_4_4_4_4_REV
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
83 composants = GL_RGBA
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
84 elif key.fmt == 7:
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
85 format_ = GL_LUMINANCE
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
86 type_ = GL_UNSIGNED_BYTE
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
87 composants = GL_LUMINANCE
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
88 elif key.fmt == -4: #XXX: non-standard
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
89 format_ = GL_RGBA
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
90 type_ = GL_UNSIGNED_BYTE
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
91 composants = GL_RGBA
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
92 else:
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
93 raise Exception('Unknown texture type')
14
07a7f28c8aaa Minor refactoring
Thibaut Girka <thib@sitedethib.com>
parents:
diff changeset
94
393
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
95 id_ = c_uint()
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
96 glGenTextures(1, byref(id_))
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
97 glBindTexture(GL_TEXTURE_2D, id_.value)
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
98 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
99 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)
16
66ce9bb440ac Refactor in order to support multiple textures
Thibaut Girka <thib@sitedethib.com>
parents: 15
diff changeset
100
393
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
101 glTexImage2D(GL_TEXTURE_2D, 0,
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
102 composants,
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
103 key.width, key.height,
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
104 0,
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
105 format_, type_,
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
106 key.data)
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
107
9e2cbb2c2c64 Implement THTX, uncompressed textures stored inside ANM files, and use it instead of pyglet’s own wrapper.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 392
diff changeset
108 return id_.value