Skip to content

Commit

Permalink
Merge pull request #153 from Laupetin/feature/iw4-weapon-loading
Browse files Browse the repository at this point in the history
feat: iw4 weapon loading
  • Loading branch information
Laupetin authored Apr 2, 2024
2 parents 2650669 + 9b19b5f commit 012dc7a
Show file tree
Hide file tree
Showing 11 changed files with 605 additions and 127 deletions.
8 changes: 4 additions & 4 deletions raw/iw4/techniques/distortion_scale.tech.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@

#filename "distortion_scale" + UV_ANIM_SUFFIX + ZFEATHER_SUFFIX + DTEX_SUFFIX + ".tech"

#set VERTEX_SHADER "distortion_scale" + UV_ANIM_SUFFIX + ZFEATHER_SUFFIX + DTEX_SUFFIX + ".hlsl"
#set PIXEL_SHADER "distortion" + ZFEATHER_SUFFIX + ".hlsl"
#set VERTEX_SHADER "\"" + "distortion_scale" + UV_ANIM_SUFFIX + ZFEATHER_SUFFIX + DTEX_SUFFIX + ".hlsl" + "\""
#set PIXEL_SHADER "\"" + "distortion" + ZFEATHER_SUFFIX + ".hlsl" + "\""

{
stateMap "default";

vertexShader 3.0 "VERTEX_SHADER"
vertexShader 3.0 VERTEX_SHADER
{
worldViewProjectionMatrix = constant.transposeWorldViewProjectionMatrix;
#ifdef UV_ANIM
Expand All @@ -37,7 +37,7 @@
distortionScale = material.distortionScale;
}

pixelShader 3.0 "PIXEL_SHADER"
pixelShader 3.0 PIXEL_SHADER
{
normalMapSampler = material.colorMap;
colorMapSampler = sampler.resolvedPostSun;
Expand Down
8 changes: 4 additions & 4 deletions raw/iw4/techniques/particle_cloud.tech.template
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@

#filename "particle_cloud" + SPARK_SUFFIX + OUTDOOR_SUFFIX + PREMUL_SUFFIX + SPOT_SUFFIX + SHADOW_SUFFIX + ".tech"

#set VERTEX_SHADER "particle_cloud" + SPARK_SUFFIX + OUTDOOR_SUFFIX + SPOT_SUFFIX + ".hlsl"
#set PIXEL_SHADER "particle_cloud" + SPARK_SUFFIX + OUTDOOR_SUFFIX + SPOT_SUFFIX + SHADOW_SUFFIX + PREMUL_SUFFIX + ".hlsl"
#set VERTEX_SHADER "\"" + "particle_cloud" + SPARK_SUFFIX + OUTDOOR_SUFFIX + SPOT_SUFFIX + ".hlsl" + "\""
#set PIXEL_SHADER "\"" + "particle_cloud" + SPARK_SUFFIX + OUTDOOR_SUFFIX + SPOT_SUFFIX + SHADOW_SUFFIX + PREMUL_SUFFIX + ".hlsl" + "\""

{
stateMap "default";

vertexShader 3.0 "VERTEX_SHADER"
vertexShader 3.0 VERTEX_SHADER
{
worldViewMatrix = constant.transposeWorldViewMatrix;
#if MODE == "spark"
Expand All @@ -62,7 +62,7 @@
#endif
}

pixelShader 3.0 "PIXEL_SHADER"
pixelShader 3.0 PIXEL_SHADER
{
colorMapSampler = material.colorMap;
#ifdef OUTDOOR
Expand Down
3 changes: 3 additions & 0 deletions src/Common/Game/IW4/IW4.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ namespace IW4
WFT_NOTETRACKSOUNDMAP,
WFT_NOTETRACKRUMBLEMAP,

// Custom
WFT_ANIM_NAME,

WFT_NUM_FIELD_TYPES,
};

Expand Down
6 changes: 6 additions & 0 deletions src/ObjCommon/Game/IW4/InfoString/EnumStrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,10 @@ namespace IW4
"rear",
"all",
};

inline const char* bounceSoundSuffixes[]{
"_default", "_bark", "_brick", "_carpet", "_cloth", "_concrete", "_dirt", "_flesh", "_foliage", "_glass", "_grass",
"_gravel", "_ice", "_metal", "_mud", "_paper", "_plaster", "_rock", "_sand", "_snow", "_water", "_wood",
"_asphalt", "_ceramic", "_plastic", "_rubber", "_cushion", "_fruit", "_painted_metal", "_riot_shield", "_slush",
};
} // namespace IW4
216 changes: 108 additions & 108 deletions src/ObjCommon/Game/IW4/InfoString/WeaponFields.h

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ bool AssetLoaderVertexDecl::LoadFromRaw(
MaterialVertexDeclaration decl{};

size_t currentOffset = 0u;

if (!assetName.empty() && assetName[0] == ',')
currentOffset = 1u;

std::string sourceAbbreviation;
while (NextAbbreviation(assetName, sourceAbbreviation, currentOffset))
{
Expand Down
Loading

0 comments on commit 012dc7a

Please sign in to comment.