from MathUtills import integerdivide

from numba import int32, float32, boolean, short, int64
#from FaceNormal import FaceNormal
import numpy as np
import math
from MathUtills import integerdivide
import numba
from Graphics3D import method2798, method2799
from numba.experimental import jitclass
from expModel import Model

Model_type = Model.class_type.instance_type

@jitclass()
class SceneTileModel:

    vertexX : int32[:]
    vertexY : int32[:]
    vertexZ : int32[:]
    triangleColorA : int32[:]
    triangleColorB : int32[:]
    triangleColorC : int32[:]
    field1772 : int32[:]
    field1774 : int32[:]
    field1778 : int32[:]
    triangleTextureId : numba.optional(int32[:])
    flatShade : boolean
    shape : int32
    rotation : int32
    underlay : int32
    overlay : int32

    def __init__(self, field1790, field1791, var1,  var2,  var3,  var4,  var5,  var6,  var7,  var8,  var9,  var10,  var11,  var12,  var13,  var14,  var15,  var16,  var17,  var18,  var19) -> None:

        self.triangleTextureId = None




        # Static
        # self.tmpScreenX = [0] * 6
        # self.tmpScreenY = [0] * 6
        # self.vertexSceneX = [0] * 6
        # self.vertexSceneY = [0] * 6
        # self.vertexSceneZ = [0] * 6
        # self.field1790 = [[1, 3, 5, 7], [1, 3, 5, 7], [1, 3, 5, 7], [1, 3, 5, 7, 6], [1, 3, 5, 7, 6], [1, 3, 5, 7, 6], [1, 3, 5, 7, 6], [
        #     1, 3, 5, 7, 2, 6], [1, 3, 5, 7, 2, 8], [1, 3, 5, 7, 2, 8], [1, 3, 5, 7, 11, 12], [1, 3, 5, 7, 11, 12], [1, 3, 5, 7, 13, 14]]
        # self.field1791 = [[0, 1, 2, 3, 0, 0, 1, 3], [1, 1, 2, 3, 1, 0, 1, 3], [0, 1, 2, 3, 1, 0, 1, 3], [0, 0, 1, 2, 0, 0, 2, 4, 1, 0, 4, 3], [0, 0, 1, 4, 0, 0, 4, 3, 1, 1, 2, 4], [0, 0, 4, 3, 1, 0, 1, 2, 1, 0, 2, 4], [0, 1, 2, 4, 1, 0, 1, 4, 1, 0, 4, 3], [0, 4, 1, 2, 0, 4, 2, 5, 1, 0, 4, 5, 1, 0, 5, 3], [
        #     0, 4, 1, 2, 0, 4, 2, 3, 0, 4, 3, 5, 1, 0, 4, 5], [0, 0, 4, 5, 1, 4, 1, 2, 1, 4, 2, 3, 1, 4, 3, 5], [0, 0, 1, 5, 0, 1, 4, 5, 0, 1, 2, 4, 1, 0, 5, 3, 1, 5, 4, 3, 1, 4, 2, 3], [1, 0, 1, 5, 1, 1, 4, 5, 1, 1, 2, 4, 0, 0, 5, 3, 0, 5, 4, 3, 0, 4, 2, 3], [1, 0, 5, 4, 1, 0, 1, 5, 0, 0, 4, 3, 0, 4, 5, 3, 0, 5, 2, 3, 0, 1, 2, 5]]



        var7 == var6 and var8 == var6 and var9 == var6
        self.flatShade = var7

        self.shape = var1
        self.rotation = var2
        self.underlay = var18
        self.overlay = var19
        var20 = 128
        var21 = integerdivide(var20, 2)
        var22 = integerdivide(var20, 4)
        var23 = integerdivide(var20 * 3, 4)
        var24 = field1790[var1]
        var25 = len(var24)
        self.vertexX = np.zeros(shape = (var25), dtype = np.int32) # [0] * var25
        self.vertexY = np.zeros(shape = (var25), dtype = np.int32) #[0] * var25
        self.vertexZ = np.zeros(shape = (var25), dtype = np.int32) #[0] * var25
        var26 = np.zeros(shape = (var25), dtype = np.int32) # [0] * var25
        var27 = np.zeros(shape = (var25), dtype = np.int32)  #[0] * var25
        var28 = var20 * var4
        var29 = var5 * var20

        for var30 in range(0, var25):
            var31 = var24[var30]
            if((var31 & 1) == 0 and var31 <= 8):
                var31 = (var31 - var2 - var2 - 1 & 7) + 1

            if(var31 > 8 and var31 <= 12):
                var31 = (var31 - 9 - var2 & 3) + 9

            if(var31 > 12 and var31 <= 16):
                var31 = (var31 - 13 - var2 & 3) + 13

            if(var31 == 1):
                var32 = var28
                var33 = var29
                var34 = var6
                var35 = var10
                var36 = var14
            elif(var31 == 2):
                var32 = var28 + var21
                var33 = var29
                var34 = var7 + var6 >> 1
                var35 = var11 + var10 >> 1
                var36 = var15 + var14 >> 1
            elif(var31 == 3):
                var32 = var28 + var20
                var33 = var29
                var34 = var7
                var35 = var11
                var36 = var15
            elif(var31 == 4):
                var32 = var28 + var20
                var33 = var29 + var21
                var34 = var8 + var7 >> 1
                var35 = var11 + var12 >> 1
                var36 = var15 + var16 >> 1
            elif(var31 == 5):
                var32 = var28 + var20
                var33 = var29 + var20
                var34 = var8
                var35 = var12
                var36 = var16
            elif(var31 == 6):
                var32 = var28 + var21
                var33 = var29 + var20
                var34 = var8 + var9 >> 1
                var35 = var13 + var12 >> 1
                var36 = var17 + var16 >> 1
            elif(var31 == 7):
                var32 = var28
                var33 = var29 + var20
                var34 = var9
                var35 = var13
                var36 = var17
            elif(var31 == 8):
                var32 = var28
                var33 = var29 + var21
                var34 = var9 + var6 >> 1
                var35 = var13 + var10 >> 1
                var36 = var17 + var14 >> 1
            elif(var31 == 9):
                var32 = var28 + var21
                var33 = var29 + var22
                var34 = var7 + var6 >> 1
                var35 = var11 + var10 >> 1
                var36 = var15 + var14 >> 1
            elif(var31 == 10):
                var32 = var28 + var23
                var33 = var29 + var21
                var34 = var8 + var7 >> 1
                var35 = var11 + var12 >> 1
                var36 = var15 + var16 >> 1
            elif(var31 == 11):
                var32 = var28 + var21
                var33 = var29 + var23
                var34 = var8 + var9 >> 1
                var35 = var13 + var12 >> 1
                var36 = var17 + var16 >> 1
            elif(var31 == 12):
                var32 = var28 + var22
                var33 = var29 + var21
                var34 = var9 + var6 >> 1
                var35 = var13 + var10 >> 1
                var36 = var17 + var14 >> 1
            elif(var31 == 13):
                var32 = var28 + var22
                var33 = var29 + var22
                var34 = var6
                var35 = var10
                var36 = var14
            elif(var31 == 14):
                var32 = var28 + var23
                var33 = var29 + var22
                var34 = var7
                var35 = var11
                var36 = var15
            elif(var31 == 15):
                var32 = var28 + var23
                var33 = var29 + var23
                var34 = var8
                var35 = var12
                var36 = var16
            else:
                var32 = var28 + var22
                var33 = var29 + var23
                var34 = var9
                var35 = var13
                var36 = var17

            self.vertexX[var30] = var32
            self.vertexY[var30] = var34
            self.vertexZ[var30] = var33
            var26[var30] = var35
            var27[var30] = var36

        var38 = field1791[var1]
        var31 = integerdivide(len(var38), 4)
        self.field1772 = np.zeros(shape = (var31), dtype = np.int32) #[0] * var31
        self.field1774 = np.zeros(shape = (var31), dtype = np.int32) #[0] * var31
        self.field1778 = np.zeros(shape = (var31), dtype = np.int32) #[0] * var31
        self.triangleColorA = np.zeros(shape = (var31), dtype = np.int32) #[0] * var31
        self.triangleColorB = np.zeros(shape = (var31), dtype = np.int32) #[0] * var31
        self.triangleColorC = np.zeros(shape = (var31), dtype = np.int32) #[0] * var31
        if(var3 != -1):
            self.triangleTextureId = np.zeros(shape = (var31), dtype = np.int32) # [0] * var31

        var32 = 0

        for var33 in range(0, var31):
            var34 = var38[var32]
            var35 = var38[var32 + 1]
            var36 = var38[var32 + 2]
            var37 = var38[var32 + 3]
            var32 += 4
            if(var35 < 4):
                var35 = var35 - var2 & 3

            if(var36 < 4):
                var36 = var36 - var2 & 3

            if(var37 < 4):
                var37 = var37 - var2 & 3

            self.field1772[var33] = var35
            self.field1774[var33] = var36
            self.field1778[var33] = var37
            if(var34 == 0):
                self.triangleColorA[var33] = var26[var35]
                self.triangleColorB[var33] = var26[var36]
                self.triangleColorC[var33] = var26[var37]
                if(self.triangleTextureId is not None):
                    self.triangleTextureId[var33] = -1

            else:
                self.triangleColorA[var33] = var27[var35]
                self.triangleColorB[var33] = var27[var36]
                self.triangleColorC[var33] = var27[var37]
                if(self.triangleTextureId is not None):
                    self.triangleTextureId[var33] = var3

        var33 = var6
        var34 = var7
        if(var7 < var6):
            var33 = var7

        if(var7 > var7):
            var34 = var7

        if(var8 < var33):
            var33 = var8

        if(var8 > var34):
            var34 = var8

        if(var9 < var33):
            var33 = var9

        if(var9 > var34):
            var34 = var9

        var34 = integerdivide(var34, 14)

