mini-arcade-native-backend 0.5.3__cp39-cp39-win_amd64.whl → 0.6.0__cp39-cp39-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -299,12 +299,18 @@ class NativeBackend(Backend):
299
299
  if isinstance(alpha, bool):
300
300
  raise TypeError("alpha must be a float in [0,1], not bool")
301
301
 
302
- a = float(alpha)
302
+ # If it's an int-like value, treat as 0..255
303
+ if isinstance(alpha, int):
304
+ if alpha < 0 or alpha > 255:
305
+ raise ValueError(
306
+ f"int alpha must be in [0, 255], got {alpha!r}"
307
+ )
308
+ return int(alpha)
303
309
 
304
- # Enforce “percentage only”
310
+ # Otherwise treat as float 0..1
311
+ a = float(alpha)
305
312
  if a < 0.0 or a > 1.0:
306
- raise ValueError(f"alpha must be in [0, 1], got {alpha!r}")
307
-
313
+ raise ValueError(f"float alpha must be in [0, 1], got {alpha!r}")
308
314
  return int(round(a * 255))
309
315
 
310
316
  @staticmethod
@@ -502,3 +508,27 @@ class NativeBackend(Backend):
502
508
 
503
509
  def clear_clip_rect(self) -> None:
504
510
  self._engine.clear_clip_rect()
511
+
512
+ # Justification: Many arguments needed for line drawing
513
+ # pylint: disable=too-many-arguments,too-many-positional-arguments
514
+ def draw_line(
515
+ self,
516
+ x1: int,
517
+ y1: int,
518
+ x2: int,
519
+ y2: int,
520
+ color: tuple[int, ...] = (255, 255, 255),
521
+ ) -> None:
522
+ r, g, b, a = self._get_color_values(color)
523
+
524
+ sx1 = int(round(self._vp_offset_x + x1 * self._vp_scale))
525
+ sy1 = int(round(self._vp_offset_y + y1 * self._vp_scale))
526
+ sx2 = int(round(self._vp_offset_x + x2 * self._vp_scale))
527
+ sy2 = int(round(self._vp_offset_y + y2 * self._vp_scale))
528
+
529
+ self._engine.draw_line(
530
+ sx1, sy1, sx2, sy2, int(r), int(g), int(b), int(a)
531
+ )
532
+
533
+
534
+ # pylint: enable=too-many-arguments,too-many-positional-arguments
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mini-arcade-native-backend
3
- Version: 0.5.3
3
+ Version: 0.6.0
4
4
  Summary: Native SDL2 backend for mini-arcade-core using SDL2 + pybind11.
5
5
  Author-Email: Santiago Rincon <rincores@gmail.com>
6
6
  License: Copyright (c) 2025 Santiago Rincón
@@ -24,7 +24,7 @@ License: Copyright (c) 2025 Santiago Rincón
24
24
  SOFTWARE.
25
25
 
26
26
  Requires-Python: <3.12,>=3.9
27
- Requires-Dist: mini-arcade-core~=1.0
27
+ Requires-Dist: mini-arcade-core~=1.1
28
28
  Provides-Extra: dev
29
29
  Requires-Dist: pytest~=8.3; extra == "dev"
30
30
  Requires-Dist: pytest-cov~=6.0; extra == "dev"
@@ -0,0 +1,6 @@
1
+ mini_arcade_native_backend/__init__.py,sha256=olqX3fkFRvLndg0rAeCPmpxM2EXd2-tLpVlkc2_gSIw,17911
2
+ mini_arcade_native_backend/_native.cp39-win_amd64.pyd,sha256=FWqb2F_1_CyVOWFAu-SN6zmZnQd90id3-K7yl3u82Ek,244224
3
+ mini_arcade_native_backend-0.6.0.dist-info/METADATA,sha256=7RyY7NLksROfXcHxhMHbq9bauVSvJAtnmVKdVU1T2eI,10517
4
+ mini_arcade_native_backend-0.6.0.dist-info/WHEEL,sha256=9tsL4JT94eZPTkcS3bNng2riasYJMxXndrO9CxUfJHs,104
5
+ mini_arcade_native_backend-0.6.0.dist-info/licenses/LICENSE,sha256=cZRgTdRJ3YASekMxkGAvylB2nROh4ov228DxAogK3yY,1115
6
+ mini_arcade_native_backend-0.6.0.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- mini_arcade_native_backend/__init__.py,sha256=eguv2ESm07S1h8beSRfKKhMFBywfpsUlo-3forhhCoc,16809
2
- mini_arcade_native_backend/_native.cp39-win_amd64.pyd,sha256=WrgPcECVN5iNqtpQkQcaiM9C0Ky21-PCimV3Sg0vQBQ,243712
3
- mini_arcade_native_backend-0.5.3.dist-info/METADATA,sha256=Br3ckI1QZuE2tgZ7eKIgkQf_g8z-b69kdcQIe8k4SSs,10517
4
- mini_arcade_native_backend-0.5.3.dist-info/WHEEL,sha256=9tsL4JT94eZPTkcS3bNng2riasYJMxXndrO9CxUfJHs,104
5
- mini_arcade_native_backend-0.5.3.dist-info/licenses/LICENSE,sha256=cZRgTdRJ3YASekMxkGAvylB2nROh4ov228DxAogK3yY,1115
6
- mini_arcade_native_backend-0.5.3.dist-info/RECORD,,