구조체를 매개 변수로 가져와야하는 GenericObject 클래스의 함수가 있지만이 구조체는 해당 자식 클래스에서 제공합니다. 이러한 모든 구조체는 동일한 멤버를 갖지만 서로 다른 크기의 매트릭스를 갖습니다.다른 행렬 구조체가 매개 변수로 전달되었습니다.
void GenericObject::SetTexture(struct* _myStructOffset)
{
for (int i = 0; i < stateNumber; i++)
{
for (int j = 0; j < indexNumber; j++)
{
SetTextureOffset(i, j, _myStructOffset[i][j]->xTex0, _myStructOffset[i][j]->xTex1, _myStructOffset[i][j]->yTex0, _myStructOffset[i][j]->yTex1, 100/*_myGenericOffset->imageW*/, 100/*_myGenericOffset->imageH*/);
}
GetMyAnimatedSprite()->SetAnimationToList();
}
}
구조체 예 :
struct ButtonsData
{
float xTex0;
float yTex0;
float xTex1;
float yTex1;
}
ButtonOffset1[3][1]
;
그리고이 같은 몇 가지 방식으로 작동한다 :
void Button::SetTexture()
{
GenericObject::SetTexture(&ButtonOffset1);
}
어떻게이 기능은 구조체 (매개 변수 분명히 잘못을)받을
나는 그것을 만든다? 사전에
감사합니다.