Skip to content

Commit e6705f1

Browse files
MyreMylarStarbuck5
authored andcommitted
Merge pull request #2644 from oddbookworm/remove-deprecations-in-examples
removed use of depth param in examples
1 parent 4908385 commit e6705f1

File tree

5 files changed

+4
-26
lines changed

5 files changed

+4
-26
lines changed

examples/aliens.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ def main(winstyle=0):
239239
fullscreen = False
240240
# Set the display mode
241241
winstyle = 0 # |FULLSCREEN
242-
bestdepth = pygame.display.mode_ok(SCREENRECT.size, winstyle, 32)
243-
screen = pygame.display.set_mode(SCREENRECT.size, winstyle, bestdepth)
242+
screen = pygame.display.set_mode(SCREENRECT.size, winstyle)
244243

245244
# Load images, assign to sprite classes
246245
# (do this before the classes are used, after screen setup)

examples/arraydemo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
def surfdemo_show(array_img, name):
2626
"displays a surface, waits for user to continue"
27-
screen = pygame.display.set_mode(array_img.shape[:2], 0, 32)
27+
screen = pygame.display.set_mode(array_img.shape[:2])
2828
surfarray.blit_array(screen, array_img)
2929
pygame.display.flip()
3030
pygame.display.set_caption(name)

examples/blend_fill.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def main():
3333
step = 5
3434

3535
pygame.init()
36-
screen = pygame.display.set_mode((640, 480), 0, 32)
36+
screen = pygame.display.set_mode((640, 480))
3737
screen.fill((100, 100, 100))
3838

3939
image = pygame.image.load(os.path.join(data_dir, "liquid.bmp")).convert()
@@ -98,7 +98,6 @@ def main():
9898
screen.fill((100, 100, 100))
9999
screen.blit(image, (10, 10))
100100
blendimage.blit(image, (0, 0))
101-
# blendimage.fill (color, (0, 0, 20, 20), blendtype)
102101
blendimage.fill(color, None, blendtype)
103102
screen.blit(blendimage, (200, 10))
104103
print(

examples/testsprite.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -74,26 +74,6 @@
7474
print(screen_dims)
7575

7676

77-
##class Thingy(pygame.sprite.Sprite):
78-
## images = None
79-
## def __init__(self):
80-
## pygame.sprite.Sprite.__init__(self)
81-
## self.image = Thingy.images[0]
82-
## self.rect = self.image.get_rect()
83-
## self.rect.x = randint(0, screen_dims[0])
84-
## self.rect.y = randint(0, screen_dims[1])
85-
## #self.vel = [randint(-10, 10), randint(-10, 10)]
86-
## self.vel = [randint(-1, 1), randint(-1, 1)]
87-
##
88-
## def move(self):
89-
## for i in [0, 1]:
90-
## nv = self.rect[i] + self.vel[i]
91-
## if nv >= screen_dims[i] or nv < 0:
92-
## self.vel[i] = -self.vel[i]
93-
## nv = self.rect[i] + self.vel[i]
94-
## self.rect[i] = nv
95-
96-
9777
class Thingy(pygame.sprite.DirtySprite):
9878
images = None
9979

examples/vgrade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def main():
8383
pygame.mixer.quit() # remove ALSA underflow messages for Debian squeeze
8484
size = 600, 400
8585
os.environ["SDL_VIDEO_CENTERED"] = "1"
86-
screen = pygame.display.set_mode(size, pygame.NOFRAME, 0)
86+
screen = pygame.display.set_mode(size, pygame.NOFRAME)
8787

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

0 commit comments

Comments
 (0)