import pymunk.pygame_util
import pygame.display
import pygame.draw
+import pygame.locals as pgl
from .constants import (
SCREEN_SIZE, LIGHT_CATEGORY, FITTINGS_CATEGORY)
if not self.on:
return
- raypoly_mask = surface.copy()
+ raypoly_mask = pygame.surface.Surface(surface.get_size(), pgl.SWSURFACE)
white, black = (255, 255, 255, 255), (0, 0, 0, 0)
raypoly_mask.fill(black)
for shape in self.body.shapes:
pygame.draw.polygon(raypoly_mask, white, pygame_poly, 0)
pygame.draw.aalines(raypoly_mask, white, True, pygame_poly, 1)
- limits_mask = surface.copy()
+ limits_mask = pygame.surface.Surface(surface.get_size(), pgl.SWSURFACE)
limits_mask.fill(black)
centre = pymunk.pygame_util.to_pygame(self.position, surface)
max_radius = self.radius_limits[1] or 50.0
pygame.draw.arc(
limits_mask, white, box3, start_angle, end_angle, int(width))
- import pygame.locals as pgl
raypoly_mask.blit(limits_mask, (0, 0), None, pgl.BLEND_RGBA_MIN)
raypoly_mask.set_colorkey(black)
light_colour = self.COLOURS[self.colour]
- overlay = surface.copy()
+ overlay = pygame.surface.Surface(surface.get_size(), pgl.SWSURFACE)
overlay.fill(light_colour)
raypoly_mask.blit(overlay, (0, 0), None, pgl.BLEND_RGBA_MULT)