mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-08-12 07:49:01 +08:00
Spec: Update functions based on std::vector
- This addresses a comment in KhronosGroup/glTF#1114
This commit is contained in:
parent
e9e6ca6707
commit
75630a60fd
@ -84,8 +84,10 @@ specified to mean the same as doing both the individual assignments
|
|||||||
represented using the notation `A == B` and is specified to mean the same as
|
represented using the notation `A == B` and is specified to mean the same as
|
||||||
`(A[ 0 ] == B[ 0 ] && A[ 1 ] == B[ 1 ])`. Inequality testing is defined as
|
`(A[ 0 ] == B[ 0 ] && A[ 1 ] == B[ 1 ])`. Inequality testing is defined as
|
||||||
`A != B` and is specified to mean the same as
|
`A != B` and is specified to mean the same as
|
||||||
`(A[ 0 ] != B[ 0 ] || A[ 1 ] != B[ 1 ])`. The functions `assign` and
|
`(A[ 0 ] != B[ 0 ] || A[ 1 ] != B[ 1 ])`.
|
||||||
`push_back` behave similarly on arrays as it is defined for c++ std::vector.
|
|
||||||
|
The functions `assign`, `back`, `pop_back`, `push_back`, and `size` behave
|
||||||
|
similarly on arrays as it is defined for c++ std::vector.
|
||||||
|
|
||||||
When a variable is said to be representable by a signed integer with `x` bits,
|
When a variable is said to be representable by a signed integer with `x` bits,
|
||||||
it means that the variable is greater than or equal to `-(1 << (x-1))`, and that
|
it means that the variable is greater than or equal to `-(1 << (x-1))`, and that
|
||||||
|
@ -80,9 +80,9 @@ bool IsTopologySplit(encoder_symbol_id, out_face_edge,
|
|||||||
out_encoder_split_symbol_id) {
|
out_encoder_split_symbol_id) {
|
||||||
if (source_symbol_id.back() != encoder_symbol_id)
|
if (source_symbol_id.back() != encoder_symbol_id)
|
||||||
return false;
|
return false;
|
||||||
*out_face_edge = source_edge_bit.pop();
|
*out_face_edge = source_edge_bit.pop_back();
|
||||||
*out_encoder_split_symbol_id = split_symbol_id.pop();
|
*out_encoder_split_symbol_id = split_symbol_id.pop_back();
|
||||||
source_symbol_id.pop();
|
source_symbol_id.pop_back();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
~~~~~
|
~~~~~
|
||||||
@ -161,7 +161,7 @@ void NewActiveCornerReached(new_corner, symbol_id) {
|
|||||||
break;
|
break;
|
||||||
case TOPOLOGY_S:
|
case TOPOLOGY_S:
|
||||||
{
|
{
|
||||||
corner_b = active_corner_stack.pop();
|
corner_b = active_corner_stack.pop_back();
|
||||||
for (i = 0; i < split_active_corners.size(); ++i) {
|
for (i = 0; i < split_active_corners.size(); ++i) {
|
||||||
if (split_active_corners[i].decoder_split_symbol_id == symbol_id) {
|
if (split_active_corners[i].decoder_split_symbol_id == symbol_id) {
|
||||||
active_corner_stack.push_back(split_active_corners[i].corner);
|
active_corner_stack.push_back(split_active_corners[i].corner);
|
||||||
|
@ -36,7 +36,7 @@ int ComputePriority(corner_id) {
|
|||||||
int PopNextCornerToTraverse() {
|
int PopNextCornerToTraverse() {
|
||||||
for (i = best_priority_; i < kMaxPriority; ++i) {
|
for (i = best_priority_; i < kMaxPriority; ++i) {
|
||||||
if (!traversal_stacks_[i].empty()) {
|
if (!traversal_stacks_[i].empty()) {
|
||||||
ret = traversal_stacks_[i].pop();
|
ret = traversal_stacks_[i].pop_back();
|
||||||
best_priority_ = i;
|
best_priority_ = i;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ void MeshPredictionSchemeTexCoordsPortablePredictor_ComputePredictedValue(
|
|||||||
temp_vec.push_back(-pn_uv[0]);
|
temp_vec.push_back(-pn_uv[0]);
|
||||||
norm_squared = IntSqrt(cx_norm2_squared * pn_norm2_squared);
|
norm_squared = IntSqrt(cx_norm2_squared * pn_norm2_squared);
|
||||||
MultiplyScalar(temp_vec, norm_squared, &cx_uv);
|
MultiplyScalar(temp_vec, norm_squared, &cx_uv);
|
||||||
orientation = pred_tex_coords_orientaitons[curr_att_dec][curr_att].pop();
|
orientation = pred_tex_coords_orientaitons[curr_att_dec][curr_att].pop_back();
|
||||||
if (orientation)
|
if (orientation)
|
||||||
AddVectors(x_uv, cx_uv, &temp_vec);
|
AddVectors(x_uv, cx_uv, &temp_vec);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user