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

Function lib_common_vec_operator_divide

src/CommonLibrary.cpp:449–471  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

447 return ret;
448 }
449 bv_variable lib_common_vec_operator_divide(bv_program* prog, bv_object* me, u8 count, bv_variable* args)
450 {
451 bv_variable ret = bv_variable_create_void();
452
453 if (count == 1) {
454 // vec / vec
455 if (args[0].type == bv_type_object) {
456 bv_object* vec = bv_variable_get_object(args[0]);
457
458 bv_type mtype = merge_type(me->prop[0].type, vec->prop[0].type);
459
460 ret = create_vec(prog, mtype, me->type->props.name_count);
461 bv_object* retObj = bv_variable_get_object(ret);
462
463 for (u16 i = 0; i < me->type->props.name_count; i++) {
464 bv_variable_deinitialize(&retObj->prop[i]);
465 retObj->prop[i] = bv_variable_cast(mtype, bv_variable_op_divide(prog, me->prop[i], vec->prop[i]));
466 }
467 }
468 }
469
470 return ret;
471 }
472 bv_variable lib_common_vec_operator_multiply(bv_program* prog, bv_object* me, u8 count, bv_variable* args)
473 {
474 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