simple2d-3d 0.2.3__tar.gz → 0.2.5__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simple2d_3d
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: A lightweight, hardware-accelerated 2D-3D layout and engine.
5
5
  Author: ProdeeptoSundar Roy
6
6
  Project-URL: Homepage, https://github.com/rtumpa099-gif/Simple2D_3D
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "simple2d_3d" # The name users will type: pip install my_engine
7
- version = "0.2.3"
7
+ version = "0.2.5"
8
8
  authors = [
9
9
  { name="ProdeeptoSundar Roy" }
10
10
  ]
@@ -446,6 +446,7 @@ class ParticleSystem:
446
446
  def __init__(self, renderer):
447
447
  self.particles = []
448
448
  self.cached_textures = {}
449
+ self.dst_rect = sdl2.SDL_Rect(0,0,1,1)
449
450
 
450
451
  def add_explosion(self, x, y, count=30):
451
452
  for _ in range(count+1):
@@ -462,18 +463,18 @@ class ParticleSystem:
462
463
  diameter = p.size * 2
463
464
 
464
465
  # Using 0 for masks lets SDL2 automatically assign a standard, correct 32-bit RGBA layout
465
- surface = SDL_CreateRGBSurface(0, diameter, diameter, 32, 0, 0, 0, 0)
466
+ surface = sdl2.SDL_CreateRGBSurface(0, diameter, diameter, 32, 0, 0, 0, 0)
466
467
 
467
468
  # Safety check: If SDL failed to allocate the surface memory, skip this frame
468
469
  if not surface:
469
470
  continue
470
471
 
471
472
  # Fill the surface template with pure white
472
- SDL_FillRect(surface, None, SDL_MapRGBA(surface.contents.format, 255, 255, 255, 255))
473
+ sdl2.SDL_FillRect(surface, None, sdl2.SDL_MapRGBA(surface.contents.format, 255, 255, 255, 255))
473
474
 
474
475
  # Upload to GPU texture memory
475
- texture = SDL_CreateTextureFromSurface(renderer, surface)
476
- SDL_FreeSurface(surface)
476
+ texture = sdl2.SDL_CreateTextureFromSurface(renderer, surface)
477
+ sdl2.SDL_FreeSurface(surface)
477
478
 
478
479
  if texture:
479
480
  self.cached_textures[p.size] = texture
@@ -485,17 +486,15 @@ class ParticleSystem:
485
486
  if not tex:
486
487
  continue
487
488
 
488
- SDL_SetTextureColorMod(tex, p.color[0], p.color[1], p.color[2])
489
- SDL_SetTextureBlendMode(tex, SDL_BLENDMODE_BLEND)
490
- SDL_SetTextureAlphaMod(tex, alpha)
489
+ sdl2.SDL_SetTextureColorMod(tex, p.color[0], p.color[1], p.color[2])
490
+ sdl2.SDL_SetTextureBlendMode(tex, sdl2.SDL_BLENDMODE_BLEND)
491
+ sdl2.SDL_SetTextureAlphaMod(tex, alpha)
491
492
 
492
493
  # --- 3. Set the position box ---
493
- dst_rect = SDL_Rect(
494
- int(p.x - p.size),
495
- int(p.y - p.size),
496
- p.size * 2,
497
- p.size * 2
498
- )
494
+ self.dst_rect.x = int(p.x - p.size)
495
+ self.dst_rect.y = int(p.y - p.size)
496
+ self.dst_rect.w = int(p.size * 2)
497
+ self.dst_rect.h = int(p.size * 2)
499
498
 
500
499
  # --- 4. Render it ---
501
- SDL_RenderCopy(renderer, tex, None, dst_rect)
500
+ sdl2.SDL_RenderCopy(renderer, tex, None, ctypes.byref(dst_rect))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: simple2d_3d
3
- Version: 0.2.3
3
+ Version: 0.2.5
4
4
  Summary: A lightweight, hardware-accelerated 2D-3D layout and engine.
5
5
  Author: ProdeeptoSundar Roy
6
6
  Project-URL: Homepage, https://github.com/rtumpa099-gif/Simple2D_3D
File without changes
File without changes
File without changes