From 400fce6a998f71643ef7a5c7659f557ac3b8f4d4 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 21 Sep 2014 12:44:10 +0300 Subject: [PATCH] extensions/graphics3d -> extensions/graphics --- extensions/{graphics3d => graphics}/init.lua | 4 ++-- extensions/ui/init.lua | 4 ++-- test/testmodules/minigame/client_lua/init.lua | 14 +++++++------- test/testmodules/test1/client_lua/init.lua | 10 +++++----- 4 files changed, 16 insertions(+), 16 deletions(-) rename extensions/{graphics3d => graphics}/init.lua (98%) diff --git a/extensions/graphics3d/init.lua b/extensions/graphics/init.lua similarity index 98% rename from extensions/graphics3d/init.lua rename to extensions/graphics/init.lua index 83a8ed5..8af5653 100644 --- a/extensions/graphics3d/init.lua +++ b/extensions/graphics/init.lua @@ -1,8 +1,8 @@ --- Buildat: extension/graphics3d/init.lua +-- Buildat: extension/graphics/init.lua -- http://www.apache.org/licenses/LICENSE-2.0 -- Copyright 2014 Perttu Ahola local polybox = require("buildat/extension/polycode_sandbox") -local log = buildat.Logger("extension/graphics3d") +local log = buildat.Logger("extension/graphics") local dump = buildat.dump local M = {safe = {}} diff --git a/extensions/ui/init.lua b/extensions/ui/init.lua index 4f9a22b..805c5d5 100644 --- a/extensions/ui/init.lua +++ b/extensions/ui/init.lua @@ -2,7 +2,7 @@ -- http://www.apache.org/licenses/LICENSE-2.0 -- Copyright 2014 Perttu Ahola local polybox = require("buildat/extension/polycode_sandbox") -local g3d = require("buildat/extension/graphics3d") +local graphics = require("buildat/extension/graphics") local log = buildat.Logger("extension/ui") local dump = buildat.dump local M = {safe = {}} @@ -36,7 +36,7 @@ M.safe.UILabel = polybox.wrap_class("UILabel", { M.safe.UIImage = polybox.wrap_class("UIImage", { constructor = function(texture_name) polybox.check_type(texture_name, "string") - local path2 = g3d.resave_texture_for_polycode(texture_name) + local path2 = graphics.resave_texture_for_polycode(texture_name) return UIImage(path2) end, class = { diff --git a/test/testmodules/minigame/client_lua/init.lua b/test/testmodules/minigame/client_lua/init.lua index 1017b1e..15280f0 100644 --- a/test/testmodules/minigame/client_lua/init.lua +++ b/test/testmodules/minigame/client_lua/init.lua @@ -7,19 +7,19 @@ local dump = buildat.dump log:info("minigame/init.lua loaded") local cereal = require("buildat/extension/cereal") -local g3d = require("buildat/extension/graphics3d") +local graphics = require("buildat/extension/graphics") local ui = require("buildat/extension/ui") local experimental = require("buildat/extension/experimental") -local scene = g3d.Scene(g3d.Scene.SCENE_3D) -ground = g3d.ScenePrimitive(g3d.ScenePrimitive.TYPE_PLANE, 10,10) +local scene = graphics.Scene(graphics.Scene.SCENE_3D) +ground = graphics.ScenePrimitive(graphics.ScenePrimitive.TYPE_PLANE, 10,10) ground:loadTexture("minigame/green_texture.png") scene:addEntity(ground) scene:getDefaultCamera():setPosition(7,7,7) -scene:getDefaultCamera():lookAt(g3d.Vector3(0,0,0), g3d.Vector3(0,1,0)) +scene:getDefaultCamera():lookAt(graphics.Vector3(0,0,0), graphics.Vector3(0,1,0)) -local scene2d = g3d.Scene(g3d.Scene.SCENE_2D) +local scene2d = graphics.Scene(graphics.Scene.SCENE_2D) scene2d:getActiveCamera():setOrthoSize(640, 480) local label = ui.UILabel("testmodules/minigame", 32) label:setPosition(-210, 180) @@ -66,7 +66,7 @@ buildat.sub_packet("minigame:update", function(data) for x=1,field.w do local v = field.tiles[(y-1)*field.w + (x-1) + 1] if v ~= 0 then - box = g3d.ScenePrimitive(g3d.ScenePrimitive.TYPE_BOX, 1,0.5*v,1) + box = graphics.ScenePrimitive(graphics.ScenePrimitive.TYPE_BOX, 1,0.5*v,1) box:loadTexture("minigame/green_texture.png") box:setPosition(x-6, 0.25*v, y-6) scene:addEntity(box) @@ -92,7 +92,7 @@ buildat.sub_packet("minigame:update", function(data) end end if is_new then - box = g3d.ScenePrimitive(g3d.ScenePrimitive.TYPE_BOX, 0.9,0.9,0.9) + box = graphics.ScenePrimitive(graphics.ScenePrimitive.TYPE_BOX, 0.9,0.9,0.9) box:loadTexture("minigame/pink_texture.png") box:setPosition(player.x-5, 0.5, player.y-5) scene:addEntity(box) diff --git a/test/testmodules/test1/client_lua/init.lua b/test/testmodules/test1/client_lua/init.lua index af24f55..eaa6478 100644 --- a/test/testmodules/test1/client_lua/init.lua +++ b/test/testmodules/test1/client_lua/init.lua @@ -11,15 +11,15 @@ local test = require("buildat/extension/test") test.f() -- Test some 3D things -local g3d = require("buildat/extension/graphics3d") +local graphics = require("buildat/extension/graphics") -scene = g3d.Scene(g3d.Scene.SCENE_3D) -ground = g3d.ScenePrimitive(g3d.ScenePrimitive.TYPE_PLANE, 5,5) +scene = graphics.Scene(graphics.Scene.SCENE_3D) +ground = graphics.ScenePrimitive(graphics.ScenePrimitive.TYPE_PLANE, 5,5) ground:loadTexture("test1/green_texture.png") scene:addEntity(ground) scene:getDefaultCamera():setPosition(7,7,7) -scene:getDefaultCamera():lookAt(g3d.Vector3(0,0,0), g3d.Vector3(0,1,0)) +scene:getDefaultCamera():lookAt(graphics.Vector3(0,0,0), graphics.Vector3(0,1,0)) local cereal = require("buildat/extension/cereal") @@ -41,7 +41,7 @@ buildat.sub_packet("test1:add_box", function(data) local y = values.y local z = values.z log:info("values="..dump(values)) - box = g3d.ScenePrimitive(g3d.ScenePrimitive.TYPE_BOX, w,h,d) + box = graphics.ScenePrimitive(graphics.ScenePrimitive.TYPE_BOX, w,h,d) box:loadTexture("test1/pink_texture.png") box:setPosition(x, y, z) scene:addEntity(box)