Enhance blood stain handling: combine existing and new blood surfaces for better accumulation and add surface management
This commit is contained in:
+17
-4
@@ -47,11 +47,24 @@ class Graphics():
|
||||
if not hasattr(self, 'blood_stains'):
|
||||
self.blood_stains = {}
|
||||
|
||||
# Generate blood surface
|
||||
blood_surface = self.render_engine.generate_blood_surface()
|
||||
self.blood_stains[position] = blood_surface
|
||||
# Generate new blood surface
|
||||
new_blood_surface = self.render_engine.generate_blood_surface()
|
||||
|
||||
# Regenerate background to include the new blood stain
|
||||
if position in self.blood_stains:
|
||||
# If there's already a blood stain at this position, combine them
|
||||
existing_surface = self.blood_stains[position]
|
||||
combined_surface = self.render_engine.combine_blood_surfaces(existing_surface, new_blood_surface)
|
||||
|
||||
# Free the old surfaces
|
||||
self.render_engine.free_surface(existing_surface)
|
||||
self.render_engine.free_surface(new_blood_surface)
|
||||
|
||||
self.blood_stains[position] = combined_surface
|
||||
else:
|
||||
# First blood stain at this position
|
||||
self.blood_stains[position] = new_blood_surface
|
||||
|
||||
# Regenerate background to include the updated blood stain
|
||||
self.regenerate_background()
|
||||
|
||||
def scroll_cursor(self, x=0, y=0):
|
||||
|
||||
Reference in New Issue
Block a user