From 51b87278e5f8376ba8739f43fc73cfff1839d630 Mon Sep 17 00:00:00 2001 From: Stefano Ceccherini Date: Mon, 19 Nov 2007 22:48:19 +0000 Subject: [PATCH] Apparently the calculations used to distribute the load don't work correctly under vmware, and the star count could become negative. At least we check that and set it to 0 in that case. Fixes bug #89 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22961 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/kits/game/chart/ChartRender.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tests/kits/game/chart/ChartRender.cpp b/src/tests/kits/game/chart/ChartRender.cpp index 9f3b473722..7e97f627a5 100644 --- a/src/tests/kits/game/chart/ChartRender.cpp +++ b/src/tests/kits/game/chart/ChartRender.cpp @@ -567,6 +567,12 @@ void RefreshStarPacket(buffer *buf, star_packet *sp, geometry *geo) int32 i, min_count; star *s; + // TODO: For some reason, when selecting the "2 threads" option under vmware, + // some weird timing calculations finish with setting the star packet count to + // a negative number. This screws all the next calculations, and the animation + // then comes to a stop. + sp->count = max_c(sp->count, 0); + /* Calculate the number of stars that were process during the previous frame and still need to be process for that frame. */ min_count = sp->erase_count;