diff --git a/DataSpec/DNACommon/TXTR.cpp b/DataSpec/DNACommon/TXTR.cpp index 174e65376..0c1c238a0 100644 --- a/DataSpec/DNACommon/TXTR.cpp +++ b/DataSpec/DNACommon/TXTR.cpp @@ -352,27 +352,28 @@ static const uint8_t* DecodePaletteSPLT(png_structrp png, png_infop info, return data; } +static const png_color C4Colors[] = +{ + {0,0,0}, + {155,0,0}, + {0,155,0}, + {0,0,155}, + {155,155,0}, + {155,0,155}, + {0,155,155}, + {155,155,155}, + {55,55,55}, + {255,0,0}, + {0,255,0}, + {0,0,255}, + {255,255,0}, + {255,0,255}, + {0,255,255}, + {255,255,255} +}; + static void C4Palette(png_structrp png, png_infop info) { - static const png_color C4Colors[] = - { - {0,0,0}, - {155,0,0}, - {0,155,0}, - {0,0,155}, - {155,155,0}, - {155,0,155}, - {0,155,155}, - {155,155,155}, - {55,55,55}, - {255,0,0}, - {0,255,0}, - {0,0,255}, - {255,255,0}, - {255,0,255}, - {0,255,255}, - {255,255,255} - }; png_set_PLTE(png, info, C4Colors, 16); } diff --git a/DataSpec/SpecBase.cpp b/DataSpec/SpecBase.cpp index 20d99cd2c..b8ae420a3 100644 --- a/DataSpec/SpecBase.cpp +++ b/DataSpec/SpecBase.cpp @@ -40,6 +40,11 @@ SpecBase::SpecBase(const hecl::Database::DataSpecEntry* specEntry, hecl::Databas DataSpec::UniqueIDBridge::setGlobalProject(m_project); } +static const hecl::SystemString regNONE = _S(""); +static const hecl::SystemString regE = _S("NTSC"); +static const hecl::SystemString regJ = _S("NTSC-J"); +static const hecl::SystemString regP = _S("PAL"); + bool SpecBase::canExtract(const ExtractPassInfo& info, std::vector& reps) { m_disc = nod::OpenDiscFromImage(info.srcpath.c_str(), m_isWii); @@ -67,10 +72,6 @@ bool SpecBase::canExtract(const ExtractPassInfo& info, std::vectorgetHeader().m_gameID[3]; - static const hecl::SystemString regNONE = _S(""); - static const hecl::SystemString regE = _S("NTSC"); - static const hecl::SystemString regJ = _S("NTSC-J"); - static const hecl::SystemString regP = _S("PAL"); const hecl::SystemString* regstr = ®NONE; switch (region) { diff --git a/Editor/platforms/freedesktop/mkwmicon.c b/Editor/platforms/freedesktop/mkwmicon.c index 177c77008..49c0e5949 100644 --- a/Editor/platforms/freedesktop/mkwmicon.c +++ b/Editor/platforms/freedesktop/mkwmicon.c @@ -15,6 +15,16 @@ static int CountBits(uint32_t n) return ret; } +static const int DIMS[] = +{ + 16, + 32, + 48, + 64, + 128, + 0 +}; + int main(int argc, char* argv[]) { if (argc < 2) @@ -32,16 +42,6 @@ int main(int argc, char* argv[]) png_bytep row = malloc(4 * 128); - static const int DIMS[] = - { - 16, - 32, - 48, - 64, - 128, - 0 - }; - char command[2048]; for (const int* d = DIMS ; *d != 0 ; ++d) diff --git a/Runtime/CPlayerState.cpp b/Runtime/CPlayerState.cpp index 4deabb310..6460c6e9b 100644 --- a/Runtime/CPlayerState.cpp +++ b/Runtime/CPlayerState.cpp @@ -113,21 +113,25 @@ void CPlayerState::PutTo(CBitStreamWriter &stream) stream.WriteEncoded(x184_, CBitStreamWriter::GetBitCount(0x100)); } +static const float unk[] +{ + 0.2f, 0.1f, 0.2f, 0.2f, 1.f +}; + float CPlayerState::sub_80091204() const { - static const float unk[] { - 0.2f, 0.1f, 0.2f, 0.2f, 1.f - }; + return unk[u32(x8_currentBeam)]; } +static const u32 costs[] +{ + 5, 10, 10, 10, 1 +}; + u32 CPlayerState::GetMissileCostForAltAttack() const { - static const u32 costs[] { - 5, 10, 10, 10, 1 - }; - return costs[u32(x8_currentBeam)]; } diff --git a/Runtime/Graphics/CGraphics.cpp b/Runtime/Graphics/CGraphics.cpp index 780e6e650..6c80656e5 100644 --- a/Runtime/Graphics/CGraphics.cpp +++ b/Runtime/Graphics/CGraphics.cpp @@ -131,6 +131,11 @@ void CGraphics::SetModelMatrix(const zeus::CTransform& xf) SetViewMatrix(); } +static const zeus::CMatrix4f PlusOneZ(1.f, 0.f, 0.f, 0.f, + 0.f, 1.f, 0.f, 0.f, + 0.f, 0.f, 1.f, 1.f, + 0.f, 0.f, 0.f, 1.f); + zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect, float near, float far, bool forRenderer) @@ -177,11 +182,6 @@ zeus::CMatrix4f CGraphics::CalculatePerspectiveMatrix(float fovy, float aspect, 0.f, 2.f * st.x14_near / tmb, tpb / tmb, 0.f, 0.f, 0.f, st.x18_far / fmn, st.x14_near * st.x18_far / fmn, 0.f, 0.f, -1.f, 0.f); - - static const zeus::CMatrix4f PlusOneZ(1.f, 0.f, 0.f, 0.f, - 0.f, 1.f, 0.f, 0.f, - 0.f, 0.f, 1.f, 1.f, - 0.f, 0.f, 0.f, 1.f); return PlusOneZ * mat2; } } @@ -222,11 +222,6 @@ zeus::CMatrix4f CGraphics::GetPerspectiveProjectionMatrix(bool forRenderer) 0.f, 2.f * g_Proj.x14_near / tmb, tpb / tmb, 0.f, 0.f, 0.f, g_Proj.x18_far / fmn, g_Proj.x14_near * g_Proj.x18_far / fmn, 0.f, 0.f, -1.f, 0.f); - - static const zeus::CMatrix4f PlusOneZ(1.f, 0.f, 0.f, 0.f, - 0.f, 1.f, 0.f, 0.f, - 0.f, 0.f, 1.f, 1.f, - 0.f, 0.f, 0.f, 1.f); return PlusOneZ * mat2; } } diff --git a/Runtime/Graphics/CModelShadersGLSL.cpp b/Runtime/Graphics/CModelShadersGLSL.cpp index fa0c4adef..c308976e6 100644 --- a/Runtime/Graphics/CModelShadersGLSL.cpp +++ b/Runtime/Graphics/CModelShadersGLSL.cpp @@ -41,12 +41,13 @@ static const char* LightingGLSL = " return clamp(ret, vec4(0.0,0.0,0.0,0.0), vec4(1.0,1.0,1.0,1.0));\n" "}\n"; +static const char* BlockNames[] = {HECL_GLSL_VERT_UNIFORM_BLOCK_NAME, + HECL_GLSL_TEXMTX_UNIFORM_BLOCK_NAME, + "LightingUniform"}; + hecl::Runtime::ShaderCacheExtensions CModelShaders::GetShaderExtensionsGLSL(boo::IGraphicsDataFactory::Platform plat) { - static const char* BlockNames[] = {HECL_GLSL_VERT_UNIFORM_BLOCK_NAME, - HECL_GLSL_TEXMTX_UNIFORM_BLOCK_NAME, - "LightingUniform"}; hecl::Runtime::ShaderCacheExtensions ext(plat); ext.registerExtensionSlot({LightingGLSL, "LightingFunc"}, {}, 3, BlockNames); return ext; diff --git a/Runtime/Graphics/CModelShadersMetal.cpp b/Runtime/Graphics/CModelShadersMetal.cpp index d57834700..76c6eade8 100644 --- a/Runtime/Graphics/CModelShadersMetal.cpp +++ b/Runtime/Graphics/CModelShadersMetal.cpp @@ -40,10 +40,11 @@ static const char* LightingMetal = " return saturate(ret);\n" "}\n"; +static const char* BlockNames[] = {"LightingUniform"}; + hecl::Runtime::ShaderCacheExtensions CModelShaders::GetShaderExtensionsMetal(boo::IGraphicsDataFactory::Platform plat) { - static const char* BlockNames[] = {"LightingUniform"}; hecl::Runtime::ShaderCacheExtensions ext(plat); ext.registerExtensionSlot({LightingMetal, "LightingFunc"}, {}, 1, BlockNames); return ext; diff --git a/Runtime/Graphics/CMoviePlayer.cpp b/Runtime/Graphics/CMoviePlayer.cpp index fd0fe7297..4f6cae542 100644 --- a/Runtime/Graphics/CMoviePlayer.cpp +++ b/Runtime/Graphics/CMoviePlayer.cpp @@ -188,10 +188,10 @@ static u32 StaticLoopEnd = 0; static g72x_state StaticStateLeft = {}; static g72x_state StaticStateRight = {}; +static const char* BlockNames[] = {"SpecterViewBlock"}; + void CMoviePlayer::Initialize() { - static const char* BlockNames[] = {"SpecterViewBlock"}; - GraphicsData = CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) -> bool { if (!ctx.bindingNeedsVertexFormat()) diff --git a/Runtime/Particle/CElementGen.cpp b/Runtime/Particle/CElementGen.cpp index 981c76f6e..0ba70672b 100644 --- a/Runtime/Particle/CElementGen.cpp +++ b/Runtime/Particle/CElementGen.cpp @@ -270,6 +270,13 @@ void CElementGen::Shutdown() CElementGenShaders::Shutdown(); } +static const size_t ShadClsSizes[] = +{ + sizeof(SParticleInstanceTex), + sizeof(SParticleInstanceIndTex), + sizeof(SParticleInstanceNoTex) +}; + CElementGen::CElementGen(const TToken& gen, EModelOrientationType orientType, EOptionalSystemFlags flags) @@ -442,12 +449,6 @@ CElementGen::CElementGen(const TToken& gen, else { m_shaderClass = CElementGenShaders::GetShaderClass(*this); - static const size_t ShadClsSizes[] = - { - sizeof(SParticleInstanceTex), - sizeof(SParticleInstanceIndTex), - sizeof(SParticleInstanceNoTex) - }; size_t maxInsts = x224_29_MBLR ? (m_maxMBSP * x70_MAXP) : x70_MAXP; m_gfxToken = CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) -> bool { diff --git a/Runtime/Particle/CElementGenShadersGLSL.cpp b/Runtime/Particle/CElementGenShadersGLSL.cpp index baeb84e5b..5c05cc13c 100644 --- a/Runtime/Particle/CElementGenShadersGLSL.cpp +++ b/Runtime/Particle/CElementGenShadersGLSL.cpp @@ -267,10 +267,10 @@ struct OGLElementDataBindingFactory : CElementGenShaders::IDataBindingFactory } }; +static const char* UniNames[] = {"ParticleUniform"}; + CElementGenShaders::IDataBindingFactory* CElementGenShaders::Initialize(boo::GLDataFactory::Context& ctx) { - static const char* UniNames[] = {"ParticleUniform"}; - m_texZTestZWrite = ctx.newShaderPipeline(VS_GLSL_TEX, FS_GLSL_TEX, 1, "texs", 1, UniNames, boo::BlendFactor::SrcAlpha, boo::BlendFactor::InvSrcAlpha, boo::Primitive::TriStrips, true, true, false); diff --git a/hecl b/hecl index 4c3098628..3a48b3b05 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 4c309862829daf1c6c27833ecdf03d86eae23941 +Subproject commit 3a48b3b05afacbf61cb5801fa1aa96567aa42a35 diff --git a/specter b/specter index 65cdadfe1..e40a836ea 160000 --- a/specter +++ b/specter @@ -1 +1 @@ -Subproject commit 65cdadfe16cbb63c0f7d9408e822af31b9d8dab7 +Subproject commit e40a836ea15a2a2c06a2a8c8ba511db23d4395de