X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fresolve.cpp;h=f2670b53e6805a78f7a2ce6627882299904ff254;hp=3f959a7d03bad94db6fe4f7138b00f0fbb546bf7;hb=91e65bc9e24a6889995081035f6f6f0a78a6c20e;hpb=2016444ee144ce41f88c48e89c825137ad7e4ec2 diff --git a/source/glsl/resolve.cpp b/source/glsl/resolve.cpp index 3f959a7d..f2670b53 100644 --- a/source/glsl/resolve.cpp +++ b/source/glsl/resolve.cpp @@ -472,10 +472,10 @@ ExpressionResolver::Compatibility ExpressionResolver::get_compatibility(BasicTyp return NOT_COMPATIBLE; } -BasicTypeDeclaration *ExpressionResolver::find_type(BasicTypeDeclaration::Kind kind, unsigned size) +BasicTypeDeclaration *ExpressionResolver::find_type(BasicTypeDeclaration::Kind kind, unsigned size, bool sign) { for(vector::const_iterator i=basic_types.begin(); i!=basic_types.end(); ++i) - if((*i)->kind==kind && (*i)->size==size) + if((*i)->kind==kind && (*i)->size==size && (*i)->sign==sign) return *i; return 0; } @@ -561,7 +561,9 @@ void ExpressionResolver::visit(Literal &literal) if(literal.value.check_type()) resolve(literal, find_type(BasicTypeDeclaration::BOOL, 1), false); else if(literal.value.check_type()) - resolve(literal, find_type(BasicTypeDeclaration::INT, 32), false); + resolve(literal, find_type(BasicTypeDeclaration::INT, 32, true), false); + else if(literal.value.check_type()) + resolve(literal, find_type(BasicTypeDeclaration::INT, 32, false), false); else if(literal.value.check_type()) resolve(literal, find_type(BasicTypeDeclaration::FLOAT, 32), false); }