Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of cleanups #2779

Merged
merged 2 commits into from Oct 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/reST/tut/ChimpLineByLine.rst
Expand Up @@ -180,7 +180,7 @@ them one at a time here. ::

def __init__(self):
pg.sprite.Sprite.__init__(self) # call Sprite initializer
self.image, self.rect = load_image("fist.bmp", -1)
self.image, self.rect = load_image("fist.png", -1)
self.fist_offset = (-235, -80)
self.punching = False

Expand Down Expand Up @@ -230,7 +230,7 @@ is colliding with the given target sprite. ::

def __init__(self):
pg.sprite.Sprite.__init__(self) # call Sprite intializer
self.image, self.rect = load_image("chimp.bmp", -1, 4)
self.image, self.rect = load_image("chimp.png", -1, 4)
screen = pg.display.get_surface()
self.area = screen.get_rect()
self.rect.topleft = 10, 90
Expand Down
2 changes: 1 addition & 1 deletion examples/blit_blends.py
Expand Up @@ -51,7 +51,7 @@ def main():

images = {}
images[pg.K_1] = im2
images[pg.K_2] = pg.image.load(os.path.join(data_dir, "chimp.bmp"))
images[pg.K_2] = pg.image.load(os.path.join(data_dir, "chimp.png"))
images[pg.K_3] = pg.image.load(os.path.join(data_dir, "alien3.gif"))
images[pg.K_4] = pg.image.load(os.path.join(data_dir, "liquid.bmp"))
img_to_blit = im2.convert()
Expand Down
4 changes: 2 additions & 2 deletions examples/chimp.py
Expand Up @@ -58,7 +58,7 @@ class Fist(pg.sprite.Sprite):

def __init__(self):
pg.sprite.Sprite.__init__(self) # call Sprite initializer
self.image, self.rect = load_image("fist.bmp", -1)
self.image, self.rect = load_image("fist.png", -1)
self.fist_offset = (-235, -80)
self.punching = False

Expand Down Expand Up @@ -88,7 +88,7 @@ class Chimp(pg.sprite.Sprite):

def __init__(self):
pg.sprite.Sprite.__init__(self) # call Sprite intializer
self.image, self.rect = load_image("chimp.bmp", -1, 4)
self.image, self.rect = load_image("chimp.png", -1, 4)
screen = pg.display.get_surface()
self.area = screen.get_rect()
self.rect.topleft = 10, 90
Expand Down
Binary file removed examples/data/chimp.bmp
Binary file not shown.
Binary file added examples/data/chimp.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/data/fist.bmp
Binary file not shown.
Binary file added examples/data/fist.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed examples/data/oldplayer.gif
Binary file not shown.
Binary file modified examples/data/turquoise.tif
Binary file not shown.
6 changes: 0 additions & 6 deletions examples/data/yuv_1.pgm

This file was deleted.

4 changes: 1 addition & 3 deletions examples/mask.py
Expand Up @@ -135,8 +135,6 @@ def main(*args):
print("Press any key to quit")
pg.init()
screen = pg.display.set_mode((640, 480))
if any("fist.bmp" in x for x in args):
pg.display.set_caption("Punch Nazis")
images = []
masks = []
for impath in args:
Expand Down Expand Up @@ -206,7 +204,7 @@ def main(*args):
print("Let many copies of IMAGE(s) bounce against each other")
print("Press any key to quit")
main_dir = os.path.split(os.path.abspath(__file__))[0]
imagename = os.path.join(main_dir, "data", "fist.bmp")
imagename = os.path.join(main_dir, "data", "chimp.png")
main(imagename)

else:
Expand Down
68 changes: 0 additions & 68 deletions examples/overlay.py

This file was deleted.

5 changes: 5 additions & 0 deletions src_c/doc/examples_doc.h
Expand Up @@ -20,6 +20,7 @@
#define DOC_PYGAMEEXAMPLESHEADLESSNOWINDOWSNEEDEDMAIN "headless_no_windows_needed.main(fin, fout, w, h) -> None\nwrite an image file that is smoothscaled copy of an input file"
#define DOC_PYGAMEEXAMPLESFASTEVENTSMAIN "fastevents.main() -> None\nstress test the fastevents module"
#define DOC_PYGAMEEXAMPLESOVERLAYMAIN "overlay.main(fname) -> None\nplay a .pgm video using overlays"
#define DOC_PYGAMEEXAMPLESJOYSTICKMAIN "joystick.main() -> None\naccess the clipboard"
#define DOC_PYGAMEEXAMPLESBLENDFILLMAIN "blend_fill.main() -> None\ndemonstrate the various surface.fill method blend options"
#define DOC_PYGAMEEXAMPLESBLITBLENDSMAIN "blit_blends.main() -> None\nuses alternative additive fill to that of surface.fill"
#define DOC_PYGAMEEXAMPLESCURSORSMAIN "cursors.main() -> None\ndisplay two different custom cursors"
Expand Down Expand Up @@ -118,6 +119,10 @@ pygame.examples.overlay.main
overlay.main(fname) -> None
play a .pgm video using overlays

pygame.examples.joystick.main
joystick.main() -> None
access the clipboard

pygame.examples.blend_fill.main
blend_fill.main() -> None
demonstrate the various surface.fill method blend options
Expand Down
4 changes: 2 additions & 2 deletions src_c/surface.c
Expand Up @@ -615,13 +615,13 @@ surface_init(pgSurfaceObject *self, PyObject *args, PyObject *kwds)
if ((!pg_IntFromObjIndex(size, 0, &width)) ||
(!pg_IntFromObjIndex(size, 1, &height))) {
PyErr_SetString(PyExc_ValueError,
"size needs to be (int width, int height)");
"size needs to be (number width, number height)");
return -1;
}
}
else {
PyErr_SetString(PyExc_ValueError,
"size needs to be (int width, int height)");
"size needs to be (number width, number height)");
return -1;
}

Expand Down
30 changes: 0 additions & 30 deletions src_py/_dummybackend.py

This file was deleted.

2 changes: 0 additions & 2 deletions test/overlay_tags.py

This file was deleted.

37 changes: 0 additions & 37 deletions test/overlay_test.py

This file was deleted.

4 changes: 2 additions & 2 deletions test/transform_test.py
Expand Up @@ -1253,7 +1253,7 @@ def tearDown(self):
def test_flip(self):
""" honors the set_color key on the returned surface from flip.
"""
image_loaded = pygame.image.load(example_path("data/chimp.bmp"))
image_loaded = pygame.image.load(example_path("data/chimp.png"))

image = pygame.Surface(image_loaded.get_size(), 0, 32)
image.blit(image_loaded, (0, 0))
Expand Down Expand Up @@ -1298,7 +1298,7 @@ def test_flip(self):
def test_flip_alpha(self):
""" returns a surface with the same properties as the input.
"""
image_loaded = pygame.image.load(example_path("data/chimp.bmp"))
image_loaded = pygame.image.load(example_path("data/chimp.png"))

image_alpha = pygame.Surface(image_loaded.get_size(), pygame.SRCALPHA, 32)
image_alpha.blit(image_loaded, (0, 0))
Expand Down