accc: remove CopyPoint and CopyTexCoord

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7699 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 1b9141c3a310a4e3ed78dbd9971c9a5cdcfc3e05
Former-commit-id: 8685024152af72bd0b12b3a88b78b60407eb4110
This commit is contained in:
iobyte 2021-10-03 21:58:58 +00:00
parent 5e970c55c0
commit 5650b27710
2 changed files with 13 additions and 34 deletions

View file

@ -53,20 +53,6 @@
#define SetPoint(p, a, b, c) (p).x = a; (p).y = b; (p).z = c; #define SetPoint(p, a, b, c) (p).x = a; (p).y = b; (p).z = c;
void copyPoint(point_t * dest, point_t * src)
{
dest->x = src->x;
dest->y = src->y;
dest->z = src->z;
}
void copyTexCoord(tcoord_t * dest, tcoord_t * src)
{
dest->indice = src->indice;
dest->u = src->u;
dest->v = src->v;
dest->saved = src->saved;
}
void storeTexCoord(tcoord_t * dest, int indice, double u, double v, int saved) void storeTexCoord(tcoord_t * dest, int indice, double u, double v, int saved)
{ {
dest->indice = indice; dest->indice = indice;
@ -319,20 +305,16 @@ void copyVertexArraysSurface(ob_t * destob, int destSurfIdx, ob_t * srcob, int s
int firstDestIdx = destSurfIdx * 3; int firstDestIdx = destSurfIdx * 3;
int firstSrcIdx = srcSurfIdx * 3; int firstSrcIdx = srcSurfIdx * 3;
for(int off = 0; off < 3; off++) for (int off = 0; off < 3; off++)
{ {
copyTexCoord(&(destob->vertexarray[firstDestIdx + off]), destob->vertexarray[firstDestIdx + off] = srcob->vertexarray[firstSrcIdx + off];
&(srcob->vertexarray[firstSrcIdx + off]));
if(srcob->vertexarray1) if (srcob->vertexarray1)
copyTexCoord(&(destob->vertexarray1[firstDestIdx + off]), destob->vertexarray1[firstDestIdx + off] = srcob->vertexarray1[firstSrcIdx + off];
&(srcob->vertexarray1[firstSrcIdx + off])); if (srcob->vertexarray2)
if(srcob->vertexarray2) destob->vertexarray2[firstDestIdx + off] = srcob->vertexarray2[firstSrcIdx + off];
copyTexCoord(&(destob->vertexarray2[firstDestIdx + off]), if (srcob->vertexarray3)
&(srcob->vertexarray2[firstSrcIdx + off])); destob->vertexarray3[firstDestIdx + off] = srcob->vertexarray3[firstSrcIdx + off];
if(srcob->vertexarray3)
copyTexCoord(&(destob->vertexarray3[firstDestIdx + off]),
&(srcob->vertexarray3[firstSrcIdx + off]));
} }
} }
@ -823,8 +805,8 @@ ob_t* terrainSplitOb(ob_t * object)
{ {
storedPtIdxArr[curNewPtIdx] = idx; storedPtIdxArr[curNewPtIdx] = idx;
storedIdx = curNewPtIdx; storedIdx = curNewPtIdx;
copyPoint(&(pttmp[curNewPtIdx]), &(object->vertex[idx])); pttmp[curNewPtIdx] = object->vertex[idx];
copyPoint(&(snorm[curNewPtIdx]), &(object->norm[idx])); snorm[curNewPtIdx] = object->norm[idx];
curNewPtIdx++; curNewPtIdx++;
} }
@ -929,7 +911,7 @@ ob_t* splitOb(ob_t *object)
/** find vertices of the triangle */ /** find vertices of the triangle */
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
copyTexCoord(&curvertex[i], &(object->vertexarray[curvert+i])); curvertex[i] = object->vertexarray[curvert+i];
curstoredidx[i] = findIndice(curvertex[i].indice, oldva, numptstored); curstoredidx[i] = findIndice(curvertex[i].indice, oldva, numptstored);
} }
@ -973,8 +955,8 @@ ob_t* splitOb(ob_t *object)
if (curstoredidx[i] == -1) if (curstoredidx[i] == -1)
{ {
copyPoint(&(workob->vertex[numptstored]), &(object->vertex[curvertex[i].indice])); workob->vertex[numptstored] = object->vertex[curvertex[i].indice];
copyPoint(&(workob->snorm[numptstored]), &(object->norm[curvertex[i].indice])); workob->snorm[numptstored] = object->norm[curvertex[i].indice];
clearSavedInVertexArrayEntry(object, curvert+i); clearSavedInVertexArrayEntry(object, curvert+i);

View file

@ -70,8 +70,6 @@ struct point_t
double z; double z;
}; };
void copyPoint(point_t * dest, point_t * src);
struct tcoord_t struct tcoord_t
{ {
int indice; int indice;
@ -80,7 +78,6 @@ struct tcoord_t
int saved; int saved;
}; };
void copyTexCoord(tcoord_t * dest, tcoord_t * src);
void storeTexCoord(tcoord_t * dest, int indice, double u, double v, int saved); void storeTexCoord(tcoord_t * dest, int indice, double u, double v, int saved);
struct ob_t struct ob_t