Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

possible bug.. if i disable tile culling, and object culling i get no more objects
Started by tameem50 Dec 31 2015 05:14 PM

1 reply to this topic
[TOPIC CONTROLS]
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

tameem50

[GLOBAL: userInfoPane.html]
tameem50
  • Contributor

  • 100 posts
  • Corona SDK

i'm setting both tile culling, and object culling to false

 

dusk.setPreference("enableTileCulling", false)
dusk.setPreference("enableObjectCulling", false)
 

    for object in map.layer["platform"].objects() do
        if object.name == "track" then
            local track = track.new(object, map)
            tracks[#tracks+1] = track
        end
    end

if i have tile culling turned off then these dont appear anymore..

 



[TOPIC: post.html]
#2

tameem50

[GLOBAL: userInfoPane.html]
tameem50
  • Contributor

  • 100 posts
  • Corona SDK

in the meantime i edited update.lua like this..

 

i commented out part of it.  dont think this is a great permanent solution.. but itll hold me over until caleb gets back to me :)

	-- if enableCulling then
		if not lib_culling then
			lib_culling = require("Dusk.dusk_core.run.culling")
		end

		culling = lib_culling.addCulling(map)
		map._culling = culling
		culling.screenCullingField.x, culling.screenCullingField.y = screen.centerX, screen.centerY

		culling.screenCullingField.initialize()

		for layer in map.objectLayers() do
			layer._buildAllObjectDatas()
		end

		for layer, i in map.layers() do
			if not culling.screenCullingField.layer[i] then
				if layer._layerType == "tile" then
					layer._edit(1, map.data.mapWidth, 1, map.data.mapHeight, "d")
				elseif layer._layerType == "object" then
					layer._buildAllObjects()
				end
			end
		end
	-- else
	-- 	for layer in map.tileLayers() do
	-- 		layer._edit(1, map.data.mapWidth, 1, map.data.mapHeight, "d")
	-- 	end
	-- 	for layer in map.objectLayers() do
	-- 		layer.draw(1, map.data.mapWidth, 1, map.data.mapHeight)
	-- 	end
	-- end



[topic_controls]
[/topic_controls]