diff options
Diffstat (limited to 'numpy1.7-compatibility.patch')
-rw-r--r-- | numpy1.7-compatibility.patch | 116 |
1 files changed, 0 insertions, 116 deletions
diff --git a/numpy1.7-compatibility.patch b/numpy1.7-compatibility.patch deleted file mode 100644 index 438192df8cc7..000000000000 --- a/numpy1.7-compatibility.patch +++ /dev/null @@ -1,116 +0,0 @@ -# Patch for compatibility with new, Arch's default version of numpy - ---- renderer.py.orig 2015-08-12 07:12:26.000000000 -0600 -+++ renderer.py 2015-12-24 19:47:05.717201498 -0700 -@@ -227,6 +227,12 @@ - from config import config - # import time - -+def numpy17_combine_colors(target, colors): -+ """ Combines colors without upseting new version of numpy """ -+ target = numpy.array(target, "f") -+ target *= colors -+ target = numpy.array(target, "uint8") -+ return target - - def chunkMarkers(chunkSet): - """ Returns a mapping { size: [position, ...] } for different powers of 2 -@@ -1570,7 +1576,7 @@ - va1[_XYZ][:, :, 0] *= step - va1[_XYZ][:, :, 2] *= step - -- flatcolors *= 0.8 -+ flatcolors = flatcolors * 0.8 - - va1.view('uint8')[_RGBA] = flatcolors - grassmask = topBlocks[nonAirBlocks] == 2 -@@ -1617,7 +1623,8 @@ - if self.materials.name in ("Alpha", "Pocket"): - if direction == pymclevel.faces.FaceYIncreasing: - grass = theseBlocks == pymclevel.materials.alphaMaterials.Grass.ID -- vertexArray.view('uint8')[_RGB][grass] *= self.grassColor -+ vertexArray.view('uint8')[_RGB][grass] = \ -+ numpy17_combine_colors(vertexArray.view('uint8')[_RGB][grass], self.grassColor) - yield - - vertexArrays.append(vertexArray) -@@ -1688,12 +1695,18 @@ - - vertexArray.view('uint8')[_RGB] *= facingBlockLight[blockIndices][..., numpy.newaxis, numpy.newaxis] - if self.materials.name in ("Alpha", "Pocket"): -- vertexArray.view('uint8')[_RGB][leaves] *= self.leafColor -- vertexArray.view('uint8')[_RGB][pines] *= self.pineLeafColor -- vertexArray.view('uint8')[_RGB][birches] *= self.birchLeafColor -- vertexArray.view('uint8')[_RGB][jungle] *= self.jungleLeafColor -- vertexArray.view('uint8')[_RGB][acacia] *= self.acaciaLeafColor -- vertexArray.view('uint8')[_RGB][darkoak] *= self.darkoakLeafColor -+ vertexArray.view('uint8')[_RGB][leaves] = \ -+ numpy17_combine_colors(vertexArray.view('uint8')[_RGB][leaves], self.leafColor) -+ vertexArray.view('uint8')[_RGB][pines] = \ -+ numpy17_combine_colors(vertexArray.view('uint8')[_RGB][pines], self.pineLeafColor) -+ vertexArray.view('uint8')[_RGB][birches] = \ -+ numpy17_combine_colors(vertexArray.view('uint8')[_RGB][birches], self.birchLeafColor) -+ vertexArray.view('uint8')[_RGB][jungle] = \ -+ numpy17_combine_colors(vertexArray.view('uint8')[_RGB][jungle], self.jungleLeafColor) -+ vertexArray.view('uint8')[_RGB][acacia] = \ -+ numpy17_combine_colors(vertexArray.view('uint8')[_RGB][acacia], self.acaciaLeafColor) -+ vertexArray.view('uint8')[_RGB][darkoak] = \ -+ numpy17_combine_colors(vertexArray.view('uint8')[_RGB][darkoak], self.darkoakLeafColor) - - yield - arrays.append(vertexArray) -@@ -1762,8 +1775,8 @@ - vertexArray.view('uint8')[_RGB] = 0xf # ignore precomputed directional light - vertexArray.view('uint8')[_RGB] *= lights - if colorize is not None: -- vertexArray.view('uint8')[_RGB][colorize] *= LeafBlockRenderer.leafColor -- vertexArray.view('uint8')[_RGB][colorize2] *= LeafBlockRenderer.leafColor -+ numpy17_combine_colors(vertexArray.view('uint8')[_RGB][colorize], LeafBlockRenderer.leafColor) -+ numpy17_combine_colors(vertexArray.view('uint8')[_RGB][colorize2], LeafBlockRenderer.leafColor) - arrays.append(vertexArray) - yield - -@@ -1994,7 +2007,8 @@ - tex = texMap(railBlocks, bdata, pymclevel.faces.FaceYIncreasing)[:, numpy.newaxis, :] - - # disable 'powered' or 'pressed' bit for powered and detector rails -- bdata[railBlocks != pymclevel.materials.alphaMaterials.Rail.ID] &= ~0x8 -+ bdata[railBlocks != pymclevel.materials.alphaMaterials.Rail.ID] = \ -+ numpy.uint8(bdata[railBlocks != pymclevel.materials.alphaMaterials.Rail.ID] & ~0x8) - - vertexArray = self.makeTemplate(direction, blockIndices) - if not len(vertexArray): -@@ -2853,7 +2867,7 @@ - lights = blockLight[blockIndices][..., numpy.newaxis, numpy.newaxis] - vertexArray.view('uint8')[_RGB] *= lights - -- vertexArray.view('uint8')[_RGB] *= LeafBlockRenderer.leafColor -+ numpy17_combine_colors(vertexArray.view('uint8')[_RGB], LeafBlockRenderer.leafColor) - - if direction == pymclevel.faces.FaceZIncreasing: - vertexArray[_XYZ][..., 2] -= 0.0625 - ---- viewports/camera.py.orig 2015-08-12 07:12:26.000000000 -0600 -+++ viewports/camera.py 2015-12-24 18:32:08.063734146 -0700 -@@ -261,7 +261,7 @@ - - def setModelview(self): - pos = self.cameraPosition -- look = numpy.array(self.cameraPosition) -- look += self.cameraVector -+ look = numpy.array(self.cameraPosition, dtype='f') -+ look = look + self.cameraVector - up = (0, 1, 0) - GLU.gluLookAt(pos[0], pos[1], pos[2], - ---- editortools/player.py.orig 2015-08-12 07:12:26.000000000 -0600 -+++ editortools/player.py 2015-12-24 19:17:01.763814413 -0700 -@@ -1025,7 +1025,7 @@ - - pixelScale = 0.5 if self.editor.level.materials.name in ("Pocket", "Alpha") else 1.0 - texSize = 16 * pixelScale -- cageTexVerts *= pixelScale -+ cageTexVerts = cageTexVerts * pixelScale - - cageTexVerts = numpy.array( - [((tx, ty), (tx + texSize, ty), (tx + texSize, ty + texSize), (tx, ty + texSize)) for (tx, ty) in |