3DS: Sort of working fog

Also expose Anaglyph 3D in graphics options in Enhanced mode
This commit is contained in:
UnknownShadow200 2024-04-07 21:21:51 +10:00
parent 24656d52df
commit 9d3283a292
2 changed files with 19 additions and 16 deletions

View file

@ -721,13 +721,13 @@ static float fogDensity = 1.0f;
static float fogEnd = 32.0f;
void Gfx_SetFog(cc_bool enabled) {
//C3D_FogGasMode(enabled ? GPU_FOG : GPU_NO_FOG, GPU_DEPTH_DENSITY, false);
C3D_FogGasMode(enabled ? GPU_FOG : GPU_NO_FOG, GPU_PLAIN_DENSITY, false);
// TODO doesn't work quite right
}
void Gfx_SetFogCol(PackedCol color) {
// TODO find better way?
u32 c = (PackedCol_R(color) << 24) | (PackedCol_G(color) << 16) | (PackedCol_B(color) << 8) | 0xFF;
u32 c = (0xFFu << 24) | (PackedCol_B(color) << 16) | (PackedCol_G(color) << 8) | PackedCol_R(color);
if (c == fogColor) return;
fogColor = c;
@ -741,7 +741,7 @@ static void ApplyFog(float* values) {
{
float val = values[i];
if (i < 128) data[i] = val;
if (i > 0) data[i + 127] = val-data[i-1];
if (i > 0) data[i + 127] = val - data[i-1];
}
FogLut_FromArray(&fog_lut, data);
@ -753,6 +753,7 @@ static void UpdateFog(void) {
float far = Game_ViewDistance;
float values[129];
// TODO: Exp calculation isn't right for lava ???
for (int i = 0; i <= 128; i ++)
{
float c = FogLut_CalcZ(i / 128.0f, near, far);

View file

@ -2919,32 +2919,34 @@ static void GraphicsOptionsScreen_SetCameraMass(const cc_string* c) {
static void GraphicsOptionsScreen_InitWidgets(struct MenuOptionsScreen* s) {
static const struct MenuOptionDesc buttons[] = {
{ -1, -100, "Camera Mass", MenuOptionsScreen_Input,
{ -1, -150, "Camera Mass", MenuOptionsScreen_Input,
GraphicsOptionsScreen_GetCameraMass, GraphicsOptionsScreen_SetCameraMass },
{ -1, -50, "FPS mode", MenuOptionsScreen_Enum,
{ -1, -100, "FPS mode", MenuOptionsScreen_Enum,
MenuOptionsScreen_GetFPS, MenuOptionsScreen_SetFPS },
{ -1, 0, "View distance", MenuOptionsScreen_Input,
{ -1, -50, "View distance", MenuOptionsScreen_Input,
GraphicsOptionsScreen_GetViewDist, GraphicsOptionsScreen_SetViewDist },
{ -1, 50, "Advanced lighting", MenuOptionsScreen_Bool,
{ -1, 0, "Advanced lighting", MenuOptionsScreen_Bool,
GraphicsOptionsScreen_GetSmooth, GraphicsOptionsScreen_SetSmooth },
{ 1, -100, "Smooth camera", MenuOptionsScreen_Bool,
{ 1, -150, "Smooth camera", MenuOptionsScreen_Bool,
GraphicsOptionsScreen_GetCamera, GraphicsOptionsScreen_SetCamera },
{ 1, -50, "Names", MenuOptionsScreen_Enum,
{ 1, -100, "Names", MenuOptionsScreen_Enum,
GraphicsOptionsScreen_GetNames, GraphicsOptionsScreen_SetNames },
{ 1, 0, "Shadows", MenuOptionsScreen_Enum,
{ 1, -50, "Shadows", MenuOptionsScreen_Enum,
GraphicsOptionsScreen_GetShadows, GraphicsOptionsScreen_SetShadows },
#ifdef CC_BUILD_N64
{ 1, 50, "Filtering", MenuOptionsScreen_Bool,
GraphicsOptionsScreen_GetMipmaps, GraphicsOptionsScreen_SetMipmaps }
{ 1, 0, "Filtering", MenuOptionsScreen_Bool,
GraphicsOptionsScreen_GetMipmaps, GraphicsOptionsScreen_SetMipmaps },
#else
{ 1, 50, "Mipmaps", MenuOptionsScreen_Bool,
GraphicsOptionsScreen_GetMipmaps, GraphicsOptionsScreen_SetMipmaps }
{ 1, 0, "Mipmaps", MenuOptionsScreen_Bool,
GraphicsOptionsScreen_GetMipmaps, GraphicsOptionsScreen_SetMipmaps },
#endif
{ 1, 50, "Anaglyph 3D", MenuOptionsScreen_Bool,
ClassicOptionsScreen_GetAnaglyph, ClassicOptionsScreen_SetAnaglyph }
};
s->numCore = 8;
s->maxVertices += 8 * BUTTONWIDGET_MAX;
s->numCore = 9;
s->maxVertices += 9 * BUTTONWIDGET_MAX;
MenuOptionsScreen_InitButtons(s, buttons, Array_Elems(buttons), Menu_SwitchOptions);
s->descriptions[0] = "&eChange the smoothness of the smooth camera.";