939768ba44afdf271ab9a7080b5dda1f45bb0699
<mask token>

<mask token>


@jitclass()
class SceneTileModel:
    vertexX: int32[:]
    vertexY: int32[:]
    vertexZ: int32[:]
    triangleColorA: int32[:]
    triangleColorB: int32[:]
    triangleColorC: int32[:]
    field1772: int32[:]
    field1774: int32[:]
    field1778: int32[:]
    triangleTextureId: numba.optional(int32[:])
    flatShade: boolean
    shape: int32
    rotation: int32
    underlay: int32
    overlay: int32

    def __init__(self, field1790, field1791, var1, var2, var3, var4, var5,
        var6, var7, var8, var9, var10, var11, var12, var13, var14, var15,
        var16, var17, var18, var19) ->None:
        self.triangleTextureId = None
        var7 == var6 and var8 == var6 and var9 == var6
        self.flatShade = var7
        self.shape = var1
        self.rotation = var2
        self.underlay = var18
        self.overlay = var19
        var20 = 128
        var21 = integerdivide(var20, 2)
        var22 = integerdivide(var20, 4)
        var23 = integerdivide(var20 * 3, 4)
        var24 = field1790[var1]
        var25 = len(var24)
        self.vertexX = np.zeros(shape=var25, dtype=np.int32)
        self.vertexY = np.zeros(shape=var25, dtype=np.int32)
        self.vertexZ = np.zeros(shape=var25, dtype=np.int32)
        var26 = np.zeros(shape=var25, dtype=np.int32)
        var27 = np.zeros(shape=var25, dtype=np.int32)
        var28 = var20 * var4
        var29 = var5 * var20
        for var30 in range(0, var25):
            var31 = var24[var30]
            if var31 & 1 == 0 and var31 <= 8:
                var31 = (var31 - var2 - var2 - 1 & 7) + 1
            if var31 > 8 and var31 <= 12:
                var31 = (var31 - 9 - var2 & 3) + 9
            if var31 > 12 and var31 <= 16:
                var31 = (var31 - 13 - var2 & 3) + 13
            if var31 == 1:
                var32 = var28
                var33 = var29
                var34 = var6
                var35 = var10
                var36 = var14
            elif var31 == 2:
                var32 = var28 + var21
                var33 = var29
                var34 = var7 + var6 >> 1
                var35 = var11 + var10 >> 1
                var36 = var15 + var14 >> 1
            elif var31 == 3:
                var32 = var28 + var20
                var33 = var29
                var34 = var7
                var35 = var11
                var36 = var15
            elif var31 == 4:
                var32 = var28 + var20
                var33 = var29 + var21
                var34 = var8 + var7 >> 1
                var35 = var11 + var12 >> 1
                var36 = var15 + var16 >> 1
            elif var31 == 5:
                var32 = var28 + var20
                var33 = var29 + var20
                var34 = var8
                var35 = var12
                var36 = var16
            elif var31 == 6:
                var32 = var28 + var21
                var33 = var29 + var20
                var34 = var8 + var9 >> 1
                var35 = var13 + var12 >> 1
                var36 = var17 + var16 >> 1
            elif var31 == 7:
                var32 = var28
                var33 = var29 + var20
                var34 = var9
                var35 = var13
                var36 = var17
            elif var31 == 8:
                var32 = var28
                var33 = var29 + var21
                var34 = var9 + var6 >> 1
                var35 = var13 + var10 >> 1
                var36 = var17 + var14 >> 1
            elif var31 == 9:
                var32 = var28 + var21
                var33 = var29 + var22
                var34 = var7 + var6 >> 1
                var35 = var11 + var10 >> 1
                var36 = var15 + var14 >> 1
            elif var31 == 10:
                var32 = var28 + var23
                var33 = var29 + var21
                var34 = var8 + var7 >> 1
                var35 = var11 + var12 >> 1
                var36 = var15 + var16 >> 1
            elif var31 == 11:
                var32 = var28 + var21
                var33 = var29 + var23
                var34 = var8 + var9 >> 1
                var35 = var13 + var12 >> 1
                var36 = var17 + var16 >> 1
            elif var31 == 12:
                var32 = var28 + var22
                var33 = var29 + var21
                var34 = var9 + var6 >> 1
                var35 = var13 + var10 >> 1
                var36 = var17 + var14 >> 1
            elif var31 == 13:
                var32 = var28 + var22
                var33 = var29 + var22
                var34 = var6
                var35 = var10
                var36 = var14
            elif var31 == 14:
                var32 = var28 + var23
                var33 = var29 + var22
                var34 = var7
                var35 = var11
                var36 = var15
            elif var31 == 15:
                var32 = var28 + var23
                var33 = var29 + var23
                var34 = var8
                var35 = var12
                var36 = var16
            else:
                var32 = var28 + var22
                var33 = var29 + var23
                var34 = var9
                var35 = var13
                var36 = var17
            self.vertexX[var30] = var32
            self.vertexY[var30] = var34
            self.vertexZ[var30] = var33
            var26[var30] = var35
            var27[var30] = var36
        var38 = field1791[var1]
        var31 = integerdivide(len(var38), 4)
        self.field1772 = np.zeros(shape=var31, dtype=np.int32)
        self.field1774 = np.zeros(shape=var31, dtype=np.int32)
        self.field1778 = np.zeros(shape=var31, dtype=np.int32)
        self.triangleColorA = np.zeros(shape=var31, dtype=np.int32)
        self.triangleColorB = np.zeros(shape=var31, dtype=np.int32)
        self.triangleColorC = np.zeros(shape=var31, dtype=np.int32)
        if var3 != -1:
            self.triangleTextureId = np.zeros(shape=var31, dtype=np.int32)
        var32 = 0
        for var33 in range(0, var31):
            var34 = var38[var32]
            var35 = var38[var32 + 1]
            var36 = var38[var32 + 2]
            var37 = var38[var32 + 3]
            var32 += 4
            if var35 < 4:
                var35 = var35 - var2 & 3
            if var36 < 4:
                var36 = var36 - var2 & 3
            if var37 < 4:
                var37 = var37 - var2 & 3
            self.field1772[var33] = var35
            self.field1774[var33] = var36
            self.field1778[var33] = var37
            if var34 == 0:
                self.triangleColorA[var33] = var26[var35]
                self.triangleColorB[var33] = var26[var36]
                self.triangleColorC[var33] = var26[var37]
                if self.triangleTextureId is not None:
                    self.triangleTextureId[var33] = -1
            else:
                self.triangleColorA[var33] = var27[var35]
                self.triangleColorB[var33] = var27[var36]
                self.triangleColorC[var33] = var27[var37]
                if self.triangleTextureId is not None:
                    self.triangleTextureId[var33] = var3
        var33 = var6
        var34 = var7
        if var7 < var6:
            var33 = var7
        if var7 > var7:
            var34 = var7
        if var8 < var33:
            var33 = var8
        if var8 > var34:
            var34 = var8
        if var9 < var33:
            var33 = var9
        if var9 > var34:
            var34 = var9
        var34 = integerdivide(var34, 14)

