First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 602
Product:
Component:
Status: RESOLVED
Resolution: LATER
Assigned To: Mika Kolehmainen <mk@kapsi.fi>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Nic <uqm@submedia.net>
Add CC:
CC:
URL:
Summary:

Attachment Type Creator Created Size Actions
rings.patch patch Nic 2004-04-11 09:32 CET 8.25 KB Details | Diff
screenshot image/png Nic 2004-04-11 09:34 CET 102.16 KB Details
rings.patch (new) patch Nic 2004-04-12 07:32 CET 19.08 KB Details | Diff
screenshot (new) image/png Nic 2004-04-12 07:40 CET 104.45 KB Details
rings.patch (new & improved) patch Nic 2004-04-20 05:41 CET 19.06 KB Details | Diff
rings.patch (final) patch Nic 2004-07-08 07:16 CET 23.38 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 602 depends on: Show dependency tree
Show dependency graph
Bug 602 blocks:

Additional Comments:







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2004-04-11 09:28 CET
i think it would be teh kewl if rings around saturn  ;)

------- Comment #1 From Nic 2004-04-11 09:32:42 CET -------
Created an attachment (id=298) [details]
rings.patch

That first comment is always so hard to come up with...  :)

Here is a patch to draw "rings" around gas giant planets, it is very rough at
this point, and I am seeking comments on it.

Current known problems:

- The rings obscure coarse scans.  I'm not sure what can be done about this.
- The method for picking a colour for the rings is pure voodoo.  I wasn't able
to determine how the colourmap stuff worked, so I stole code and glued it
together in a manner that seems to work.
- The algorithm may or may not be the best way to do things.  It seemed like a
good idea at the time.

------- Comment #2 From Nic 2004-04-11 09:34:45 CET -------
Created an attachment (id=299) [details]
screenshot

Here is a screenshot of the code in action

------- Comment #3 From Nic 2004-04-11 17:21:58 CET -------
Update:  I have reworked my code to precompute and reuse values wherever
possible, but I'll not 
submit the new patch as it does not address any of the issues listed above; it
just makes it a bit 
faster and alot easier to read.

------- Comment #4 From Nic 2004-04-12 07:32:53 CET -------
Created an attachment (id=300) [details]
rings.patch (new)

Here is a version of the patch with expanded comments/documentation, a more
readable (and hopefully optimized) algorithm for drawing the rings, and the
ability for coarse scans to print over the rings (with a nice 1-pixel black
stroke for enhanced readability)

The latter was done by pushing the PrintCoarseScan* functions down into
RotatePlanet(), and making RotatePlanet() cognisant of a small part of the
MenuState.  Yes, this means that the Coarse Scan prints once per frame when the
coarse scan is activated.  No, there isn't a noticable performance hit for
doing so, at least not on my machine.

This patch is my final submission for the issue; I posit that it's ready to go
in (coredev willing), despite the fact that some gas giants have funny coloured
rings (Uranus, for example) but if anyone knows how that crazy pointer
arithmetic goo in the colourmap works, they can patch over the top of it.

------- Comment #5 From Nic 2004-04-12 07:40:59 CET -------
Created an attachment (id=301) [details]
screenshot (new)

Here is a screenshot of the new code.

------- Comment #6 From Nic 2004-04-20 05:41:58 CET -------
Created an attachment (id=306) [details]
rings.patch (new & improved)

The rings patch suffered from an off-by-one error that would cause SEGVs if the
player visited too many gas giants (5 or so); I've fixed the patch to correct
this.

------- Comment #7 From chmmravatar 2004-05-09 12:35:21 CET -------
Looks pretty nice...

------- Comment #8 From Nic 2004-07-08 07:16:33 CET -------
Created an attachment (id=329) [details]
rings.patch (final)

"final" submission for the rings patch.  This is an improvement over previous
versions, notable changes include:

- added font_DrawTextWithStroke() function to font.c, modified coarse scan and
subtitle functions to use it

- mimicked Mika's technique for caching subtitles to cache the coarse scan;
this allows the coarse scan to be drawn once per frame without clogging up the
DCQ.

- The ring creation code now properly retrieves a colour from the planet's
colourmap, thus curing the "neon green rings" problem in previous patches.

- rings don't appear around grey, cyan, and yellow gas giants, or any gas giant
with an axial tilt of less than 5 degrees, in order to make for a bit of
variety.

------- Comment #9 From Nic 2005-01-06 22:50:03 CET -------
This patch has been rejected by coredev (to my immense regret) as it violates
the "straight port 
doctrine" that the project operates currently under.

Deferring this bug until after version 1.0 is released, and such deviations
from the original might be 
considered in a new light.

First Last Prev Next    No search results available      Search page      Enter new bug