Commits

Author Commit Message Labels Comments Date
Lenard Lindstrom
Big-endian fixes for pygame.Surface The surface_test.py unit tests now pass on a PowerPC.
Lenard Lindstrom
Some big-endian fixes (ppc) Now the base, bufferproxy, and pixelcopy module unit tests pass.
Lenard Lindstrom
Add c_ssize_t to ctypes module if not already present
Lenard Lindstrom
Another bug fix towards issue #175 This adds another missing `Py_DECREF()` for a returned PyNumber_Index object. In chasing down the lockobj PyPixelArray struct field was removed, with the `PixelArray` instance directly calling `PySurface_LockBy()` and `PySurface_UnlockBy()`. The lifetime lock object was redundant and considered a possible candidate for the leak. Also, the `PyObject_ClearWeakRefs()` call in `_pxarray_dealloc()` was…
Lenard Lindstrom
Fix bug in PyPixelArray tp_new function where weakrefs C field is clobbered The _pxarray_new_internal function overwrote the weakrefs field after it was set by a PySurface_LockLifetime call.
Lenard Lindstrom
Possible fix for issue #175, uncomfirmed In the pixelarray.c function _pxarray_subscript, an integer object returned by PyNumber_Index was not released.
Lenard Lindstrom
Bug fix of pygame.PixelArray involving returned repr string For Python 3.x, the pixelarray.c function Text_ConcatAndDel returned NULL instead of the concatenated Unicode string. This caused the tp_repr slot function _pxarray_repr to also return NULL instead of a string representation, triggering an exception.
Lenard Lindstrom
Make the Surface.get_at_mapped method value consistent with Surface.map_rgb Surface.map_rgb returns a signed Python int, which can be negative for some pixel values. Surface.get_at_mapped returned strictly positive pixel values. This lead to a unit test failure in pixelcopy_test.py for an x86_64 Pygame build, though the test should have passed. Since get_at_mapped was added for testing purposed, its return value should be consistent with map_rgb, which predates get_at_map…
Lenard Lindstrom
Along with changeset 9cac2ec83346, this fixes issue #144 Changeset 9cac2ec83346 addressed the first bug uncovered by issued #144. This changeset addresses the other problem, with exporting of the Pygame C api. This changeset makes the PyGAME_C_API array a C global for each extension module, with the main declaration in the C file that imports a Pygame api, by including pygame.h, and extern in any other C source files which include _pygame.h instead. E…
Lenard Lindstrom
Partial fix of issue #144 Issue #144 uncovered two problems. This changeset addresses the first: incorrect converion from FT_Fixed to an integer for an x86_64 Pygame build. This patch ensures all masks within the FX_* macros declared in ft_wrap.h are long identifiers, to match FT_Fixed. Also, to be safe, surface width and height are redeclared 'int' within ft_render.c for consistency with the SDL_CreateRGBSurface argument…
Lenard Lindstrom
Fix memory overrun bug with pygame.freetype.render_raw() Swapped arguments in a _PGFT_GetRenderMetrics call lead to non-underlined text getting underlined, writing past the end of the output buffer. Several C asserts were added to guard against simular memory access violations.
illume
A patch for issue #172 from Lorenz Quack for inplace operators in Math.Vector2.
Lenard Lindstrom
Fix pygame.pixelcopy function problems with big-endian processors The pixelarray module was untested on big-endian systems, like the Power PC. A Mac build of Pygame failed many unit tests. This is a first attempt to fix the bugs uncovered in pixelcopy. This bug fix is untested on a Mac. Also fixed was a faulty unit test in pixelcopy_test.py—a source array was uninitialized—as well as the bugs uncovered when the unit test was repaired.
Lenard Lindstrom
Allow switching the byte order of a Python int to big or little endian The pygame.tests.test_utils.endian module does machine independent byte reorder of the first 4 bytes of a Python int.
Lenard Lindstrom
Add an Array test type to pygame.tests.test_utils.arrinter Numpy arrays and BufferProxy surface views only support the system default integer byte order. The new Array type supports a swapped byte order. It is also available for Python 2.5, unlike the test array type in buftools.
Lenard Lindstrom
Add a test array type to pygame.tests.test_utils.arrinter
Lenard Lindstrom
Bring in corrections to assert statements
Lenard Lindstrom
Correct faulty assertions added to the C code in changeset 67f1c85 and later Some untested assert statements were added to base.c and surface.c as while adding new buffer support. Some asserts failed when the unit tests were run on a Pygame debug build. The PyBUF_PYGAME new buffer request flag, changeset 11e8afc, confused the base.c functions _arraystruct_as_buffer and PgArrayStruct_AsBuffer. The BufferProxy __array_interface__ and __array_struct__ getters failed to add th…
illume
Tiny typo fix for weird endian machines.
Lenard Lindstrom
Refactor the casting between the C (Py_buffer *) and (Pg_buffer *) types Originally, a BufferProxy get buffer callback accepted a Pg_buffer * argument. This was intended to protect against accidentally using such a callback as a type's bf_releasebuffer slot function. But it left the code full of downcasts from (Pg_buffer *) to (Py_buffer *), and hid the intent that any bf_releasebuffer slot function can be used as a BufferProxy callback. So the BufferProxy callback sig…
Lenard Lindstrom
Remove unused Pg_buffer_d typedef
Lenard Lindstrom
Clean up white space in C source files For the *.c and *.h files in the src and src/freetype directories replace tabs with spaces and remove trailing whitespace.
Lenard Lindstrom
Add class pygame.BufferProxy to Pygame's public Python API Add extension type pygame.bufferproxy.BufferProxy to the root Pygame namespace and the Pygame docs. The pygame._view.View derived BufferProxy is backward compatible with the original BufferProxy object. Also, since Python's memoryview object is inadequate for exporting Surface views, BufferProxy is a permanent Pygame fixture.
Lenard Lindstrom
Restore the Surface.get_view() method The get_view() method returns to the Surface type. The resurrected get_view() is just the updated get_buffer(), without the '&' view kind option. Method new_buffer() goes back to just returning a raw bytes view, as it did originally. This is in response to a comment by illume (René Dudfield) on pull request #25.
Lenard Lindstrom
fix a new buffer format bug involving an item count of 1: Part 2 See changeset 0ecf23052547. Both the pixelcopy and _freetype modules were overlooked previously. Additionally, improve the unit tests on new buffer formats for these two modules.
Lenard Lindstrom
Extend buftools.Exporter to allow an arbitrary format when an itemsize is given Remove the pygame.newbuffer module dependency from base_test.py. Also, reduce code duplication when unit tests for an unsupported new buffer format are added to freetype_test.py.
Lenard Lindstrom
Enhance buftools.Exporter to support negative strides For pixelcopy_test.py unit tests.
Lenard Lindstrom
replace another ambiguous switch statement default clause See changeset 35c6f1cb33b5.
Lenard Lindstrom
replace ambiguous switch statement default clauses with specific comments In several cases, a do-nothing default clause was used to indicate the containing switch statement was not exhaustive; unhandled switch values were expected. This intention was not obvious. These are replaced with explanatory comments. Other default clauses were used as assertions, or bug traps, catching invalid switch values and raising a Python SystemError exception. These are better documented …
Lenard Lindstrom
Fix Python 3.x compatibility issue introduced in changeset f7a9049e3b31
  1. Prev
  2. Next