From 3af9c973568c37cace1f969742df619701fe62a0 Mon Sep 17 00:00:00 2001 From: gitmpr <89863774+gitmpr@users.noreply.github.com> Date: Sun, 24 Nov 2024 23:39:06 +0100 Subject: [PATCH] add int64 type conversion to sourdump encode and decode --- pkg/maps/decode.go | 8 ++++---- pkg/maps/encode.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/maps/decode.go b/pkg/maps/decode.go index fce423eb..e8a1cad3 100644 --- a/pkg/maps/decode.go +++ b/pkg/maps/decode.go @@ -19,7 +19,7 @@ func MapToGo(parent worldio.Cube) *Cube { children := make([]*Cube, 0) for i := 0; i < CUBE_FACTOR; i++ { cube := Cube{} - member := worldio.CubeArray_getitem(parent, i) + member := worldio.CubeArray_getitem(parent, int64(i)) if member.GetChildren().Swigcptr() != 0 { cube.Children = MapToGo(member.GetChildren()).Children @@ -28,7 +28,7 @@ func MapToGo(parent worldio.Cube) *Cube { if member.GetExt().Swigcptr() != 0 { ext := member.GetExt() for j := 0; j < 6; j++ { - surface := worldio.SurfaceInfoArray_getitem(ext.GetSurfaces(), j) + surface := worldio.SurfaceInfoArray_getitem(ext.GetSurfaces(), int64(j)) cube.SurfaceInfo[j].Lmid[0] = worldio.UcharArray_getitem(surface.GetLmid(), 0) cube.SurfaceInfo[j].Lmid[1] = worldio.UcharArray_getitem(surface.GetLmid(), 1) cube.SurfaceInfo[j].Verts = surface.GetVerts() @@ -38,13 +38,13 @@ func MapToGo(parent worldio.Cube) *Cube { // edges for j := 0; j < 12; j++ { - value := worldio.UcharArray_getitem(member.GetEdges(), j) + value := worldio.UcharArray_getitem(member.GetEdges(), int64(j)) cube.Edges[j] = value } // texture for j := 0; j < 6; j++ { - value := worldio.Uint16Array_getitem(member.GetTexture(), j) + value := worldio.Uint16Array_getitem(member.GetTexture(), int64(j)) cube.Texture[j] = value } diff --git a/pkg/maps/encode.go b/pkg/maps/encode.go index 870d6f51..784a3120 100644 --- a/pkg/maps/encode.go +++ b/pkg/maps/encode.go @@ -54,7 +54,7 @@ func MapToCXX(cube *Cube) worldio.Cube { cxx.SetMerged(cube.Merged) cxx.SetEscaped(cube.Escaped) - worldio.CubeArray_setitem(parent, i, cxx) + worldio.CubeArray_setitem(parent, int64(i), cxx) } return parent