MCPcopy Create free account
hub / github.com/dfranx/ShaderDebugger / lib_common_vec_operator_add

Function lib_common_vec_operator_add

src/CommonLibrary.cpp:373–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371 return ret;
372 }
373 bv_variable lib_common_vec_operator_add(bv_program* prog, bv_object* me, u8 count, bv_variable* args)
374 {
375 bv_variable ret = bv_variable_create_void();
376
377 if (count == 1) {
378 // vec + vec
379 if (args[0].type == bv_type_object) {
380 bv_object* vec = bv_variable_get_object(args[0]);
381
382 bv_type mtype = merge_type(me->prop[0].type, vec->prop[0].type);
383
384 ret = create_vec(prog, mtype, me->type->props.name_count);
385 bv_object* retObj = bv_variable_get_object(ret);
386
387 for (u16 i = 0; i < me->type->props.name_count; i++) {
388 bv_variable_deinitialize(&retObj->prop[i]);
389 retObj->prop[i] = bv_variable_cast(mtype, bv_variable_op_add(prog, me->prop[i], vec->prop[i]));
390 }
391 }
392 }
393
394 return ret;
395 }
396 bv_variable lib_common_vec_operator_minus(bv_program* prog, bv_object* me, u8 count, bv_variable* args)
397 {
398 bv_variable ret = bv_variable_create_void();

Callers

nothing calls this directly

Calls 2

merge_typeFunction · 0.85
create_vecFunction · 0.85

Tested by

no test coverage detected