2018-06-22 04:26 EDT


View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0002646FSSCPgraphicspublic2012-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 Files
  • zip file icon EmptyMission.zip (1,469 bytes) 2012-05-05 17:17
  • patch file icon mantis2646.patch (572 bytes) 2012-05-05 23:07 -
    Index: code/starfield/starfield.cpp
    ===================================================================
    --- code/starfield/starfield.cpp	(revision 8757)
    +++ code/starfield/starfield.cpp	(working copy)
    @@ -103,7 +103,7 @@
     	int n_verts;
     	vertex *verts;
     
    -	starfield_bitmap_instance() : scale_x(1.0f), scale_y(1.0f), div_x(1), div_y(1), star_bitmap_index(-1), n_verts(0), verts(NULL) {
    +	starfield_bitmap_instance() : scale_x(1.0f), scale_y(1.0f), div_x(1), div_y(1), star_bitmap_index(0), n_verts(0), verts(NULL) {
     		ang.p = 0.0f;
     		ang.b = 0.0f;
     		ang.h = 0.0f;
    
    patch file icon mantis2646.patch (572 bytes) 2012-05-05 23:07 +

-Relationships
+Relationships

-Notes

~0013517

Yarn (developer)

Revision 8596 introduced this bug.

Also, the second sentence in the description should say "much darker THAN other missions."

~0013518

CommanderDJ (developer)

Yarn, could you please test if the attached patch fixes the issue?

~0013519

Yarn (developer)

Yes, it works.

~0013520

CommanderDJ (developer)

Last edited: 2012-05-05 23:36

View 2 revisions

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 (developer)

Fix committed to trunk@8758.

~0013528

Goober5000 (administrator)

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 (developer)

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 (developer)

So allowing FREDers to have *no* suns in their missions would be a new feature?

~0013532

Yarn (developer)

Yes, it would.

~0013533

CommanderDJ (developer)

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 (administrator)

Okay, I just wanted to make sure that this wasn't an undocumented "feature" that people were using.

Marking as resolved then.

~0013756

Zacam (administrator)

Fix committed to fs2_open_3_6_14@8928.
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2012-05-05 17:17 Yarn New Issue
2012-05-05 17:17 Yarn File Added: EmptyMission.zip
2012-05-05 18:21 Yarn Note Added: 0013517
2012-05-05 23:07 CommanderDJ File Added: mantis2646.patch
2012-05-05 23:08 CommanderDJ Note Added: 0013518
2012-05-05 23:08 CommanderDJ Assigned To => CommanderDJ
2012-05-05 23:08 CommanderDJ Status new => assigned
2012-05-05 23:29 Yarn Note Added: 0013519
2012-05-05 23:33 CommanderDJ Note Added: 0013520
2012-05-05 23:33 CommanderDJ Status assigned => code review
2012-05-05 23:36 CommanderDJ Note Edited: 0013520 View Revisions
2012-05-05 23:44 niffiwan Changeset attached => fs2open trunk r8758
2012-05-05 23:44 niffiwan Note Added: 0013521
2012-05-05 23:44 niffiwan Status code review => resolved
2012-05-05 23:44 niffiwan Resolution open => fixed
2012-05-09 12:58 Goober5000 Note Added: 0013528
2012-05-09 12:59 Goober5000 Status resolved => code review
2012-05-09 13:44 Yarn Note Added: 0013529
2012-05-09 17:21 niffiwan Note Added: 0013531
2012-05-09 17:32 Yarn Note Added: 0013532
2012-05-09 20:29 CommanderDJ Note Added: 0013533
2012-05-11 22:43 Goober5000 Note Added: 0013547
2012-05-11 22:43 Goober5000 Status code review => resolved
2012-07-01 20:51 Zacam Changeset attached => fs2open fs2_open_3_6_14 r8928
2012-07-01 20:51 Zacam Note Added: 0013756
+Issue History