diff --git a/src/user/user_model.cc b/src/user/user_model.cc index a5833ffd..4e27b1e6 100644 --- a/src/user/user_model.cc +++ b/src/user/user_model.cc @@ -2219,13 +2219,13 @@ void mjCModel::SetSizes() { // nhfielddata for (int i=0; i < nhfield; i++) { - nhfielddata += static_cast(hfields_[i]->nrow) * hfields_[i]->ncol; + nhfielddata += static_cast(hfields_[i]->nrow) * hfields_[i]->ncol; } // ntexdata for (int i=0; i < ntex; i++) { const mjCTexture* tex = textures_[i]; - ntexdata += static_cast(tex->nchannel) * tex->width * tex->height; + ntexdata += static_cast(tex->nchannel) * tex->width * tex->height; } // nwrap @@ -3579,7 +3579,7 @@ void mjCModel::CopyObjects(mjModel* m) { // copy elevation data memcpy(m->hfield_data + data_adr, phf->data.data(), - static_cast(phf->nrow) * phf->ncol * sizeof(float)); + static_cast(phf->nrow) * phf->ncol * sizeof(float)); // advance counter data_adr += phf->nrow*phf->ncol; @@ -3600,7 +3600,7 @@ void mjCModel::CopyObjects(mjModel* m) { m->tex_adr[i] = data_adr; // copy rgb data - size_t nbytes = static_cast(ptex->nchannel) * ptex->width * ptex->height; + mjtSize nbytes = static_cast(ptex->nchannel) * ptex->width * ptex->height; memcpy(m->tex_data + data_adr, ptex->data_.data(), nbytes); // advance counter