<mask token>
Model_type = Model.class_type.instance_type


@jitclass()
class SceneTileModel:
    vertexX: int32[:]
    vertexY: int32[:]
    vertexZ: int32[:]
    triangleColorA: int32[:]
    triangleColorB: int32[:]
    triangleColorC: int32[:]
    field1772: int32[:]
    field1774: int32[:]
    field1778: int32[:]
    triangleTextureId: numba.optional(int32[:])
    flatShade: boolean
    shape: int32
    rotation: int32
    underlay: int32
    overlay: int32

    def __init__(self, field1790, field1791, var1, var2, var3, var4, var5,
        var6, var7, var8, var9, var10, var11, var12, var13, var14, var15,
        var16, var17, var18, var19) ->None:
        self.triangleTextureId = None
        var7 == var6 and var8 == var6 and var9 == var6
        self.flatShade = var7
        self.shape = var1
        self.rotation = var2
        self.underlay = var18
        self.overlay = var19
        var20 = 128
        var21 = integerdivide(var20, 2)
        var22 = integerdivide(var20, 4)
        var23 = integerdivide(var20 * 3, 4)
        var24 = field1790[var1]
        var25 = len(var24)
        self.vertexX = np.zeros(shape=var25, dtype=np.int32)
        self.vertexY = np.zeros(shape=var25, dtype=np.int32)
        self.vertexZ = np.zeros(shape=var25, dtype=np.int32)
        var26 = np.zeros(shape=var25, dtype=np.int32)
        var27 = np.zeros(shape=var25, dtype=np.int32)
        var28 = var20 * var4
        var29 = var5 * var20
        for var30 in range(0, var25):
            var31 = var24[var30]
            if var31 & 1 == 0 and var31 <= 8:
                var31 = (var31 - var2 - var2 - 1 & 7) + 1
            if var31 > 8 and var31 <= 12:
                var31 = (var31 - 9 - var2 & 3) + 9
            if var31 > 12 and var31 <= 16:
                var31 = (var31 - 13 - var2 & 3) + 13
            if var31 == 1:
                var32 = var28
                var33 = var29
                var34 = var6
                var35 = var10
                var36 = var14
            elif var31 == 2:
                var32 = var28 + var21
                var33 = var29
                var34 = var7 + var6 >> 1
                var35 = var11 + var10 >> 1
                var36 = var15 + var14 >> 1
            elif var31 == 3:
                var32 = var28 + var20
                var33 = var29
                var34 = var7
                var35 = var11
                var36 = var15
            elif var31 == 4:
                var32 = var28 + var20
                var33 = var29 + var21
                var34 = var8 + var7 >> 1
                var35 = var11 + var12 >> 1
                var36 = var15 + var16 >> 1
            elif var31 == 5:
                var32 = var28 + var20
                var33 = var29 + var20
                var34 = var8
                var35 = var12
                var36 = var16
            elif var31 == 6:
                var32 = var28 + var21
                var33 = var29 + var20
                var34 = var8 + var9 >> 1
                var35 = var13 + var12 >> 1
                var36 = var17 + var16 >> 1
            elif var31 == 7:
                var32 = var28
                var33 = var29 + var20
                var34 = var9
                var35 = var13
                var36 = var17
            elif var31 == 8:
                var32 = var28
                var33 = var29 + var21
                var34 = var9 + var6 >> 1
                var35 = var13 + var10 >> 1
                var36 = var17 + var14 >> 1
            elif var31 == 9:
                var32 = var28 + var21
                var33 = var29 + var22
                var34 = var7 + var6 >> 1
                var35 = var11 + var10 >> 1
                var36 = var15 + var14 >> 1
            elif var31 == 10:
                var32 = var28 + var23
                var33 = var29 + var21
                var34 = var8 + var7 >> 1
                var35 = var11 + var12 >> 1
                var36 = var15 + var16 >> 1
            elif var31 == 11:
                var32 = var28 + var21
                var33 = var29 + var23
                var34 = var8 + var9 >> 1
                var35 = var13 + var12 >> 1
                var36 = var17 + var16 >> 1
            elif var31 == 12:
                var32 = var28 + var22
                var33 = var29 + var21
                var34 = var9 + var6 >> 1
                var35 = var13 + var10 >> 1
                var36 = var17 + var14 >> 1
            elif var31 == 13:
                var32 = var28 + var22
                var33 = var29 + var22
                var34 = var6
                var35 = var10
                var36 = var14
            elif var31 == 14:
                var32 = var28 + var23
                var33 = var29 + var22
                var34 = var7
                var35 = var11
                var36 = var15
            elif var31 == 15:
                var32 = var28 + var23
                var33 = var29 + var23
                var34 = var8
                var35 = var12
                var36 = var16
            else:
                var32 = var28 + var22
                var33 = var29 + var23
                var34 = var9
                var35 = var13
                var36 = var17
            self.vertexX[var30] = var32
            self.vertexY[var30] = var34
            self.vertexZ[var30] = var33
            var26[var30] = var35
            var27[var30] = var36
        var38 = field1791[var1]
        var31 = integerdivide(len(var38), 4)
        self.field1772 = np.zeros(shape=var31, dtype=np.int32)
        self.field1774 = np.zeros(shape=var31, dtype=np.int32)
        self.field1778 = np.zeros(shape=var31, dtype=np.int32)
        self.triangleColorA = np.zeros(shape=var31, dtype=np.int32)
        self.triangleColorB = np.zeros(shape=var31, dtype=np.int32)
        self.triangleColorC = np.zeros(shape=var31, dtype=np.int32)
        if var3 != -1:
            self.triangleTextureId = np.zeros(shape=var31, dtype=np.int32)
        var32 = 0
        for var33 in range(0, var31):
            var34 = var38[var32]
            var35 = var38[var32 + 1]
            var36 = var38[var32 + 2]
            var37 = var38[var32 + 3]
            var32 += 4
            if var35 < 4:
                var35 = var35 - var2 & 3
            if var36 < 4:
                var36 = var36 - var2 & 3
            if var37 < 4:
                var37 = var37 - var2 & 3
            self.field1772[var33] = var35
            self.field1774[var33] = var36
            self.field1778[var33] = var37
            if var34 == 0:
                self.triangleColorA[var33] = var26[var35]
                self.triangleColorB[var33] = var26[var36]
                self.triangleColorC[var33] = var26[var37]
                if self.triangleTextureId is not None:
                    self.triangleTextureId[var33] = -1
            else:
                self.triangleColorA[var33] = var27[var35]
                self.triangleColorB[var33] = var27[var36]
                self.triangleColorC[var33] = var27[var37]
                if self.triangleTextureId is not None:
                    self.triangleTextureId[var33] = var3
        var33 = var6
        var34 = var7
        if var7 < var6:
            var33 = var7
        if var7 > var7:
            var34 = var7
        if var8 < var33:
            var33 = var8
        if var8 > var34:
            var34 = var8
        if var9 < var33:
            var33 = var9
        if var9 > var34:
            var34 = var9
        var34 = integerdivide(var34, 14)

