Source Code Project Mantis - FSSCP
View Issue Details
0002646FSSCPgraphicspublic2012-05-05 17:172012-07-01 20:51
ReporterYarn 
Assigned ToCommanderDJ 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Platformx64OSWindows 7OS Version
Product Version3.6.13 
Target VersionFixed in Version 
Summary0002646: Default sun is not created
Description3.6.14 RC6 does not create the default white sun in missions that don't have any suns defined. This results in such missions being much darker that other missions. Default sun creation works fine in RC5.
Steps To ReproduceLoad any mission that has no suns defined, such as the one I've attached. No sun will exist if the mission is played in RC6.
TagsNo tags attached.
Attached Fileszip EmptyMission.zip (1,469) 2012-05-05 17:17
http://scp.indiegames.us/mantis/file_download.php?file_id=1834&type=bug
patch mantis2646.patch (572) 2012-05-05 23:07
http://scp.indiegames.us/mantis/file_download.php?file_id=1835&type=bug

Notes
(0013517)
Yarn   
2012-05-05 18:21   
Revision 8596 introduced this bug.

Also, the second sentence in the description should say "much darker THAN other missions."
(0013518)
CommanderDJ   
2012-05-05 23:08   
Yarn, could you please test if the attached patch fixes the issue?
(0013519)
Yarn   
2012-05-05 23:29   
Yes, it works.
(0013520)
CommanderDJ   
2012-05-05 23:33   
(Last edited: 2012-05-05 23:36)
Thank you. I tested it as well and it works on my end. Whoever copied the stuff in rev 8596 into an initialiser list must have accidentally changed that 0 to a -1. Simple one line fix. Changing status to code review so that someone can commit it.

(0013521)
niffiwan   
2012-05-05 23:44   
Fix committed to trunk@8758.
(0013528)
Goober5000   
2012-05-09 12:58   
It wasn't the transformation to an initializer list that caused the problem. It was the removal of these lines in stars_post_level_init()...

            def_sun.star_bitmap_index = 0;
            def_sun.scale_x = 1.0f;
            def_sun.scale_y = 1.0f;
            def_sun.div_x = 1;
            def_sun.div_y = 1;

But it looks like the intention *was* to set the bitmap index to 0, so the fix is appropriate. The only question is whether people who explicitly want *no* suns in the mission are still able to do that.
(0013529)
Yarn   
2012-05-09 13:44   
I don't think it's possible to have no suns right now unless a build with this bug (such as RC6) is used. Perhaps the only proper way to allow no suns would be to support a "Don't create default sun" flag in the mission file.

Keep in mind that retail FS2 always creates the default sun when no suns are present, and a number of missions (including many in FSPort) depend on this behavior for proper lighting.
(0013531)
niffiwan   
2012-05-09 17:21   
So allowing FREDers to have *no* suns in their missions would be a new feature?
(0013532)
Yarn   
2012-05-09 17:32   
Yes, it would.
(0013533)
CommanderDJ   
2012-05-09 20:29   
If I might weigh in here, in the interest of backward compatibility I think we should keep the default sun. In the particular mission where this bug was found, it was noted that it was horrendously dark, dark enough to impact gameplay and cause the player to smash into things like the AI does. We shouldn't break lighting in all the missions that, as Yarn said, rely on this for proper lighting. In light of this, I think the request for no suns should be a new feature request, and this bugfix should be left as it is.
(0013547)
Goober5000   
2012-05-11 22:43   
Okay, I just wanted to make sure that this wasn't an undocumented "feature" that people were using.

Marking as resolved then.
(0013756)
Zacam   
2012-07-01 20:51   
Fix committed to fs2_open_3_6_14@8928.

Issue History
2012-05-05 17:17YarnNew Issue
2012-05-05 17:17YarnFile Added: EmptyMission.zip
2012-05-05 18:21YarnNote Added: 0013517
2012-05-05 23:07CommanderDJFile Added: mantis2646.patch
2012-05-05 23:08CommanderDJNote Added: 0013518
2012-05-05 23:08CommanderDJAssigned To => CommanderDJ
2012-05-05 23:08CommanderDJStatusnew => assigned
2012-05-05 23:29YarnNote Added: 0013519
2012-05-05 23:33CommanderDJNote Added: 0013520
2012-05-05 23:33CommanderDJStatusassigned => code review
2012-05-05 23:36CommanderDJNote Edited: 0013520bug_revision_view_page.php?bugnote_id=13520#r118
2012-05-05 23:44niffiwanChangeset attached => fs2open trunk r8758
2012-05-05 23:44niffiwanNote Added: 0013521
2012-05-05 23:44niffiwanStatuscode review => resolved
2012-05-05 23:44niffiwanResolutionopen => fixed
2012-05-09 12:58Goober5000Note Added: 0013528
2012-05-09 12:59Goober5000Statusresolved => code review
2012-05-09 13:44YarnNote Added: 0013529
2012-05-09 17:21niffiwanNote Added: 0013531
2012-05-09 17:32YarnNote Added: 0013532
2012-05-09 20:29CommanderDJNote Added: 0013533
2012-05-11 22:43Goober5000Note Added: 0013547
2012-05-11 22:43Goober5000Statuscode review => resolved
2012-07-01 20:51ZacamChangeset attached => fs2open fs2_open_3_6_14 r8928
2012-07-01 20:51ZacamNote Added: 0013756