Skip to content

Commit

Permalink
Merge #634
Browse files Browse the repository at this point in the history
634: swapping print() for logging r=AstraLuma a=nilamo



Co-authored-by: nilamo <[email protected]>
  • Loading branch information
bors[bot] and nilamo authored Jun 10, 2021
2 parents 9c0a759 + 2584344 commit a3f97f1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 4 additions & 1 deletion ppb/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
The :class:`~ppb.systems.Renderer` inserts a :class:`Camera` into the current
scene in response to the :class:`~ppb.events.SceneStarted`.
"""
import logging
from typing import Tuple
from numbers import Real

Expand All @@ -16,6 +17,8 @@
from ppb.sprites import RectangleShapeMixin
from ppb.sprites import Sprite

logger = logging.getLogger(__name__)


def _sprite_has_rectangular_region(sprite):
"""
Expand Down Expand Up @@ -148,7 +151,7 @@ def sprite_in_view(self, sprite: Sprite) -> bool:
height = max(self.top, sprite.top) - min(self.bottom, sprite.bottom)
max_width = self.width + sprite.width
max_height = self.height + sprite.height
print(f"W: {width}, H: {height}, MW: {max_width}, MH: {max_height}")
logger.debug(f"W: {width}, H: {height}, MW: {max_width}, MH: {max_height}")
return width < max_width and height < max_height

def translate_point_to_screen(self, point: Vector) -> Vector:
Expand Down
2 changes: 0 additions & 2 deletions ppb/systems/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,8 @@ def set_cursor(self, scene):
@staticmethod
def target_resolution(img_width, img_height, obj_width, obj_height, pixel_ratio):
if not obj_width:
print("no width")
ratio = img_height / (pixel_ratio * obj_height)
elif not obj_height:
print("no height")
ratio = img_width / (pixel_ratio * obj_width)
else:
ratio_w = img_width / (pixel_ratio * obj_width)
Expand Down
6 changes: 5 additions & 1 deletion ppb/systems/sound.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ctypes
import io
import logging
import time

from sdl2 import (
Expand Down Expand Up @@ -27,6 +28,8 @@

__all__ = ('SoundController', 'Sound')

logger = logging.getLogger(__name__)


def query_spec():
"""
Expand Down Expand Up @@ -123,7 +126,8 @@ def __enter__(self):
)
mix_call(Mix_Init, MIX_INIT_FLAC | MIX_INIT_MOD | MIX_INIT_MP3 | MIX_INIT_OGG)

print("SoundController", query_spec(), flush=True)
logger.debug("SoundController")
logger.debug(query_spec())

self.allocated_channels = 16

Expand Down

0 comments on commit a3f97f1

Please sign in to comment.