Merge pull request #2374 from tong/fix-uniformsmanager-register

Fix switch expression
This commit is contained in:
Lubos Lenco 2021-11-01 20:53:23 +01:00 committed by GitHub
commit 6ad9941d43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,30 +76,24 @@ class UniformsManager extends Trait{
// Helper method to register float, vec3 and texture getter functions
static function register(type: UniformType){
switch (type){
case Float:{
case Float:
if(! floatsRegistered){
floatsRegistered = true;
Uniforms.externalFloatLinks.push(floatLink);
}
}
case Vector:{
case Vector:
if(! vectorsRegistered){
vectorsRegistered = true;
Uniforms.externalVec3Links.push(vec3Link);
}
}
case Texture:{
case Texture:
if(! texturesRegistered){
texturesRegistered = true;
Uniforms.externalTextureLinks.push(textureLink);
}
}
}
}
// Register and map shader uniforms if it is an armory shader parameter
public static function registerShaderUniforms(material: MaterialData) : Bool {