View Issue Details

IDProjectCategoryView StatusLast Update
0002646FSSCPgraphicspublic2012-07-02 00:51
ReporterYarn Assigned ToCommanderDJ  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Platformx64OSWindows 7 
Product Version3.6.13 
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.

Activities

Yarn

2012-05-05 21:17

developer  

EmptyMission.zip (1,469 bytes)

Yarn

2012-05-05 22:21

developer   ~0013517

Revision 8596 introduced this bug.

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

CommanderDJ

2012-05-06 03:07

developer  

mantis2646.patch (572 bytes)   
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;
mantis2646.patch (572 bytes)   

CommanderDJ

2012-05-06 03:08

developer   ~0013518

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

Yarn

2012-05-06 03:29

developer   ~0013519

Yes, it works.

CommanderDJ

2012-05-06 03:33

developer   ~0013520

Last edited: 2012-05-06 03: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.

niffiwan

2012-05-06 03:44

developer   ~0013521

Fix committed to trunk@8758.

Goober5000

2012-05-09 16:58

administrator   ~0013528

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.

Yarn

2012-05-09 17:44

developer   ~0013529

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.

niffiwan

2012-05-09 21:21

developer   ~0013531

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

Yarn

2012-05-09 21:32

developer   ~0013532

Yes, it would.

CommanderDJ

2012-05-10 00:29

developer   ~0013533

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.

Goober5000

2012-05-12 02:43

administrator   ~0013547

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

Marking as resolved then.

Zacam

2012-07-02 00:51

administrator   ~0013756

Fix committed to fs2_open_3_6_14@8928.

Related Changesets

fs2open: trunk r8758

2012-05-05 23:46

niffiwan


Ported: N/A

Details Diff
From CommanderDJ: Fix for mantis 0002646 Affected Issues
0002646
mod - /trunk/fs2_open/code/starfield/starfield.cpp Diff File

fs2open: fs2_open_3_6_14 r8928

2012-07-01 20:52

Zacam


Ported: N/A

Details Diff
Backport: Trunk r8758; From CommanderDJ: Fix for mantis 0002646 Affected Issues
0002646
mod - /branches/fs2_open_3_6_14/code/starfield/starfield.cpp Diff File

Issue History

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