Page 1 of 1

CreatePlane Bug?

Posted: Mon Jun 17, 2013 11:27 pm
by Samuel
If I give the plane a TileCount greater than 255 the program crashes. Not sure if it's a bug, but I thought in previous versions I could exceed 255.


Code: Select all

InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()

Width  = 800
Height = 600

;###########
TileCountX=256
TileCountZ=256
;###########

If OpenWindow(0, 0, 0, Width, Height, "Test")
  If OpenWindowedScreen(WindowID(0), 0, 0, Width, Height, 0, 0, 0)
    
    CreateTexture(0, 32, 32)
    StartDrawing(TextureOutput(0))
      Box(0, 0, 32, 32 ,RGB(255,0,0))
    StopDrawing()
      
    CreateMaterial(0, TextureID(0))
    CreatePlane(0,600,600,TileCountX,TileCountZ,1,1)
    CreateEntity(0, MeshID(0), MaterialID(0),0,-30,0)
   
    CreateCamera(0, 0,0,100,100)
    MoveCamera(0, 0, 5, 30)
    CameraLookAt(0, 0, 5, 0)
    CameraBackColor(0, RGB(20, 0, 0))
    
    CreateLight(0, RGB(200,200,200), 900, 2000, 0)
    ReleaseMouse(1)
    
    Repeat
      If ExamineKeyboard()
      EndIf
      
      RenderWorld()
      FlipBuffers()

    Until WindowEvent() = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
    
  EndIf
EndIf

End

Re: CreatePlane Bug?

Posted: Tue Jun 18, 2013 1:46 pm
by Comtois
TileCountX*TileCountZ should be <65535 (16 bits for index).
this work

Code: Select all

TileCountX=5600
TileCountZ=10

Re: CreatePlane Bug?

Posted: Tue Jun 18, 2013 8:04 pm
by Samuel
I forgot about that limit on meshes. To solve my problem I'll just create a second plane next to the first one. Thanks!