from MathUtills import integerdivide
from numba import int32, float32, boolean, short, int64
import numpy as np
import math
from MathUtills import integerdivide
import numba
from Graphics3D import method2798, method2799
from numba.experimental import jitclass
from expModel import Model
Model_type = Model.class_type.instance_type


@jitclass()
class SceneTileModel:
    vertexX: int32[:]
    vertexY: int32[:]
    vertexZ: int32[:]
    triangleColorA: int32[:]
    triangleColorB: int32[:]
    triangleColorC: int32[:]
    field1772: int32[:]
    field1774: int32[:]
    field1778: int32[:]
    triangleTextureId: numba.optional(int32[:])
    flatShade: boolean
    shape: int32
    rotation: int32
    underlay: int32
    overlay: int32

    def __init__(self, field1790, field1791, var1, var2, var3, var4, var5,
        var6, var7, var8, var9, var10, var11, var12, var13, var14, var15,
        var16, var17, var18, var19) ->None:
        self.triangleTextureId = None
        var7 == var6 and var8 == var6 and var9 == var6
        self.flatShade = var7
        self.shape = var1
        self.rotation = var2
        self.underlay = var18
        self.overlay = var19
        var20 = 128
        var21 = integerdivide(var20, 2)
        var22 = integerdivide(var20, 4)
        var23 = integerdivide(var20 * 3, 4)
        var24 = field1790[var1]
        var25 = len(var24)
        self.vertexX = np.zeros(shape=var25, dtype=np.int32)
        self.vertexY = np.zeros(shape=var25, dtype=np.int32)
        self.vertexZ = np.zeros(shape=var25, dtype=np.int32)
        var26 = np.zeros(shape=var25, dtype=np.int32)
        var27 = np.zeros(shape=var25, dtype=np.int32)
        var28 = var20 * var4
        var29 = var5 * var20
        for var30 in range(0, var25):
            var31 = var24[var30]
            if var31 & 1 == 0 and var31 <= 8:
                var31 = (var31 - var2 - var2 - 1 & 7) + 1
            if var31 > 8 and var31 <= 12:
                var31 = (var31 - 9 - var2 & 3) + 9
            if var31 > 12 and var31 <= 16:
                var31 = (var31 - 13 - var2 & 3) + 13
            if var31 == 1:
                var32 = var28
                var33 = var29
                var34 = var6
                var35 = var10
                var36 = var14
            elif var31 == 2:
                var32 = var28 + var21
                var33 = var29
                var34 = var7 + var6 >> 1
                var35 = var11 + var10 >> 1
                var36 = var15 + var14 >> 1
            elif var31 == 3:
                var32 = var28 + var20
                var33 = var29
                var34 = var7
                var35 = var11
                var36 = var15
            elif var31 == 4:
                var32 = var28 + var20
                var33 = var29 + var21
                var34 = var8 + var7 >> 1
                var35 = var11 + var12 >> 1
                var36 = var15 + var16 >> 1
            elif var31 == 5:
                var32 = var28 + var20
                var33 = var29 + var20
                var34 = var8
                var35 = var12
                var36 = var16
            elif var31 == 6:
                var32 = var28 + var21
                var33 = var29 + var20
                var34 = var8 + var9 >> 1
                var35 = var13 + var12 >> 1
                var36 = var17 + var16 >> 1
            elif var31 == 7:
                var32 = var28
                var33 = var29 + var20
                var34 = var9
                var35 = var13
                var36 = var17
            elif var31 == 8:
                var32 = var28
                var33 = var29 + var21
                var34 = var9 + var6 >> 1
                var35 = var13 + var10 >> 1
                var36 = var17 + var14 >> 1
            elif var31 == 9:
                var32 = var28 + var21
                var33 = var29 + var22
                var34 = var7 + var6 >> 1
                var35 = var11 + var10 >> 1
                var36 = var15 + var14 >> 1
            elif var31 == 10:
                var32 = var28 + var23
                var33 = var29 + var21
                var34 = var8 + var7 >> 1
                var35 = var11 + var12 >> 1
                var36 = var15 + var16 >> 1
            elif var31 == 11:
                var32 = var28 + var21
                var33 = var29 + var23
                var34 = var8 + var9 >> 1
                var35 = var13 + var12 >> 1
                var36 = var17 + var16 >> 1
            elif var31 == 12:
                var32 = var28 + var22
                var33 = var29 + var21
                var34 = var9 + var6 >> 1
                var35 = var13 + var10 >> 1
                var36 = var17 + var14 >> 1
            elif var31 == 13:
                var32 = var28 + var22
                var33 = var29 + var22
                var34 = var6
                var35 = var10
                var36 = var14
            elif var31 == 14:
                var32 = var28 + var23
                var33 = var29 + var22
                var34 = var7
                var35 = var11
                var36 = var15
            elif var31 == 15:
                var32 = var28 + var23
                var33 = var29 + var23
                var34 = var8
                var35 = var12
                var36 = var16
            else:
                var32 = var28 + var22
                var33 = var29 + var23
                var34 = var9
                var35 = var13
                var36 = var17
            self.vertexX[var30] = var32
            self.vertexY[var30] = var34
            self.vertexZ[var30] = var33
            var26[var30] = var35
            var27[var30] = var36
        var38 = field1791[var1]
        var31 = integerdivide(len(var38), 4)
        self.field1772 = np.zeros(shape=var31, dtype=np.int32)
        self.field1774 = np.zeros(shape=var31, dtype=np.int32)
        self.field1778 = np.zeros(shape=var31, dtype=np.int32)
        self.triangleColorA = np.zeros(shape=var31, dtype=np.int32)
        self.triangleColorB = np.zeros(shape=var31, dtype=np.int32)
        self.triangleColorC = np.zeros(shape=var31, dtype=np.int32)
        if var3 != -1:
            self.triangleTextureId = np.zeros(shape=var31, dtype=np.int32)
        var32 = 0
        for var33 in range(0, var31):
            var34 = var38[var32]
            var35 = var38[var32 + 1]
            var36 = var38[var32 + 2]
            var37 = var38[var32 + 3]
            var32 += 4
            if var35 < 4:
                var35 = var35 - var2 & 3
            if var36 < 4:
                var36 = var36 - var2 & 3
            if var37 < 4:
                var37 = var37 - var2 & 3
            self.field1772[var33] = var35
            self.field1774[var33] = var36
            self.field1778[var33] = var37
            if var34 == 0:
                self.triangleColorA[var33] = var26[var35]
                self.triangleColorB[var33] = var26[var36]
                self.triangleColorC[var33] = var26[var37]
                if self.triangleTextureId is not None:
                    self.triangleTextureId[var33] = -1
            else:
                self.triangleColorA[var33] = var27[var35]
                self.triangleColorB[var33] = var27[var36]
                self.triangleColorC[var33] = var27[var37]
                if self.triangleTextureId is not None:
                    self.triangleTextureId[var33] = var3
        var33 = var6
        var34 = var7
        if var7 < var6:
            var33 = var7
        if var7 > var7:
            var34 = var7
        if var8 < var33:
            var33 = var8
        if var8 > var34:
            var34 = var8
        if var9 < var33:
            var33 = var9
        if var9 > var34:
            var34 = var9
        var34 = integerdivide(var34, 14)

