map starts now in debug version of game
sink rate for marker was too big for 15 bits
Details
- Reviewers
wraitii - Commits
- rP21312: Grid bounds and SinkRate debug version fixes
Build debug version
run it
start game
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Successful build - Chance fights ever on the side of the prudent.
Updating workspaces... Build (release)... Build (debug)... Running release tests... Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
I think instead in Grid.h we want to ensure i1 <= m_W and j1 <= m_H?
bool any_set_in_square(int i0, int j0, int i1, int j1) const { #if GRID_BOUNDS_DEBUG ENSURE(i0 >= 0 && j0 >= 0 && i1 < m_W && j1 < m_H); #endif for (int j = j0; j < j1; ++j) { int sum = 0; for (int i = i0; i < i1; ++i) sum += m_Data[j*m_W + i]; if (sum > 0) return true; } return false; }
Successful build - Chance fights ever on the side of the prudent.
Updating workspaces... Build (release)... Build (debug)... Running release tests... Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
In marker there was <SinkRate>1000000</SinkRate> but for integral part cannot be bigger than 16 bits
Successful build - Chance fights ever on the side of the prudent.
Updating workspaces... Build (release)... Build (debug)... Running release tests... Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK! Checking XML files...
I'll commit this in two separate patches (if the first thing is indeed an issue, need to check how it gets parsed). Thanks for your work!
If you mean SinkRate problem:
Fixed.h uses to get double from string value of type CFixed_15_16 , what is 15 bits for integral part, and it
stays in integral part till . appears, anyway 10^6 > (2^3)^6 = 2^18 therefore it wants to use more than 15 bits and we get assertion error, what is handled somehow in
release build, but it is not good to have there such a thing.
Have you checked it still sinks fast enough ?
Else you could go from 10 000 to 99 999 or whatever the upper bound is.
I do not see much difference between 10 000 and 30 000 animation, but maybe you can check visually if it helps.
Okay since the point was to have a ridiculously high number setting it to the upper bound makes sense I guess.