mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
fix crunchiness on textures I create
This commit is contained in:
@@ -58,6 +58,7 @@ class BaseChibi:
|
||||
|
||||
class ChibiBad(BaseChibi):
|
||||
def __init__(self, index: int, bpm: float, tex: TextureWrapper, is_2p: bool):
|
||||
self.tex = tex
|
||||
self.is_2p = is_2p
|
||||
self.bpm = bpm
|
||||
self.index = random.randint(0, 2)
|
||||
|
||||
@@ -37,6 +37,16 @@ class Texture:
|
||||
self.width = self.texture.width
|
||||
self.height = self.texture.height
|
||||
self.is_frames = isinstance(self.texture, list)
|
||||
if isinstance(self.texture, list):
|
||||
pass
|
||||
for texture_data in self.texture:
|
||||
ray.GenTextureMipmaps(ray.ffi.addressof(texture_data))
|
||||
ray.SetTextureFilter(texture_data, ray.TEXTURE_FILTER_TRILINEAR)
|
||||
ray.SetTextureWrap(texture_data, ray.TEXTURE_WRAP_CLAMP)
|
||||
else:
|
||||
ray.GenTextureMipmaps(ray.ffi.addressof(self.texture))
|
||||
ray.SetTextureFilter(self.texture, ray.TEXTURE_FILTER_TRILINEAR)
|
||||
ray.SetTextureWrap(self.texture, ray.TEXTURE_WRAP_CLAMP)
|
||||
|
||||
self.x: list[int] = [0]
|
||||
self.y: list[int] = [0]
|
||||
|
||||
@@ -175,6 +175,8 @@ class OutlinedText:
|
||||
self.texture = self._create_text_vertical(text, font_size, color, ray.BLANK, self.font)
|
||||
else:
|
||||
self.texture = self._create_text_horizontal(text, font_size, color, ray.BLANK, self.font)
|
||||
ray.gen_texture_mipmaps(self.texture)
|
||||
ray.set_texture_filter(self.texture, ray.TextureFilter.TEXTURE_FILTER_TRILINEAR)
|
||||
outline_size = ray.ffi.new('float*', self.outline_thickness)
|
||||
texture_size = ray.ffi.new("float[2]", [self.texture.width, self.texture.height])
|
||||
|
||||
|
||||
@@ -66,6 +66,7 @@ class VideoPlayer:
|
||||
'format': ray.PIXELFORMAT_UNCOMPRESSED_R8G8B8
|
||||
})
|
||||
self.texture = ray.LoadTextureFromImage(image[0])
|
||||
ray.SetTextureFilter(self.texture, ray.TEXTURE_FILTER_TRILINEAR)
|
||||
else:
|
||||
if frame_data is not None:
|
||||
frame_bytes = frame_data.tobytes()
|
||||
|
||||
Reference in New Issue
Block a user