from MathUtills import integerdivide

from numba import int32, float32, boolean, short, int64
#from FaceNormal import FaceNormal
import numpy as np
import math
from MathUtills import integerdivide
import numba
from Graphics3D import method2798, method2799
from numba.experimental import jitclass
from expModel import Model

Model_type = Model.class_type.instance_type

@jitclass()
class SceneTileModel:

    vertexX : int32[:]
    vertexY : int32[:]
    vertexZ : int32[:]
    triangleColorA : int32[:]
    triangleColorB : int32[:]
    triangleColorC : int32[:]
    field1772 : int32[:]
    field1774 : int32[:]
    field1778 : int32[:]
    triangleTextureId : numba.optional(int32[:])
    flatShade : boolean
    shape : int32
    rotation : int32
    underlay : int32
    overlay : int32

    def __init__(self, field1790, field1791, var1,  var2,  var3,  var4,  var5,  var6,  var7,  var8,  var9,  var10,  var11,  var12,  var13,  var14,  var15,  var16,  var17,  var18,  var19) -> None:

        self.triangleTextureId = None




        # Static
        # self.tmpScreenX = [0] * 6
        # self.tmpScreenY = [0] * 6
        # self.vertexSceneX = [0] * 6
        # self.vertexSceneY = [0] * 6
        # self.vertexSceneZ = [0] * 6
        # self.field1790 = [[1, 3, 5, 7], [1, 3, 5, 7], [1, 3, 5, 7], [1, 3, 5, 7, 6], [1, 3, 5, 7, 6], [1, 3, 5, 7, 6], [1, 3, 5, 7, 6], [
        #     1, 3, 5, 7, 2, 6], [1, 3, 5, 7, 2, 8], [1, 3, 5, 7, 2, 8], [1, 3, 5, 7, 11, 12], [1, 3, 5, 7, 11, 12], [1, 3, 5, 7, 13, 14]]
        # self.field1791 = [[0, 1, 2, 3, 0, 0, 1, 3], [1, 1, 2, 3, 1, 0, 1, 3], [0, 1, 2, 3, 1, 0, 1, 3], [0, 0, 1, 2, 0, 0, 2, 4, 1, 0, 4, 3], [0, 0, 1, 4, 0, 0, 4, 3, 1, 1, 2, 4], [0, 0, 4, 3, 1, 0, 1, 2, 1, 0, 2, 4], [0, 1, 2, 4, 1, 0, 1, 4, 1, 0, 4, 3], [0, 4, 1, 2, 0, 4, 2, 5, 1, 0, 4, 5, 1, 0, 5, 3], [
        #     0, 4, 1, 2, 0, 4, 2, 3, 0, 4, 3, 5, 1, 0, 4, 5], [0, 0, 4, 5, 1, 4, 1, 2, 1, 4, 2, 3, 1, 4, 3, 5], [0, 0, 1, 5, 0, 1, 4, 5, 0, 1, 2, 4, 1, 0, 5, 3, 1, 5, 4, 3, 1, 4, 2, 3], [1, 0, 1, 5, 1, 1, 4, 5, 1, 1, 2, 4, 0, 0, 5, 3, 0, 5, 4, 3, 0, 4, 2, 3], [1, 0, 5, 4, 1, 0, 1, 5, 0, 0, 4, 3, 0, 4, 5, 3, 0, 5, 2, 3, 0, 1, 2, 5]]



        var7 == var6 and var8 == var6 and var9 == var6
        self.flatShade = var7

        self.shape = var1
        self.rotation = var2
        self.underlay = var18
        self.overlay = var19
        var20 = 128
        var21 = integerdivide(var20, 2)
        var22 = integerdivide(var20, 4)
        var23 = integerdivide(var20 * 3, 4)
        var24 = field1790[var1]
        var25 = len(var24)
        self.vertexX = np.zeros(shape = (var25), dtype = np.int32) # [0] * var25
        self.vertexY = np.zeros(shape = (var25), dtype = np.int32) #[0] * var25
        self.vertexZ = np.zeros(shape = (var25), dtype = np.int32) #[0] * var25
        var26 = np.zeros(shape = (var25), dtype = np.int32) # [0] * var25
        var27 = np.zeros(shape = (var25), dtype = np.int32)  #[0] * var25
        var28 = var20 * var4
        var29 = var5 * var20

        for var30 in range(0, var25):
            var31 = var24[var30]
            if((var31 & 1) == 0 and var31 <= 8):
                var31 = (var31 - var2 - var2 - 1 & 7) + 1

            if(var31 > 8 and var31 <= 12):
                var31 = (var31 - 9 - var2 & 3) + 9

            if(var31 > 12 and var31 <= 16):
                var31 = (var31 - 13 - var2 & 3) + 13

            if(var31 == 1):
                var32 = var28
                var33 = var29
                var34 = var6
                var35 = var10
                var36 = var14
            elif(var31 == 2):
                var32 = var28 + var21
                var33 = var29
                var34 = var7 + var6 >> 1
                var35 = var11 + var10 >> 1
                var36 = var15 + var14 >> 1
            elif(var31 == 3):
                var32 = var28 + var20
                var33 = var29
                var34 = var7
                var35 = var11
                var36 = var15
            elif(var31 == 4):
                var32 = var28 + var20
                var33 = var29 + var21
                var34 = var8 + var7 >> 1
                var35 = var11 + var12 >> 1
                var36 = var15 + var16 >> 1
            elif(var31 == 5):
                var32 = var28 + var20
                var33 = var29 + var20
                var34 = var8
                var35 = var12
                var36 = var16
            elif(var31 == 6):
                var32 = var28 + var21
                var33 = var29 + var20
                var34 = var8 + var9 >> 1
                var35 = var13 + var12 >> 1
                var36 = var17 + var16 >> 1
            elif(var31 == 7):
                var32 = var28
                var33 = var29 + var20
                var34 = var9
                var35 = var13
                var36 = var17
            elif(var31 == 8):
                var32 = var28
                var33 = var29 + var21
                var34 = var9 + var6 >> 1
                var35 = var13 + var10 >> 1
                var36 = var17 + var14 >> 1
            elif(var31 == 9):
                var32 = var28 + var21
                var33 = var29 + var22
                var34 = var7 + var6 >> 1
                var35 = var11 + var10 >> 1
                var36 = var15 + var14 >> 1
            elif(var31 == 10):
                var32 = var28 + var23
                var33 = var29 + var21
                var34 = var8 + var7 >> 1
                var35 = var11 + var12 >> 1
                var36 = var15 + var16 >> 1
            elif(var31 == 11):
                var32 = var28 + var21
                var33 = var29 + var23
                var34 = var8 + var9 >> 1
                var35 = var13 + var12 >> 1
                var36 = var17 + var16 >> 1
            elif(var31 == 12):
                var32 = var28 + var22
                var33 = var29 + var21
                var34 = var9 + var6 >> 1
                var35 = var13 + var10 >> 1
                var36 = var17 + var14 >> 1
            elif(var31 == 13):
                var32 = var28 + var22
                var33 = var29 + var22
                var34 = var6
                var35 = var10
                var36 = var14
            elif(var31 == 14):
                var32 = var28 + var23
                var33 = var29 + var22
                var34 = var7
                var35 = var11
                var36 = var15
            elif(var31 == 15):
                var32 = var28 + var23
                var33 = var29 + var23
                var34 = var8
                var35 = var12
                var36 = var16
            else:
                var32 = var28 + var22
                var33 = var29 + var23
                var34 = var9
                var35 = var13
                var36 = var17

            self.vertexX[var30] = var32
            self.vertexY[var30] = var34
            self.vertexZ[var30] = var33
            var26[var30] = var35
            var27[var30] = var36

        var38 = field1791[var1]
        var31 = integerdivide(len(var38), 4)
        self.field1772 = np.zeros(shape = (var31), dtype = np.int32) #[0] * var31
        self.field1774 = np.zeros(shape = (var31), dtype = np.int32) #[0] * var31
        self.field1778 = np.zeros(shape = (var31), dtype = np.int32) #[0] * var31
        self.triangleColorA = np.zeros(shape = (var31), dtype = np.int32) #[0] * var31
        self.triangleColorB = np.zeros(shape = (var31), dtype = np.int32) #[0] * var31
        self.triangleColorC = np.zeros(shape = (var31), dtype = np.int32) #[0] * var31
        if(var3 != -1):
            self.triangleTextureId = np.zeros(shape = (var31), dtype = np.int32) # [0] * var31

        var32 = 0

        for var33 in range(0, var31):
            var34 = var38[var32]
            var35 = var38[var32 + 1]
            var36 = var38[var32 + 2]
            var37 = var38[var32 + 3]
            var32 += 4
            if(var35 < 4):
                var35 = var35 - var2 & 3

            if(var36 < 4):
                var36 = var36 - var2 & 3

            if(var37 < 4):
                var37 = var37 - var2 & 3

            self.field1772[var33] = var35
            self.field1774[var33] = var36
            self.field1778[var33] = var37
            if(var34 == 0):
                self.triangleColorA[var33] = var26[var35]
                self.triangleColorB[var33] = var26[var36]
                self.triangleColorC[var33] = var26[var37]
                if(self.triangleTextureId is not None):
                    self.triangleTextureId[var33] = -1

            else:
                self.triangleColorA[var33] = var27[var35]
                self.triangleColorB[var33] = var27[var36]
                self.triangleColorC[var33] = var27[var37]
                if(self.triangleTextureId is not None):
                    self.triangleTextureId[var33] = var3

        var33 = var6
        var34 = var7
        if(var7 < var6):
            var33 = var7

        if(var7 > var7):
            var34 = var7

        if(var8 < var33):
            var33 = var8

        if(var8 > var34):
            var34 = var8

        if(var9 < var33):
            var33 = var9

        if(var9 > var34):
            var34 = var9

        var34 = integerdivide(var34, 14)
