diff --git a/libs/utils.py b/libs/utils.py index 5eec251..cd2b24c 100644 --- a/libs/utils.py +++ b/libs/utils.py @@ -448,10 +448,10 @@ class OutlinedText: else: offset = 0 dest_rect = ray.Rectangle(x, y+offset, self.texture.width+x2, self.texture.height+y2) - if self.outline_thickness > 0: + if self.outline_thickness > 0 and self._last_color != ray.BLANK: ray.begin_shader_mode(self.shader) ray.draw_texture_pro(self.texture, self.default_src, dest_rect, origin, rotation, final_color) - if self.outline_thickness > 0: + if self.outline_thickness > 0 and self._last_color != ray.BLANK: ray.end_shader_mode() def unload(self): diff --git a/libs/video.py b/libs/video.py index 2021469..9e856a7 100644 --- a/libs/video.py +++ b/libs/video.py @@ -198,10 +198,26 @@ class VideoPlayer: def draw(self): """Draw video frames to the raylib canvas""" if self.texture is not None: + source = (0, 0, self.texture.width, self.texture.height) + texture_aspect = self.texture.width / self.texture.height + screen_aspect = tex.screen_width / tex.screen_height + if texture_aspect > screen_aspect: + dest_width = tex.screen_width + dest_height = tex.screen_width / texture_aspect + dest_x = 0 + dest_y = (tex.screen_height - dest_height) / 2 + else: + dest_height = tex.screen_height + dest_width = tex.screen_height * texture_aspect + dest_x = (tex.screen_width - dest_width) / 2 + dest_y = 0 + + destination = (dest_x, dest_y, dest_width, dest_height) + ray.ClearBackground(ray.BLACK) ray.DrawTexturePro( self.texture, - (0, 0, self.texture.width, self.texture.height), - (0, 0, tex.screen_width, tex.screen_height), + source, + destination, (0, 0), 0, ray.WHITE diff --git a/scenes/game.py b/scenes/game.py index 6153fb3..ee15a66 100644 --- a/scenes/game.py +++ b/scenes/game.py @@ -314,8 +314,10 @@ class GameScreen(Screen): def draw_overlay(self): self.song_info.draw() - self.transition.draw() - self.result_transition.draw() + if not self.transition.is_finished: + self.transition.draw() + if self.result_transition.is_started: + self.result_transition.draw() self.allnet_indicator.draw() def draw(self): @@ -534,8 +536,8 @@ class Player: self.draw_note_list.extend(branch_section.draw_notes) self.draw_bar_list.extend(branch_section.bars) self.play_notes = deque(sorted(self.play_notes)) - self.draw_note_list = deque(sorted(self.draw_note_list, key=lambda x: x.hit_ms)) - self.draw_bar_list = deque(sorted(self.draw_bar_list, key=lambda x: x.hit_ms)) + self.draw_note_list = deque(sorted(self.draw_note_list, key=lambda x: x.load_ms)) + self.draw_bar_list = deque(sorted(self.draw_bar_list, key=lambda x: x.load_ms)) total_don = [note for note in self.play_notes if note.type in {NoteType.DON, NoteType.DON_L}] total_kat = [note for note in self.play_notes if note.type in {NoteType.KAT, NoteType.KAT_L}] total_other = [note for note in self.play_notes if note.type not in {NoteType.DON, NoteType.DON_L, NoteType.KAT, NoteType.KAT_L}] diff --git a/shader/outline.fs b/shader/outline.fs index 00610ae..10b8c92 100644 --- a/shader/outline.fs +++ b/shader/outline.fs @@ -17,7 +17,7 @@ void main() float outline = 0.0; int ringSamples = 16; - int rings = 2; + int rings = 1; for(int ring = 1; ring <= rings; ring++) { float ringRadius = float(ring) / float(rings); for(int i = 0; i < ringSamples; i++) {