Add statemap raw files for iw4

This commit is contained in:
Jan 2022-08-13 12:24:07 +02:00
parent 364d801d3f
commit 403d7f2c44
24 changed files with 1374 additions and 0 deletions

View File

@ -112,6 +112,7 @@ include "src/ZoneCommon.lua"
include "src/ObjCommon.lua"
include "src/ObjLoading.lua"
include "src/ObjWriting.lua"
include "tools/scripts/raw.lua"
-- Components group: All projects assist or are part of a tool
group "Components"
@ -136,6 +137,10 @@ group "Tools"
ZoneCodeGenerator:project()
group ""
group "Raw"
Raw:project()
group ""
-- ========================
-- Tests
-- ========================

View File

@ -0,0 +1,66 @@
alphaTest
{
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == InvSrcAlpha:
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == One:
GT0;
default:
passthrough;
}
blendFunc
{
default:
Add, InvDestAlpha, One;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
passthrough;
}
depthTest
{
mtlDepthTest == LessEqual && mtlDestBlend == Zero:
Equal;
mtlDepthTest == LessEqual:
LessEqual;
default:
Equal;
}
depthWrite
{
default:
Disable;
}
colorWrite
{
default:
Enable, Enable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,68 @@
alphaTest
{
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == InvSrcAlpha:
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == One:
GT0;
default:
passthrough;
}
blendFunc
{
default:
Add, InvDestAlpha, One;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
passthrough;
}
depthTest
{
mtlDepthTest == LessEqual && mtlDestBlend == Zero:
Equal;
mtlDepthTest == LessEqual:
LessEqual;
default:
Equal;
}
depthWrite
{
default:
Disable;
}
colorWrite
{
default:
Enable, Enable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
OneSided,
Equal, Keep, Keep, Keep,
Always, Keep, Keep, Keep;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,59 @@
alphaTest
{
default:
Always;
}
blendFunc
{
default:
Disable, One, Zero;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
passthrough;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
default:
passthrough;
}
colorWrite
{
default:
Enable, Enable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,63 @@
alphaTest
{
default:
Always;
}
blendFunc
{
default:
Disable, One, Zero;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
mtlCullFace == Back:
Front;
mtlCullFace == None:
None;
mtlCullFace == Front:
Back;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
default:
Enable;
}
colorWrite
{
default:
Enable, Enable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,59 @@
alphaTest
{
default:
passthrough;
}
blendFunc
{
default:
Disable, One, Zero;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
None;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
default:
Enable;
}
colorWrite
{
default:
Enable, Enable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,59 @@
alphaTest
{
default:
passthrough;
}
blendFunc
{
default:
Disable, One, Zero;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
None;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
default:
Enable;
}
colorWrite
{
default:
Disable, Disable;
}
polygonOffset
{
default:
shadowmap;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,59 @@
alphaTest
{
default:
passthrough;
}
blendFunc
{
default:
Disable, One, Zero;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
passthrough;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
default:
Enable;
}
colorWrite
{
default:
Disable, Disable;
}
polygonOffset
{
default:
shadowmap;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,61 @@
alphaTest
{
default:
Always;
}
blendFunc
{
default:
Disable, One, Zero;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
Back;
}
depthTest
{
default:
Disable;
}
depthWrite
{
default:
Disable;
}
colorWrite
{
default:
Disable, Enable;
}
polygonOffset
{
default:
0;
}
stencil
{
default:
OneSided,
Always, Zero, Zero, Zero,
Always, Zero, Zero, Zero;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,59 @@
alphaTest
{
default:
Always;
}
blendFunc
{
default:
Disable, One, Zero;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
Back;
}
depthTest
{
default:
LessEqual;
}
depthWrite
{
default:
Disable;
}
colorWrite
{
default:
Enable, Enable;
}
polygonOffset
{
default:
0;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,68 @@
alphaTest
{
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == InvSrcAlpha:
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == One:
GT0;
default:
passthrough;
}
blendFunc
{
default:
passthrough;
}
separateAlphaBlendFunc
{
mtlBlendOp == Disable:
Disable, One, Zero;
default:
Add, InvDestAlpha, One;
}
cullFace
{
default:
passthrough;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
mtlBlendOp == Disable:
Enable;
default:
Disable;
}
colorWrite
{
mtlPolygonOffset == 0:
Enable, Enable;
default:
Enable, Enable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,68 @@
alphaTest
{
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == InvSrcAlpha:
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == One:
GT0;
default:
passthrough;
}
blendFunc
{
default:
passthrough;
}
separateAlphaBlendFunc
{
mtlBlendOp == Disable:
Disable, One, Zero;
default:
Add, InvDestAlpha, One;
}
cullFace
{
default:
passthrough;
}
depthTest
{
default:
Disable;
}
depthWrite
{
default:
Disable;
}
colorWrite
{
mtlPolygonOffset == 0:
Enable, Enable;
default:
Enable, Enable;
}
polygonOffset
{
default:
0;
}
stencil
{
default:
Disable,
Always, Keep, Keep, Keep,
Always, Keep, Keep, Keep;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,64 @@
alphaTest
{
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == InvSrcAlpha:
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == One:
GT0;
default:
passthrough;
}
blendFunc
{
default:
passthrough;
}
separateAlphaBlendFunc
{
default:
passthrough;
}
cullFace
{
default:
passthrough;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
mtlBlendOp == Disable:
Enable;
default:
Disable;
}
colorWrite
{
default:
Enable, Enable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,66 @@
alphaTest
{
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == InvSrcAlpha:
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == One:
GT0;
default:
passthrough;
}
blendFunc
{
default:
Add, One, One;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
passthrough;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
mtlBlendOp == Disable:
Enable;
default:
Disable;
}
colorWrite
{
mtlBlendOp == Disable:
Enable, Enable;
default:
Enable, Enable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,64 @@
alphaTest
{
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == InvSrcAlpha:
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == One:
GT0;
default:
passthrough;
}
blendFunc
{
default:
Disable, One, Zero;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
passthrough;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
mtlBlendOp == Disable:
Enable;
default:
Disable;
}
colorWrite
{
default:
Disable, Disable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,59 @@
alphaTest
{
default:
passthrough;
}
blendFunc
{
default:
Add, SrcAlpha, One;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
Back;
}
depthTest
{
default:
LessEqual;
}
depthWrite
{
default:
Disable;
}
colorWrite
{
default:
Enable, Enable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,59 @@
alphaTest
{
default:
passthrough;
}
blendFunc
{
default:
passthrough;
}
separateAlphaBlendFunc
{
default:
passthrough;
}
cullFace
{
default:
passthrough;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
default:
passthrough;
}
colorWrite
{
default:
passthrough;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
passthrough;
}

View File

@ -0,0 +1,59 @@
alphaTest
{
default:
Always;
}
blendFunc
{
default:
Add, One, One;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
passthrough;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
default:
passthrough;
}
colorWrite
{
default:
Enable, Enable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,68 @@
alphaTest
{
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == InvSrcAlpha:
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == One:
GT0;
default:
passthrough;
}
blendFunc
{
default:
Add, One, InvSrcAlpha;
}
separateAlphaBlendFunc
{
mtlBlendOp == Disable:
Disable, One, Zero;
default:
Add, InvDestAlpha, One;
}
cullFace
{
default:
passthrough;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
mtlBlendOp == Disable:
Enable;
default:
passthrough;
}
colorWrite
{
mtlPolygonOffset == 0:
Enable, Enable;
default:
Enable, Enable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,59 @@
alphaTest
{
default:
passthrough;
}
blendFunc
{
default:
Add, Zero, InvSrcColor;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
passthrough;
}
depthTest
{
default:
LessEqual;
}
depthWrite
{
default:
Disable;
}
colorWrite
{
default:
Enable, Enable;
}
polygonOffset
{
default:
2;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -0,0 +1,61 @@
alphaTest
{
default:
Always;
}
blendFunc
{
default:
Disable, One, Zero;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
Back;
}
depthTest
{
default:
LessEqual;
}
depthWrite
{
default:
Disable;
}
colorWrite
{
default:
Enable, Disable;
}
polygonOffset
{
default:
2;
}
stencil
{
default:
Disable,
Always, Zero, Zero, Zero,
Always, Zero, Zero, Zero;
}
wireframe
{
default:
Enable;
}

View File

@ -0,0 +1,64 @@
alphaTest
{
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == InvSrcAlpha:
mtlAlphaTest == Always && mtlBlendOp == Add && mtlSrcBlend == SrcAlpha && mtlDestBlend == One:
GT0;
default:
passthrough;
}
blendFunc
{
default:
passthrough;
}
separateAlphaBlendFunc
{
default:
Disable, One, Zero;
}
cullFace
{
default:
passthrough;
}
depthTest
{
default:
passthrough;
}
depthWrite
{
mtlSrcBlend == One && mtlDestBlend == Zero:
Enable;
default:
Disable;
}
colorWrite
{
default:
Enable, Enable;
}
polygonOffset
{
default:
passthrough;
}
stencil
{
default:
passthrough;
}
wireframe
{
default:
Disable;
}

View File

@ -19,6 +19,11 @@ function TestFolder()
return path.getrelative(os.getcwd(), _TestFolder)
end
local _RawFolder = path.getabsolute("../../raw")
function RawFolder()
return path.getrelative(os.getcwd(), _RawFolder)
end
-- Target Directories
TargetDirectoryBin = "%{wks.location}/bin/%{cfg.buildcfg}_%{cfg.platform}"
TargetDirectoryLib = "%{wks.location}/lib/%{cfg.buildcfg}_%{cfg.platform}"

52
tools/scripts/raw.lua Normal file
View File

@ -0,0 +1,52 @@
Raw = {}
function Raw:include(includes)
if includes:handle(self:name()) then
Utils:include(includes)
includedirs {
RawFolder()
}
end
end
function Raw:link(links)
end
function Raw:use()
end
function Raw:name()
return "Raw"
end
function Raw:project()
local folder = RawFolder()
project(self:name())
targetdir(TargetDirectoryBin)
location "%{wks.location}/raw"
kind "Utility"
files {
path.join(folder, "*/**"),
path.join(folder, "*/**")
}
vpaths {
["*"] = {
folder
}
}
filter "files:**"
buildmessage 'Copying rawfile %{file.relpath}'
buildcommands {
-- Relpath contains two .. so build/raw is getting reverted in the target path
"cp \"%{file.relpath}\" \"%{cfg.targetdir}/build/raw/%{file.relpath}\""
}
buildoutputs {
"%{cfg.targetdir}/build/raw/%{file.relpath}"
}
filter {}
end