Skip to content

Commit f3e3769

Browse files
authored
Merge pull request #3266 from The-E/fix/3250_dynamic_nebula_detail
Make nebula poof detail settings partially dynamic
2 parents 12672d0 + aeefcb4 commit f3e3769

File tree

3 files changed

+6
-42
lines changed

3 files changed

+6
-42
lines changed

code/io/keycontrol.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -692,15 +692,6 @@ void process_debug_keys(int k)
692692
case KEY_DEBUGGED + KEY_H:
693693
hud_target_toggle_hidden_from_sensors();
694694
break;
695-
696-
case KEY_DEBUGGED + KEY_F:
697-
extern int wacky_scheme;
698-
if(wacky_scheme == 3){
699-
wacky_scheme = 0;
700-
} else {
701-
wacky_scheme++;
702-
}
703-
break;
704695

705696
case KEY_DEBUGGED + KEY_ALTED + KEY_F:
706697
Framerate_delay += 10;

code/nebula/neb.cpp

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ neb2_detail Neb2_detail[MAX_DETAIL_LEVEL] = {
170170
{ // lowest detail level
171171
0.575f, // max alpha for this detail level in Glide
172172
0.71f, // max alpha for this detail level in D3d
173-
0.13f, // break alpha (below which, poofs don't draw). this affects the speed and visual quality a lot
174-
150.0f, 150.0f / 1.3333f, // x and y alpha fade/break values. adjust alpha on the polys as they move offscreen
173+
0.013f, // break alpha (below which, poofs don't draw). this affects the speed and visual quality a lot
175174
510.0f, // total dimension of player poof cube
176175
50.0f, // inner radius of the player poof cube
177176
250.0f, // outer radius of the player pood cube
@@ -181,8 +180,7 @@ neb2_detail Neb2_detail[MAX_DETAIL_LEVEL] = {
181180
{ // 2nd lowest detail level
182181
0.575f, // max alpha for this detail level in Glide
183182
0.71f, // max alpha for this detail level in D3d
184-
0.125f, // break alpha (below which, poofs don't draw). this affects the speed and visual quality a lot
185-
300.0f, 300.0f / 1.3333f, // x and y alpha fade/break values. adjust alpha on the polys as they move offscreen
183+
0.0125f, // break alpha (below which, poofs don't draw). this affects the speed and visual quality a lot
186184
550.0f, // total dimension of player poof cube
187185
100.0f, // inner radius of the player poof cube
188186
250.0f, // outer radius of the player pood cube
@@ -192,8 +190,7 @@ neb2_detail Neb2_detail[MAX_DETAIL_LEVEL] = {
192190
{ // 2nd highest detail level
193191
0.575f, // max alpha for this detail level in Glide
194192
0.71f, // max alpha for this detail level in D3d
195-
0.1f, // break alpha (below which, poofs don't draw). this affects the speed and visual quality a lot
196-
300.0f, 300.0f / 1.3333f, // x and y alpha fade/break values. adjust alpha on the polys as they move offscreen
193+
0.01f, // break alpha (below which, poofs don't draw). this affects the speed and visual quality a lot
197194
550.0f, // total dimension of player poof cube
198195
150.0f, // inner radius of the player poof cube
199196
250.0f, // outer radius of the player pood cube
@@ -203,8 +200,7 @@ neb2_detail Neb2_detail[MAX_DETAIL_LEVEL] = {
203200
{ // higest detail level
204201
0.475f, // max alpha for this detail level in Glide
205202
0.575f, // max alpha for this detail level in D3d
206-
0.05f, // break alpha (below which, poofs don't draw). this affects the speed and visual quality a lot
207-
200.0f, 200.0f / 1.3333f, // x and y alpha fade/break values. adjust alpha on the polys as they move offscreen
203+
0.005f, // break alpha (below which, poofs don't draw). this affects the speed and visual quality a lot
208204
750.0f, // total dimension of player poof cube
209205
200.0f, // inner radius of the player poof cube
210206
360.0f, // outer radius of the player pood cube
@@ -692,8 +688,8 @@ float neb2_get_alpha_2shell(float inner_radius, float outer_radius, float magic_
692688
float neb2_get_alpha_offscreen(float sx, float sy, float incoming_alpha)
693689
{
694690
float alpha = 0.0f;
695-
float per_pixel_x = incoming_alpha / (float)Nd->break_x;
696-
float per_pixel_y = incoming_alpha / (float)Nd->break_y;
691+
float per_pixel_x = incoming_alpha / (float)gr_screen.max_w;
692+
float per_pixel_y = incoming_alpha / (float)gr_screen.max_h;
697693
int off_x = ((sx < 0.0f) || (sx > (float)gr_screen.max_w));
698694
int off_y = ((sy < 0.0f) || (sy > (float)gr_screen.max_h));
699695
float off_x_amount = 0.0f;
@@ -1288,9 +1284,6 @@ void neb2_pre_render(camid cid)
12881284
}
12891285
}
12901286

1291-
// wacky scheme for smoothing colors
1292-
int wacky_scheme = 3;
1293-
12941287
// fill in the position of the eye for this frame
12951288
void neb2_get_eye_pos(vec3d *eye_vector)
12961289
{
@@ -1401,25 +1394,6 @@ DCF(neb2_break_alpha, "alpha value (0.0 to 1.0) at which faded polygons are not
14011394
dc_stuff_float(&Nd->break_alpha);
14021395
}
14031396

1404-
DCF(neb2_break_off, "how many pixels offscreen (left, right, top, bottom) when a cloud poof becomes fully transparent.")
1405-
{
1406-
int value;
1407-
dc_stuff_int(&value);
1408-
Nd->break_y = (float)value;
1409-
Nd->break_x = Nd->break_y * gr_screen.aspect;
1410-
}
1411-
1412-
DCF(neb2_smooth, "magic fog smoothing modes (0 - 3)")
1413-
{
1414-
int index;
1415-
dc_stuff_int(&index);
1416-
if ( (index >= 0) && (index <= 3) ) {
1417-
wacky_scheme = index;
1418-
} else {
1419-
dc_printf("Invalid smooth mode %i", index);
1420-
}
1421-
}
1422-
14231397
DCF(neb2_select, "Enables/disables a poof bitmap")
14241398
{
14251399
int bmap;

code/nebula/neb.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ typedef struct neb2_detail {
8787
float max_alpha_glide; // max alpha for this detail level in Glide
8888
float max_alpha_d3d; // max alpha for this detail level in D3d
8989
float break_alpha; // break alpha (below which, poofs don't draw). this affects the speed and visual quality a lot
90-
float break_x, break_y; // x and y alpha fade/break values. adjust alpha on the polys as they move offscreen
9190
float cube_dim; // total dimension of player poof cube
9291
float cube_inner; // inner radius of the player poof cube
9392
float cube_outer; // outer radius of the player pood cube

0 commit comments

Comments
 (0)