From 892f848b76c4482e77a96510bf6ec6d422bd841d Mon Sep 17 00:00:00 2001 From: OscarL Date: Fri, 18 Aug 2023 06:30:56 -0300 Subject: [PATCH] monsterz: reduce CPU usage, move to "any" arch. (#9246) Fixes #9236 --- games-puzzle/monsterz/monsterz-0.7.1.recipe | 14 ++--- .../monsterz/patches/monsterz-0.7.1.patchset | 60 +++++++++++++++---- 2 files changed, 54 insertions(+), 20 deletions(-) diff --git a/games-puzzle/monsterz/monsterz-0.7.1.recipe b/games-puzzle/monsterz/monsterz-0.7.1.recipe index 49d13df01..d5e57303d 100644 --- a/games-puzzle/monsterz/monsterz-0.7.1.recipe +++ b/games-puzzle/monsterz/monsterz-0.7.1.recipe @@ -11,26 +11,24 @@ Michael Speck, David White Mike Kershaw" LICENSE="WTFPL v2 GNU GPL v1 GNU LGPL v2" -REVISION="3" +REVISION="4" SOURCE_URI="http://sam.zoy.org/monsterz/monsterz-$portVersion.tar.gz" CHECKSUM_SHA256="50828b8fa26d107bcc2bd134328f83c905b9f5e124846bdf239daf0eed34973d" PATCHES="monsterz-$portVersion.patchset" ADDITIONAL_FILES="monsterz.hvif" -# For 32 bits, only "pygame_x86" is available, thus we can't use "any" here. -ARCHITECTURES="all !x86_gcc2" -SECONDARY_ARCHITECTURES="x86" +ARCHITECTURES="any" PROVIDES=" - monsterz$secondaryArchSuffix = $portVersion + monsterz = $portVersion " REQUIRES=" - haiku$secondaryArchSuffix - pygame$secondaryArchSuffix + haiku + pygame " BUILD_REQUIRES=" - haiku${secondaryArchSuffix}_devel + haiku_devel " INSTALL() diff --git a/games-puzzle/monsterz/patches/monsterz-0.7.1.patchset b/games-puzzle/monsterz/patches/monsterz-0.7.1.patchset index 8112c8381..f6a39c208 100644 --- a/games-puzzle/monsterz/patches/monsterz-0.7.1.patchset +++ b/games-puzzle/monsterz/patches/monsterz-0.7.1.patchset @@ -1,4 +1,4 @@ -From 8543d4c38d3c86004fbf2b1d9e27dacfa0e14d46 Mon Sep 17 00:00:00 2001 +From b77c7c42ec80df11c1c2cf60992490ef9887ba04 Mon Sep 17 00:00:00 2001 From: begasus Date: Sat, 26 Jan 2019 16:21:26 +0100 Subject: don't use chown @@ -28,7 +28,7 @@ index 6db0ff8..5aa803f 100644 2.37.3 -From 9bade379fa3675ad56cd232ae8f4706cf01dcd94 Mon Sep 17 00:00:00 2001 +From 014163efa59af7882dde46ebf75f716ccd9b3c88 Mon Sep 17 00:00:00 2001 From: Oscar Lesta Date: Mon, 17 Apr 2023 00:14:53 -0300 Subject: Fix issues with alignment on 64 bit systems. @@ -65,7 +65,7 @@ index deee45c..fd5cb60 100755 2.37.3 -From 635ead8a2991d0100ac96386de57e05515d87a32 Mon Sep 17 00:00:00 2001 +From eb5389d36ed7fd91543bcb6a682dd5a3476c620e Mon Sep 17 00:00:00 2001 From: Oscar Lesta Date: Mon, 17 Apr 2023 00:16:34 -0300 Subject: Fix crash on startup caused by errors in the blit() function in @@ -113,7 +113,7 @@ index fd5cb60..1fe7336 100755 2.37.3 -From 1af0d66cd41dd1d56d3170062e6777fc60136a74 Mon Sep 17 00:00:00 2001 +From 6070027ae032e038e049812345925feee2006a45 Mon Sep 17 00:00:00 2001 From: A Mennucc Date: Mon, 17 Apr 2023 00:20:55 -0300 Subject: Add startup animation with random monster. @@ -207,7 +207,7 @@ index 1fe7336..15ec6f9 100755 2.37.3 -From 74f587782dbb51f3c77b89a43755566568fdc445 Mon Sep 17 00:00:00 2001 +From 552f71d22e2f4bad5ed8c5912c5534d2511fe176 Mon Sep 17 00:00:00 2001 From: Markus Koschany Date: Sat, 7 Nov 2015 09:43:31 +0100 Subject: hardening @@ -233,7 +233,7 @@ index 5aa803f..2ffd64b 100644 2.37.3 -From 75310804f35b6fcc4eb8e84437a5ffdb561cceca Mon Sep 17 00:00:00 2001 +From a9ba69609234b3ecc9b699fe3d389295851d84cc Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Mon, 17 Apr 2023 00:22:30 -0300 Subject: Port to Python3 @@ -1200,7 +1200,7 @@ index 15ec6f9..e7434a3 100755 2.37.3 -From b3a3bfbd68b9a9d50264267f098b7fdc9c87cf24 Mon Sep 17 00:00:00 2001 +From 03857b021cd27d600d3f10fcbd40503f73e23b7b Mon Sep 17 00:00:00 2001 From: Oscar Lesta Date: Mon, 17 Apr 2023 02:24:27 -0300 Subject: Fix "configdir" location for Haiku. @@ -1225,7 +1225,7 @@ index e7434a3..b373e81 100755 2.37.3 -From 681f9025b544dd05cff7151ce9e26de78d3f9220 Mon Sep 17 00:00:00 2001 +From 0a08f955325b31a5569e1e898d4e852797c9b4fd Mon Sep 17 00:00:00 2001 From: Oscar Lesta Date: Fri, 21 Apr 2023 04:16:55 -0300 Subject: Fix double clicking on a symlink to the script. @@ -1244,15 +1244,16 @@ This avoids getting hangs when double-clicking the Deskbar symlink (or any regular symlink, really). diff --git a/monsterz.py b/monsterz.py -index b373e81..26bbeda 100755 +index b373e81..da294c9 100755 --- a/monsterz.py +++ b/monsterz.py -@@ -1,3 +1,3 @@ -+#!python3 +@@ -1,4 +1,4 @@ -#!/usr/bin/env python3 ++#!python3 # -*- coding: utf-8 -*- -@@ -2044,5 +2047,6 @@ def main(): + """ +@@ -2044,5 +2044,6 @@ def main(): exit() if __name__ == '__main__': @@ -1263,3 +1264,38 @@ index b373e81..26bbeda 100755 -- 2.37.3 + +From a56b7946e6a00f5ed9f2a6d9c0cfae91aa553115 Mon Sep 17 00:00:00 2001 +From: Oscar Lesta +Date: Fri, 18 Aug 2023 05:28:47 -0300 +Subject: Reduce CPU usage by slightly worsening the aspect of the "time-bar". + +Pixel-by-pixel update via the python->pygame->SDL->Haiku-API route +is slow. + +diff --git a/monsterz.py b/monsterz.py +index da294c9..7c0d383 100755 +--- a/monsterz.py ++++ b/monsterz.py +@@ -854,12 +854,12 @@ class Game: + alpha[x][y] = alpha[x][y] * x // 4 + for y in range(len(alpha[406 - x - 1])): + alpha[406 - x - 1][y] = alpha[406 - x - 1][y] * x // 4 +- for col in alpha: +- l = len(col) +- for y in range(4): +- col[y] = col[y] * y // 4 +- col[l - y - 1] = col[l - y - 1] * y // 4 +- del col ++# for col in alpha: ++# l = len(col) ++# for y in range(4): ++# col[y] = col[y] * y // 4 ++# col[l - y - 1] = col[l - y - 1] * y // 4 ++# del col + del alpha + timebar.unlock() + system.blit(timebar, (13, 436)) +-- +2.37.3 +