Skip to content

Commit

Permalink
Enhanced the wormhole effect. Also typo fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherCommander committed Oct 24, 2024
1 parent 1b94d45 commit 7bb5a05
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/Core/Entities/WormholeEntity.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
#import "OOLoggingExtended.h"
#import "OOSystemDescriptionManager.h"

#define OO_WORMHOLE_COLOR_BOOST 3.0
#define OO_WORMHOLE_COLOR_FVEC4 { 0.0, 0.0, 1.0, 0.25 }

// Hidden interface
@interface WormholeEntity (Private)

Expand Down Expand Up @@ -712,7 +715,7 @@ - (void) drawImmediate:(bool)immediate translucent:(bool)translucent
// for now, a simple copy of the energy bomb draw routine
float srzd = sqrt(cam_zero_distance);

GLfloat color_fv[4] = { 0.0, 0.0, 1.0, 0.25 };
GLfloat color_fv[4] = OO_WORMHOLE_COLOR_FVEC4;

OOSetOpenGLState(OPENGL_STATE_TRANSLUCENT_PASS);
OOGL(glDisable(GL_CULL_FACE));
Expand Down Expand Up @@ -759,8 +762,6 @@ static void DrawWormholeCorona(GLfloat inner_radius, GLfloat outer_radius, int s
OOGLBEGIN(GL_TRIANGLE_STRIP);
for (i = 0; i < 360; i += step )
{
theta += delta;

rv0 = randf();
rv1 = randf();

Expand All @@ -773,9 +774,10 @@ static void DrawWormholeCorona(GLfloat inner_radius, GLfloat outer_radius, int s

s1 = r1 * sin(theta - halfStep) * 0.5 * (1.0 + rv1);
c1 = r1 * cos(theta - halfStep) * 0.5 * (1.0 + rv1);
glColor4f(col4v1[0], col4v1[1], col4v1[2], 0.0);
glColor4f(col4v1[0] * OO_WORMHOLE_COLOR_BOOST, col4v1[1] * OO_WORMHOLE_COLOR_BOOST, col4v1[2] * OO_WORMHOLE_COLOR_BOOST, col4v1[3] * rv0);
glVertex3f(s1, c1, 0.0);

theta += delta;
}
// repeat last values to close
rv0 = randf();
Expand All @@ -790,7 +792,7 @@ static void DrawWormholeCorona(GLfloat inner_radius, GLfloat outer_radius, int s

s1 = r1 * sin(halfStep) * 0.5 * (1.0 + rv1);
c1 = r1 * cos(halfStep) * 0.5 * (1.0 + rv1);
glColor4f(col4v1[0], col4v1[1], col4v1[2], 0.0);
glColor4f(col4v1[0] * OO_WORMHOLE_COLOR_BOOST, col4v1[1] * OO_WORMHOLE_COLOR_BOOST, col4v1[2] * OO_WORMHOLE_COLOR_BOOST, col4v1[3] * rv0);
glVertex3f(s1, c1, 0.0);
OOGLEND();
}
Expand Down
2 changes: 1 addition & 1 deletion src/SDL/MyOpenGLView.m
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ - (BOOL) isOutputDisplayHDREnabled
if (tempResult == ERROR_SUCCESS) isAdvColorInfo2DetectionSuccess = YES;
else
{
OOLogWARN(@"gameView.isOutputDisplayHDREnabled", @"Reeived 0x%08X while attempting to detect HDR mode using Advanced Color Info 2 API. Retrying detection using legacy API.", HRESULT_FROM_WIN32(tempResult));
OOLogWARN(@"gameView.isOutputDisplayHDREnabled", @"Received 0x%08X while attempting to detect HDR mode using Advanced Color Info 2 API. Retrying detection using legacy API.", HRESULT_FROM_WIN32(tempResult));
// no return, just fall through and try again using standard advanced color info api
}

Expand Down

0 comments on commit 7bb5a05

Please sign in to comment.