Einzelnen Beitrag anzeigen

Benutzerbild von Zacherl
Zacherl

Registriert seit: 3. Sep 2004
4.629 Beiträge
 
Delphi 10.2 Tokyo Starter
 
#1

C++ Struct nach Delphi portieren

  Alt 8. Feb 2011, 09:27
Hey,

ich habe hier ein etwas komplexeres C++ Struct, welches ich gerne nach Delphi portieren würde:
Code:
struct HPOLY
{
   HPOLY() : m_nWorldIndex(0xFFFFFFFF), m_nPolyIndex(0xFFFFFFFF) {}
   HPOLY(__int32 nWorldIndex, __int32 nPolyIndex) : m_nWorldIndex(nWorldIndex), m_nPolyIndex(nPolyIndex) {}
   HPOLY(const HPOLY& hPoly) : m_nWorldIndex(hPoly.m_nWorldIndex), m_nPolyIndex(hPoly.m_nPolyIndex) {}
   
   HPOLY &operator=(const HPOLY &hOther)
   {
      m_nWorldIndex = hOther.m_nWorldIndex;
      m_nPolyIndex = hOther.m_nPolyIndex;
      return *this;
   }

   bool operator==(const HPOLY &hOther) const
   {
      return (m_nWorldIndex == hOther.m_nWorldIndex) && (m_nPolyIndex == hOther.m_nPolyIndex);
   }
   bool operator!=(const HPOLY &hOther) const
   {
      return (m_nWorldIndex != hOther.m_nWorldIndex) || (m_nPolyIndex != hOther.m_nPolyIndex);
   }
   __int32 m_nPolyIndex, m_nWorldIndex;
};
Allerdings habe ich keine Ahnung, was die wiederholte deklaration von HPOLY im Struct selbst bedeuten soll und ebenso weiß ich nicht, wie die Struct Operatoren in Delphi umgesetzt werden können.

Ich hoffe irgendein C Kenner kann mir da weiterhelfen.

Viele Grüße
Zacherl
Projekte:
- GitHub (Profil, zyantific)
- zYan Disassembler Engine ( Zydis Online, Zydis GitHub)
  Mit Zitat antworten Zitat