MCPcopy Create free account
hub / github.com/carbonengine/trinity / CastExpressionElementValue

Function CastExpressionElementValue

shadercompiler/FXAnalyzer.cpp:358–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

356
357
358static bool CastExpressionElementValue( ExpressionValueElement& value, int from, int to )
359{
360 if( from == to )
361 {
362 return true;
363 }
364 switch( from )
365 {
366 case OP_INT:
367 switch( to )
368 {
369 case OP_FLOAT:
370 value.floatValue = double( value.intValue );
371 return true;
372 }
373 return false;
374 case OP_FLOAT:
375 switch( to )
376 {
377 case OP_INT:
378 value.intValue = int( value.floatValue );
379 return true;
380 }
381 return false;
382 }
383 return false;
384}
385
386bool CastExpressionValue( ExpressionValue& value, const Type& from, const Type& to )
387{

Callers 1

CastExpressionValueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected