Skip to content

Commit

Permalink
Merge pull request #2644 from oddbookworm/remove-deprecations-in-exam…
Browse files Browse the repository at this point in the history
…ples

removed use of depth param in examples
  • Loading branch information
MyreMylar authored and Starbuck5 committed Feb 18, 2024
1 parent 4908385 commit e6705f1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 26 deletions.
3 changes: 1 addition & 2 deletions examples/aliens.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ def main(winstyle=0):
fullscreen = False
# Set the display mode
winstyle = 0 # |FULLSCREEN
bestdepth = pygame.display.mode_ok(SCREENRECT.size, winstyle, 32)
screen = pygame.display.set_mode(SCREENRECT.size, winstyle, bestdepth)
screen = pygame.display.set_mode(SCREENRECT.size, winstyle)

# Load images, assign to sprite classes
# (do this before the classes are used, after screen setup)
Expand Down
2 changes: 1 addition & 1 deletion examples/arraydemo.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

def surfdemo_show(array_img, name):
"displays a surface, waits for user to continue"
screen = pygame.display.set_mode(array_img.shape[:2], 0, 32)
screen = pygame.display.set_mode(array_img.shape[:2])
surfarray.blit_array(screen, array_img)
pygame.display.flip()
pygame.display.set_caption(name)
Expand Down
3 changes: 1 addition & 2 deletions examples/blend_fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def main():
step = 5

pygame.init()
screen = pygame.display.set_mode((640, 480), 0, 32)
screen = pygame.display.set_mode((640, 480))
screen.fill((100, 100, 100))

image = pygame.image.load(os.path.join(data_dir, "liquid.bmp")).convert()
Expand Down Expand Up @@ -98,7 +98,6 @@ def main():
screen.fill((100, 100, 100))
screen.blit(image, (10, 10))
blendimage.blit(image, (0, 0))
# blendimage.fill (color, (0, 0, 20, 20), blendtype)
blendimage.fill(color, None, blendtype)
screen.blit(blendimage, (200, 10))
print(
Expand Down
20 changes: 0 additions & 20 deletions examples/testsprite.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,6 @@
print(screen_dims)


##class Thingy(pygame.sprite.Sprite):
## images = None
## def __init__(self):
## pygame.sprite.Sprite.__init__(self)
## self.image = Thingy.images[0]
## self.rect = self.image.get_rect()
## self.rect.x = randint(0, screen_dims[0])
## self.rect.y = randint(0, screen_dims[1])
## #self.vel = [randint(-10, 10), randint(-10, 10)]
## self.vel = [randint(-1, 1), randint(-1, 1)]
##
## def move(self):
## for i in [0, 1]:
## nv = self.rect[i] + self.vel[i]
## if nv >= screen_dims[i] or nv < 0:
## self.vel[i] = -self.vel[i]
## nv = self.rect[i] + self.vel[i]
## self.rect[i] = nv


class Thingy(pygame.sprite.DirtySprite):
images = None

Expand Down
2 changes: 1 addition & 1 deletion examples/vgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def main():
pygame.mixer.quit() # remove ALSA underflow messages for Debian squeeze
size = 600, 400
os.environ["SDL_VIDEO_CENTERED"] = "1"
screen = pygame.display.set_mode(size, pygame.NOFRAME, 0)
screen = pygame.display.set_mode(size, pygame.NOFRAME)

pygame.event.set_blocked(pygame.MOUSEMOTION) # keep our queue cleaner

Expand Down

0 comments on commit e6705f1

Please sign in to comment.