yake-svn Mailing List for Yake Engine (Page 6)
Status: Beta
Brought to you by:
psyclonist
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(17) |
Sep
(51) |
Oct
(2) |
Nov
(18) |
Dec
(66) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(44) |
Feb
(13) |
Mar
(73) |
Apr
(61) |
May
|
Jun
(4) |
Jul
(19) |
Aug
(50) |
Sep
(47) |
Oct
(7) |
Nov
(7) |
Dec
(14) |
2008 |
Jan
(2) |
Feb
|
Mar
(4) |
Apr
(4) |
May
(5) |
Jun
(7) |
Jul
(4) |
Aug
|
Sep
(5) |
Oct
|
Nov
(1) |
Dec
(4) |
2009 |
Jan
|
Feb
(22) |
Mar
(12) |
Apr
(1) |
May
(1) |
Jun
(4) |
Jul
(4) |
Aug
|
Sep
|
Oct
(17) |
Nov
(3) |
Dec
|
2010 |
Jan
|
Feb
|
Mar
(12) |
Apr
(11) |
May
|
Jun
(5) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <psy...@us...> - 2008-03-31 18:00:22
|
Revision: 1912 http://yake.svn.sourceforge.net/yake/?rev=1912&view=rev Author: psyclonist Date: 2008-03-31 11:00:28 -0700 (Mon, 31 Mar 2008) Log Message: ----------- * [gui2] added media files * [gui2] fixed possible crash during shutdown of ogre when exceptions are thrown * [gui2] attempt to make use of yake's resource system * added 'gui2' and 'sampleUi1' projects Modified Paths: -------------- trunk/yake/scripts/premake/samples.lua trunk/yake/scripts/premake/yake.lua trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.cpp trunk/yake/src/gui2/plugins/style.lua/style.lua.cpp trunk/yake/src/res/source.cpp Added Paths: ----------- trunk/yake/common/media/gui2/ trunk/yake/common/media/gui2/styles/ trunk/yake/common/media/gui2/styles/lua1/ trunk/yake/common/media/gui2/styles/lua1/lua.button.lua trunk/yake/common/media/gui2/styles/lua1/lua.colours.inc.lua trunk/yake/common/media/gui2/styles/lua1/lua.cursor.lua trunk/yake/common/media/gui2/styles/lua1/lua.dialogpanel.lua trunk/yake/common/media/gui2/styles/lua1/lua.init.lua trunk/yake/common/media/gui2/styles/lua1/lua.panel.lua trunk/yake/common/media/gui2/styles/lua1/lua.statictext.lua trunk/yake/common/media/gui2/styles/lua1/lua.textedit.lua trunk/yake/common/media/gui2/styles/lua1/lua.titlebar.lua Added: trunk/yake/common/media/gui2/styles/lua1/lua.button.lua =================================================================== --- trunk/yake/common/media/gui2/styles/lua1/lua.button.lua (rev 0) +++ trunk/yake/common/media/gui2/styles/lua1/lua.button.lua 2008-03-31 18:00:28 UTC (rev 1912) @@ -0,0 +1,90 @@ +---------------------- +-- BUTTON +---------------------- +dofile "lua.colours.inc.lua" + +property["normal.colour"] = theme.colours.control_normal +property["hover.colour"] = theme.colours.control_hover +property["text.colour"] = theme.colours.control_text +property["padding"] = 2 + +---------------------- +-- Name "normal", "hover" etc is defined by the style/widget! +-- Name "forall" is defined by us for easy reuse in "normal", "hover" etc. + +function text2dim(text) + -- "2px" -> absolute + -- "1" -> relative + -- "1,2" -> 1 rel, 2 px + -- "1.2" -> 1.2 rel +end + +geometry.forall_inner = function() + local px = property["padding"] + if (this:id() == "x") then + px = px - 1 + end + render:quad( + {{0,px},{0,px}}, + {{0,px},{1,-px}}, + {{1,-px},{1,-px}}, + {{1,-px},{0,px}}) + + if (this:id() == "x") then + px = px + 2 + render:colour(property["hover.colour"]) + render:quad( + {{0,px},{0,px}}, + {{0,px},{1,-px}}, + {{1,-px},{1,-px}}, + {{1,-px},{0,px}}) + end + + if (this:id() ~= "x") then + local off = property["padding"] + 1 + render:colour(property["text.colour"]) + render:text(pos(dim(0,off),dim(0,off)), this:property("text"), theme.font, theme.text_size) + end +end + +geometry.normal = function() + if (this:id() == "x") then + render:colour(property["hover.colour"]) + render:quad({0,0},{0,1},{1,1},{1,0}) + + render:colour(property["normal.colour"]) + geometry.forall_inner() -- Reuse! + else + render:colour(property["normal.colour"]) + render:quad({0,0},{0,1},{1,1},{1,0}) + + render:colour(property["hover.colour"]) + geometry.forall_inner() -- Reuse! + end +end +geometry.hover = function() + render:colour(property["hover.colour"]) + render:quad({0,0},{0,1},{1,1},{1,0}) + + --render:colour(property["normal.colour"]) + geometry.forall_inner() -- Reuse! +end + +---------------------- +methods["minimumSize"] = function() + if (this:id() == "x") then + return size(6,6) + size(property["padding"],property["padding"]) * 2 + else + local fnt = ui:getFont(theme.font) + return fnt:getTextSize( this:property("text") ) + size(property["padding"],property["padding"]) * 2 + end +end + +---------------------- +methods["onStateChanged"] = function(from,to) + if to == "hover" then + if this:getMutator("hoverFadeOut") == nil then + this:add( ColourFader(property["normal.colour"], property["hover.colour"]) ) + end + end +end \ No newline at end of file Added: trunk/yake/common/media/gui2/styles/lua1/lua.colours.inc.lua =================================================================== --- trunk/yake/common/media/gui2/styles/lua1/lua.colours.inc.lua (rev 0) +++ trunk/yake/common/media/gui2/styles/lua1/lua.colours.inc.lua 2008-03-31 18:00:28 UTC (rev 1912) @@ -0,0 +1,65 @@ + +theme = { + colours = { + background = colour(.1,.2,.2,1), + panel_hover = background, + control_normal = colour(.2,.4,.4,1), + control_hover = colour(.3,.6,.6,1), + control_text = colour(1,1,1,1), + edit_text = colour(.8,.8,.5,1) + }, + text_size = 14, + font = "BlueHighway-10", + images = { + cursor = "cursor2-glass1.png", + } +} + + + +function toPos(v) + if (type(v) == "table") then + local out = pos(0,0) + if v[1] then + if type(v[1]) == "table" then + out.x = dim(v[1][1] or 0, v[1][2] or 0) + elseif type(v[1]) == "number" then + out.x = dim(v[1],0) + end + end + if v[2] then + if type(v[2]) == "table" then + out.y = dim(v[2][1] or 0, v[2][2] or 0) + elseif type(v[2]) == "number" then + out.y = dim(v[2],0) + end + end + return out + end + return pos(0,0) +end + +render.quad = function(self,v0,v1,v2,v3,uv0,uv1,uv2,uv3) + local v = {} + if (type(v0) == "table") then + v[1] = toPos(v0) + else + v[1] = v0 + end + if (type(v1) == "table") then + v[2] = toPos(v1) + else + v[2] = v1 + end + if (type(v2) == "table") then + v[3] = toPos(v2) + else + v[3] = v2 + end + if (type(v3) == "table") then + v[4] = toPos(v3) + else + v[4] = v3 + end + render:doquad(v[1],v[2],v[3],v[4],uv0 or uv(0,0),uv1 or uv(1,0),uv2 or uv(1,1),uv3 or uv(0,1)) +end Added: trunk/yake/common/media/gui2/styles/lua1/lua.cursor.lua =================================================================== --- trunk/yake/common/media/gui2/styles/lua1/lua.cursor.lua (rev 0) +++ trunk/yake/common/media/gui2/styles/lua1/lua.cursor.lua 2008-03-31 18:00:28 UTC (rev 1912) @@ -0,0 +1,21 @@ +---------------------- +-- Cursor +---------------------- +dofile "lua.colours.inc.lua" + +renderCursor = function(x,y) + render:pushMaterial(theme.images.cursor) + local w = 16 + local h = 16 + render:quad({{0,x},{0,y}}, + {{0,x},{0,y+h}}, + {{0,x+w},{0,y+h}}, + {{0,x+w},{0,y}}, + uv(0,0),uv(0,1),uv(1,1),uv(1,0)); + --render:quad(pos(dim(0,x),dim(0,y)), + -- pos(dim(0,x),dim(0,y+h)), + -- pos(dim(0,x+w),dim(0,y+h)), + -- pos(dim(0,x+w),dim(0,y)), + -- uv(0,0),uv(0,1),uv(1,1),uv(1,0)); + render:popMaterial() +end Added: trunk/yake/common/media/gui2/styles/lua1/lua.dialogpanel.lua =================================================================== --- trunk/yake/common/media/gui2/styles/lua1/lua.dialogpanel.lua (rev 0) +++ trunk/yake/common/media/gui2/styles/lua1/lua.dialogpanel.lua 2008-03-31 18:00:28 UTC (rev 1912) @@ -0,0 +1,53 @@ +---------------------- +-- PANEL +---------------------- +dofile "lua.colours.inc.lua" + +property["margin"] = size(5,5) --5px (on all sides) + +---------------------- +-- Name "normal" is defined by the style! +-- Name "forall" is defined by us for easy reuse. + +geometry.forall = function() + local off = 5; + render:quad( {{0,off},0}, {0,{0,off}}, {1,{0,off}}, {{1,-off},0} ) + render:quad( {0,{0,off-1}}, {0,1}, {1,1}, {1,{0,off-1}}) + + -- horiz line at the bottom + --render:colour(theme.colours.control_normal) + --render:quad( pos(0,dim(1,-2)), pos(0,1), pos(1,1), pos(1,dim(1,-2))) + + --render:quad( pos(0,dim(0,off)), pos(0,1), pos(dim(0,2),1), pos(dim(0,2),dim(0,off))) +end + +geometry.normal = function() + if this:hasMutator("move") then + render:colour(1,0,0,1) + else + render:colour(theme.colours.background) + end + geometry.forall() -- Reuse! +end +geometry.hover = function() + --render:colour(theme.colours.panel_hover) + render:colour(theme.colours.background) + geometry.forall() -- Reuse! +end + +---------------------- +-- If the pane has no child widgets then size(0,0) is returned. +-- Otherwise the minimum is set to 2*margin. +methods["minimumSize"] = function() + if this:numChildren() == 0 then + return size(0,0) + else + return size(0,0) --return property["margin"] * 2 + end +end + +--events["frame"] = function() +--end + +--events["clicked"] = function() +--end Added: trunk/yake/common/media/gui2/styles/lua1/lua.init.lua =================================================================== --- trunk/yake/common/media/gui2/styles/lua1/lua.init.lua (rev 0) +++ trunk/yake/common/media/gui2/styles/lua1/lua.init.lua 2008-03-31 18:00:28 UTC (rev 1912) @@ -0,0 +1,15 @@ + +widgets = { + Cursor = "lua.cursor.lua", + + Widget = "lua.panel.lua", + Panel = "lua.panel.lua", + Button = "lua.button.lua", + StaticText = "lua.statictext.lua", + Titlebar = "lua.titlebar.lua", + TextEdit = "lua.textedit.lua", + + Dialog = "lua.dialogpanel.lua", + DialogPanel = "lua.dialogpanel.lua", +} + Added: trunk/yake/common/media/gui2/styles/lua1/lua.panel.lua =================================================================== --- trunk/yake/common/media/gui2/styles/lua1/lua.panel.lua (rev 0) +++ trunk/yake/common/media/gui2/styles/lua1/lua.panel.lua 2008-03-31 18:00:28 UTC (rev 1912) @@ -0,0 +1,40 @@ +---------------------- +-- PANEL +---------------------- +dofile "lua.colours.inc.lua" + +property["margin"] = size(5,5) --5px (on all sides) + +---------------------- +-- Name "normal" is defined by the style! +-- Name "forall" is defined by us for easy reuse. + +geometry.forall = function() + --render:quad(pos(0,0),pos(0,1),pos(1,1),pos(1,0)) +end + +geometry.normal = function() + render:colour(theme.colours.background) + geometry.forall() -- Reuse! +end +geometry.hover = function() + render:colour(theme.colours.background) + geometry.forall() -- Reuse! +end + +---------------------- +-- If the pane has no child widgets then size(0,0) is returned. +-- Otherwise the minimum is set to 2*margin. +methods["minimumSize"] = function() + if this:numChildren() == 0 then + return size(0,0) + else + return size(0,0) --return property["margin"] * 2 + end +end + +--events["frame"] = function() +--end + +--events["clicked"] = function() +--end Added: trunk/yake/common/media/gui2/styles/lua1/lua.statictext.lua =================================================================== --- trunk/yake/common/media/gui2/styles/lua1/lua.statictext.lua (rev 0) +++ trunk/yake/common/media/gui2/styles/lua1/lua.statictext.lua 2008-03-31 18:00:28 UTC (rev 1912) @@ -0,0 +1,27 @@ +---------------------- +-- BUTTON +---------------------- +dofile "lua.colours.inc.lua" + +property["normal.colour"] = theme.colours.control_normal +property["text.colour"] = theme.colours.control_text +property["padding"] = 2 + +---------------------- +-- Name "normal", "hover" etc is defined by the style/widget! +-- Name "forall" is defined by us for easy reuse in "normal", "hover" etc. + +geometry.normal = function() + --render:colour(property["normal.colour"]) + --render:quad(pos(0,0),pos(0,1),pos(1,1),pos(1,0)) + + local pxOff = property["padding"] --pixel offset + render:colour(property["text.colour"]) + render:text(pos(dim(0,pxOff),dim(0,pxOff)), this:property("text"), theme.font, theme.text_size) +end + +---------------------- +methods["minimumSize"] = function() + local fnt = ui:getFont(theme.font) + return fnt:getTextSize( this:property("text") ) + size(property["padding"],property["padding"]) * 2 +end Added: trunk/yake/common/media/gui2/styles/lua1/lua.textedit.lua =================================================================== --- trunk/yake/common/media/gui2/styles/lua1/lua.textedit.lua (rev 0) +++ trunk/yake/common/media/gui2/styles/lua1/lua.textedit.lua 2008-03-31 18:00:28 UTC (rev 1912) @@ -0,0 +1,70 @@ +---------------------- +-- TextEdit +---------------------- +dofile "lua.colours.inc.lua" + +property["normal.colour"] = theme.colours.control_normal +property["text.colour"] = theme.colours.control_text +property["padding"] = 2 + +---------------------- +-- Name "normal", "hover" etc is defined by the style/widget! +-- Name "forall" is defined by us for easy reuse in "normal", "hover" etc. + +geometry.normal = function() + local hasFocus = this:property("hasFocus") + + render:colour(theme.colours.control_hover) + render:quad({0,0},{0,1},{1,1},{1,0}) + + local px = 1 + if hasFocus then px = 2 end + render:colour(theme.colours.control_normal) + render:quad( + {{0,px},{0,px}}, + {{0,px},{1,-px}}, + {{1,-px},{1,-px}}, + {{1,-px},{0,px}}) + + local pxOff = property["padding"] --pixel offset + if (hasFocus) then + render:colour(theme.colours.edit_text) + else + render:colour(property["text.colour"]) + end + render:text(pos(dim(0,pxOff),dim(0,pxOff)), this:property("text"), theme.font, theme.text_size) +end +geometry.hover = function() + local hasFocus = this:property("hasFocus") + if hasFocus then + geometry.normal() + return + end + + render:colour(theme.colours.control_hover) + render:colour(1,1,1,1) + render:quad({0,0},{0,1},{1,1},{1,0}) + + local px = 2 + render:colour(theme.colours.control_normal) + render:quad( + {{0,px},{0,px}}, + {{0,px},{1,-px}}, + {{1,-px},{1,-px}}, + {{1,-px},{0,px}}) + + local pxOff = property["padding"] --pixel offset + if (hasFocus) then + render:colour(theme.colours.edit_text) + else + render:colour(property["text.colour"]) + end + render:text(pos(dim(0,pxOff),dim(0,pxOff)), this:property("text"), theme.font, theme.text_size) +end + +---------------------- +methods["minimumSize"] = function() + local fnt = ui:getFont(theme.font) + return fnt:getTextSize( "EnterYourCred" ) + size(property["padding"],property["padding"]) * 2 + --return size(50,20) +end Added: trunk/yake/common/media/gui2/styles/lua1/lua.titlebar.lua =================================================================== --- trunk/yake/common/media/gui2/styles/lua1/lua.titlebar.lua (rev 0) +++ trunk/yake/common/media/gui2/styles/lua1/lua.titlebar.lua 2008-03-31 18:00:28 UTC (rev 1912) @@ -0,0 +1,45 @@ +---------------------- +-- Titlebar +---------------------- +dofile "lua.colours.inc.lua" + +--property["margin"] = size(5,5) --5px (on all sides) +property["padding"] = size(2,2) + +---------------------- +geometry.forall = function() + local off = 5; + render:quad( pos(dim(0,off),0), pos(0,dim(0,off)), pos(1,dim(0,off)), pos(dim(1,-off),0) ) + render:quad( pos(0,dim(0,off)), pos(0,1), pos(1,1), pos(1,dim(0,off))) + + render:colour(theme.colours.control_text); + --render:text(pos(dim(0,2),dim(0,2)), "("..this:id()..")", theme.font, theme.text_size) + --render:text(pos(dim(0,2),dim(0,2)), "("..this:id()..")"..this:property("text"), theme.font, theme.text_size) + local caption = this:property("text") + if caption and string.len(caption)>0 then + render:text(pos(dim(0,4),dim(0,1)), caption, theme.font, theme.text_size) + else + render:text(pos(dim(0,4),dim(0,1)), "("..this:id()..")", theme.font, theme.text_size) + end +end + +geometry.normal = function() + render:colour(theme.colours.control_normal) + geometry.forall() -- Reuse! +end +geometry.hover = function() + render:colour(theme.colours.control_hover) + geometry.forall() -- Reuse! +end + +---------------------- +methods["minimumSize"] = function() + local fnt = ui:getFont(theme.font) + return fnt:getTextSize( this:property("text") ) + property["padding"] * 2 + size(dim(0,2),0) +end + +--events["frame"] = function() +--end + +--events["clicked"] = function() +--end Modified: trunk/yake/scripts/premake/samples.lua =================================================================== --- trunk/yake/scripts/premake/samples.lua 2008-03-30 22:43:07 UTC (rev 1911) +++ trunk/yake/scripts/premake/samples.lua 2008-03-31 18:00:28 UTC (rev 1912) @@ -278,5 +278,18 @@ end end +-------------------------------------- +if LUA_BINDINGS then + makeSample("sampleUi1","samples/gui/ui1") + sampleUsesConsole() + useComponent("base") + useComponent("scripting") + useComponent("res") + useComponent("bindings.lua") + useComponent("gui2") +end +-------------------------------------- +-- This has to be the last call: +-------------------------------------- priv_finishSample() Modified: trunk/yake/scripts/premake/yake.lua =================================================================== --- trunk/yake/scripts/premake/yake.lua 2008-03-30 22:43:07 UTC (rev 1911) +++ trunk/yake/scripts/premake/yake.lua 2008-03-31 18:00:28 UTC (rev 1912) @@ -206,6 +206,19 @@ addDependency("netsvc") -------------------------------------- +makeComponent("gui2","YAKE_GUI_EXPORTS") +addDependency("base") +addDependency("res") +addDependency("scripting") +addDependency("scriptingLua") +addDependency("bindings.lua") + +useDep("lua") +useDep("luabind") +useDep("ogre") +useDep("ois") + +-------------------------------------- makeComponent("vehicle","YAKE_VEHICLE_EXPORTS") addDependency("base") addDependency("data") Modified: trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.cpp =================================================================== --- trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.cpp 2008-03-30 22:43:07 UTC (rev 1911) +++ trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.cpp 2008-03-31 18:00:28 UTC (rev 1912) @@ -90,7 +90,10 @@ YAKE_DECLARE_CONCRETE(OgreSystem,"yake.ogre") public: OgreSystem(); - ~OgreSystem() {} + ~OgreSystem() + { + stop(); + } virtual void start(); virtual void stop(); virtual FontPtr createFont(const string& id, const string& name, const real size); @@ -379,7 +382,7 @@ renderer_->popMaterial(); } //-------------------------------------- - GraphicsCore::GraphicsCore() : root_(0), cam_(0) + GraphicsCore::GraphicsCore() : root_(0), cam_(0), sceneMgr_(0) { } GraphicsCore::~GraphicsCore() Modified: trunk/yake/src/gui2/plugins/style.lua/style.lua.cpp =================================================================== --- trunk/yake/src/gui2/plugins/style.lua/style.lua.cpp 2008-03-30 22:43:07 UTC (rev 1911) +++ trunk/yake/src/gui2/plugins/style.lua/style.lua.cpp 2008-03-31 18:00:28 UTC (rev 1912) @@ -18,6 +18,8 @@ #include "yake/gui2/font.h" #include "yake/gui2/plugins/style.lua/style.lua.h" +#include "yake/res/res.h" + namespace yake { namespace ui { YAKE_REGISTER_CONCRETE(LuaStyle) @@ -216,9 +218,13 @@ } void doFile(const string& fn) { + res::FindResult find = res::SourceManager::global().find(fn); + if (!find) + throw std::exception(std::string("could not find file: "+fn).c_str()); + lua_pushcclosure(L, &pcall_handler, 0); - if (luaL_loadfile(L, fn.c_str())) + if (luaL_loadfile(L, find.location().c_str())) { std::string err(lua_tostring(L, -1)); lua_pop(L, 2); Modified: trunk/yake/src/res/source.cpp =================================================================== --- trunk/yake/src/res/source.cpp 2008-03-30 22:43:07 UTC (rev 1911) +++ trunk/yake/src/res/source.cpp 2008-03-31 18:00:28 UTC (rev 1912) @@ -46,7 +46,7 @@ bool FileSource::exists(const Location& loc) const { struct stat s; - const int code = ::stat(loc.c_str(), &s); + const int code = ::stat(loc.c_str(), &s); //debugging only: std::cout << "FileSource.exists(" << loc << "): " << code << "\n"; return (code == 0); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2008-03-30 22:43:05
|
Revision: 1911 http://yake.svn.sourceforge.net/yake/?rev=1911&view=rev Author: psyclonist Date: 2008-03-30 15:43:07 -0700 (Sun, 30 Mar 2008) Log Message: ----------- * [base] fixed registry for 2 parameters * [gui2] added experimental gui library (Yake license / LGPL) Modified Paths: -------------- trunk/yake/yake/base/templates/yakeRegistry.h trunk/yake/yake/factory/dynamic_factory.h Added Paths: ----------- trunk/yake/src/gui2/ trunk/yake/src/gui2/layout/ trunk/yake/src/gui2/mutator.cpp trunk/yake/src/gui2/plugins/ trunk/yake/src/gui2/plugins/renderer.ogre/ trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.cpp trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.h trunk/yake/src/gui2/plugins/renderer.opengl/ trunk/yake/src/gui2/plugins/style.lua/ trunk/yake/src/gui2/plugins/style.lua/style.lua.cpp trunk/yake/src/gui2/plugins/style.lua/style.lua.h trunk/yake/src/gui2/plugins/system.ogreois/ trunk/yake/src/gui2/plugins/system.ogreois/ogre_ois.cpp trunk/yake/src/gui2/plugins/system.ogreois/ogre_ois.h trunk/yake/src/gui2/plugins/window_manager.2d/ trunk/yake/src/gui2/plugins/window_manager.2d/window_manager.2d.cpp trunk/yake/src/gui2/renderer.cpp trunk/yake/src/gui2/system.cpp trunk/yake/src/gui2/widget/ trunk/yake/src/gui2/widget/button.cpp trunk/yake/src/gui2/widget/dialog.cpp trunk/yake/src/gui2/widget/panel.cpp trunk/yake/src/gui2/widget/static_text.cpp trunk/yake/src/gui2/widget/text_edit.cpp trunk/yake/src/gui2/widget/titlebar.cpp trunk/yake/src/gui2/widget.cpp trunk/yake/src/gui2/window_manager.cpp trunk/yake/yake/gui2/ trunk/yake/yake/gui2/font.h trunk/yake/yake/gui2/gui.h trunk/yake/yake/gui2/input_provider.h trunk/yake/yake/gui2/layout/ trunk/yake/yake/gui2/layout/hbox.h trunk/yake/yake/gui2/layout/vbox.h trunk/yake/yake/gui2/layout.h trunk/yake/yake/gui2/mutator.cpp trunk/yake/yake/gui2/mutator.h trunk/yake/yake/gui2/plugins/ trunk/yake/yake/gui2/plugins/renderer.ogre/ trunk/yake/yake/gui2/plugins/renderer.ogre/renderer.ogre.cpp trunk/yake/yake/gui2/plugins/renderer.ogre/renderer.ogre.h trunk/yake/yake/gui2/plugins/renderer.opengl/ trunk/yake/yake/gui2/plugins/style.lua/ trunk/yake/yake/gui2/plugins/style.lua/style.lua.cpp trunk/yake/yake/gui2/plugins/style.lua/style.lua.h trunk/yake/yake/gui2/plugins/system.ogreois/ trunk/yake/yake/gui2/plugins/system.ogreois/ogre_ois.cpp trunk/yake/yake/gui2/plugins/system.ogreois/ogre_ois.h trunk/yake/yake/gui2/prerequisites.h trunk/yake/yake/gui2/renderer.cpp trunk/yake/yake/gui2/renderer.h trunk/yake/yake/gui2/style.h trunk/yake/yake/gui2/system.cpp trunk/yake/yake/gui2/system.h trunk/yake/yake/gui2/types.h trunk/yake/yake/gui2/widget/ trunk/yake/yake/gui2/widget/button.cpp trunk/yake/yake/gui2/widget/button.h trunk/yake/yake/gui2/widget/dialog.cpp trunk/yake/yake/gui2/widget/dialog.h trunk/yake/yake/gui2/widget/panel.cpp trunk/yake/yake/gui2/widget/panel.h trunk/yake/yake/gui2/widget/static_text.cpp trunk/yake/yake/gui2/widget/static_text.h trunk/yake/yake/gui2/widget/text_edit.cpp trunk/yake/yake/gui2/widget/text_edit.h trunk/yake/yake/gui2/widget/titlebar.cpp trunk/yake/yake/gui2/widget/titlebar.h trunk/yake/yake/gui2/widget.cpp trunk/yake/yake/gui2/widget.h trunk/yake/yake/gui2/window_manager.cpp trunk/yake/yake/gui2/window_manager.h Added: trunk/yake/src/gui2/mutator.cpp =================================================================== --- trunk/yake/src/gui2/mutator.cpp (rev 0) +++ trunk/yake/src/gui2/mutator.cpp 2008-03-30 22:43:07 UTC (rev 1911) @@ -0,0 +1,85 @@ +#include "yake/gui2/mutator.h" +#include "yake/gui2/widget.h" + +namespace yake { +namespace ui { + //----------------------------------------------------- + YAKE_IMPLEMENT_REGISTRY(MutatorBase) + //----------------------------------------------------- + void MutatorBase::_setOwner(Widget* owner) + { + owner_ = owner; + } + void MutatorBase::update(const real dt) + { + this->onUpdate(dt); + } + void MutatorBase::destroy() + { + assert( !dead_ ); + if (!dead_) + { + dead_ = true; + if (getOwner()) + getOwner()->_remove(this); + // If the "_remove" operation was successful then this mutator is dead! + // That is, it has been destroyed! + // Reason: The owner has ownership of this mutator (via shared_ptr). + } + } + //----------------------------------------------------- + struct MutatorMove : public MutatorBase + { + YAKE_DECLARE_CONCRETE(MutatorMove,"move") + public: + MutatorMove(const vector2& velocity) : vel_(velocity) + {} + private: + virtual void onUpdate(const real dt) + { + assert( getOwner() ); + getOwner()->setPosition( getOwner()->getPosition() + vel_ * dt ); + } + private: + vector2 vel_; + }; + //----------------------------------------------------- + struct MutatorMoveTo : public MutatorBase + { + YAKE_DECLARE_CONCRETE(MutatorMoveTo,"moveTo") + public: + MutatorMoveTo(const Position& targetPos, const real minSpeed = 0.05, const real factor = 0.99) : + targetPos_(targetPos), + minSpeed_(minSpeed), + factor_(factor) + {} + private: + virtual void onUpdate(const real dt) + { + assert( getOwner() ); + vector2 diff = targetPos_ - getOwner()->getPosition(); + if (diff.length() < 1.) + { + getOwner()->setPosition( targetPos_ ); + + // self-destruct! + this->destroy(); + + return; + } + vector2 delta = factor_ * diff * dt; + if (delta.length() < minSpeed_ && !delta.isNull()) + { + //std::cout << "min speed\n"; + delta /= delta.length(); + delta *= minSpeed_; + } + getOwner()->setPosition( getOwner()->getPosition() + delta ); + } + private: + Position targetPos_; + real minSpeed_; + real factor_; + }; +} // namespace ui +} // namespace yake Added: trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.cpp =================================================================== --- trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.cpp (rev 0) +++ trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.cpp 2008-03-30 22:43:07 UTC (rev 1911) @@ -0,0 +1,1044 @@ + +// UI core +#include "yake/gui2/system.h" +#include "yake/gui2/window_manager.h" +#include "yake/gui2/renderer.h" +#include "yake/gui2/font.h" + +// UI Ogre Renderer +#include "yake/gui2/plugins/renderer.ogre/renderer.ogre.h" +#include <boost/array.hpp> + +// Boost +#include <boost/algorithm/string.hpp> +#include <boost/lexical_cast.hpp> + +// OGRE +#include "Ogre.h" +#include "OgreFontManager.h" + +namespace yake { +namespace ui { + struct FaceVertex { + float x, y, z; //!< The position for the vertex. + Ogre::uint32 diffuse; //!< colour of the vertex + float tu0, tv0; //!< texture coordinates + }; + struct Face + { + Ogre::TexturePtr pTex0; + FaceVertex vtx[4]; + }; + +#define FACELIST_MULTISET 1 +#define FACELIST_DEQUE 2 +#define FACELIST_TYPE FACELIST_DEQUE + +#if FACELIST_TYPE == FACELIST_DEQUE + typedef std::vector<Face> FaceList; + void addFace(FaceList& faces, const Face& f) + { + faces.push_back(f); + } +#elif FACELIST_TYPE == FACELIST_MULTISET + typedef std::multiset<Face> FaceList; + void addFace(FaceList& faces, const Face& f) + { + faces.insert(f); + } +#endif + + /** Wraps initialisation and shutdown of OGRE. */ + struct GraphicsCore : public boost::noncopyable + { + GraphicsCore(); + ~GraphicsCore(); + + void start(); + void stop(); + void frame(); + + Ogre::SceneManager* _getSceneMgr() const + { return sceneMgr_; } + Ogre::RenderWindow* _getWindow() const + { return window_; } + private: + vector2 scrSize_; + Ogre::Root* root_; + Ogre::Camera* cam_; + Ogre::SceneManager* sceneMgr_; + Ogre::RenderWindow* window_; + + void _setupResources(); + }; + + struct WidgetRenderable : public IRenderableGeometry + { + FaceList faces; + + typedef boost::shared_ptr<WidgetRenderable> pointer; + typedef boost::weak_ptr<WidgetRenderable> weak_ptr; + + virtual void clear() + { + faces.clear(); + } + }; + + struct OgreSystem : public ISystem + { + YAKE_DECLARE_CONCRETE(OgreSystem,"yake.ogre") + public: + OgreSystem(); + ~OgreSystem() {} + virtual void start(); + virtual void stop(); + virtual FontPtr createFont(const string& id, const string& name, const real size); + //FontPtr getOrCreateFont(const string& id, const string& name, const real size); + virtual FontPtr getFont(const string& id) const; + virtual WindowRendererPtr getRenderer() const; + private: + typedef std::map<string,FontPtr> NamedFonts; + NamedFonts fonts_; + + WindowRendererPtr renderer_; + std::auto_ptr<GraphicsCore> core_; + }; + YAKE_REGISTER_CONCRETE(OgreSystem); + + /** @todo Provide IFont and move impl out AND use IWindowRenderer interface!! */ + struct Font : public IFont + { + public: + /** @exception NotFoundException Thrown if font file/definition cannot be found. + @exception IOException Thrown if setup of font fails. + @exception InvalidInputException Thrown if renderer passed is not valid. + */ + Font(const string& name, WindowRendererPtr, const real size); + + real getHeight() const; + + real getLineSpacing() const; + + AbsSize getTextSize(const string&) const; + + // positions and dimensions of all rendered characters. + //typedef std::deque<std::pair<Position,AbsSize> > RenderInfo; + /** + @param text + May contain additional colouring formatting! + @param pos + Position in screen coordinates (top left border of the clip to draw). + */ + //void render(const string& text, const Position&, const AbsSize& clipRect, const AbsSize& fmtRect, const TextFormatting, const WordWrapping); + //void render(const string& text, const Position&, const AbsSize& clipRect, const AbsSize& fmtRect, const TextFormatting, const WordWrapping, RenderInfo& outInfo); + void render(const string& text, const Position&, const Rectangle& clipRect,const colour& clr, const real z); + private: + + WindowRendererPtr renderer_; + string name_; + real size_; + //boost::shared_ptr<FTGLPixmapFont> font_; + Ogre::Font* font_; + string materialName_; + }; + + + + Font::Font(const string& name, WindowRendererPtr renderer, const real size) : name_(name), renderer_(renderer), size_(size), font_(0) + { + Ogre::FontManager::ResourceCreateOrRetrieveResult succ = Ogre::FontManager::getSingleton().createOrRetrieve("BlueHighway","Default"); + Ogre::FontPtr font = succ.first; + font->load(); + assert( (font.get()!=0) && "failed to create or retrieve font" ); + const Ogre::MaterialPtr& material = font->getMaterial(); + assert( material.get() && "font material not (yet?) loaded" ); + //materialName_ = material->getName(); + //materialName_ = "BlueHighwayTexture"; + materialName_ = font->getName() + "Texture"; + font_ = font.get(); + //material->setSceneBlending( Ogre::SBF_SOURCE_ALPHA, Ogre::SBF_ONE_MINUS_SOURCE_ALPHA ); + //material->setSceneBlending( Ogre::SBF_SOURCE_COLOUR, Ogre::SBF_ZERO ); + } + typedef boost::array<Position,4> Quadrangle; + /* + void clip(const Rectangle& clip, const Quadrangle& inV, Quadrangle& outV) + { + for (size_t i=0; i<4; ++i) + { + const Position& thisPos = inV[i]; + const size_t nextI = (i == 3) ? 0 : (i+1); + const Position& nextPos = inV[nextI]; + + const bool thisIn = clip.containsPoint(thisPos); + const bool nextIn = clip.containsPoint(nextPos); + if (! + } + } + */ + real Font::getHeight() const + { + return size_; + } + real Font::getLineSpacing() const + { + return 1.1 * size_; + } + AbsSize Font::getTextSize(const string& text) const + { + assert( font_ ); + + vector2 maxSize(0,0); + + const vector2 scale(size_,size_); + + // split text into lines + StringVector lines; + StringUtil::split(lines, text, "\n"); + + // for each line: + Position currLineStartPos(0,0); + for (StringVector::const_iterator it = lines.begin(); it != lines.end(); ++it) + { + const string& line = *it; + Position currPos(currLineStartPos); + + // for each character: + for (string::const_iterator itC = line.begin(); itC != line.end(); ++itC) + { + const char c = *itC; + + //@todo test for 32 ' ' + Ogre::Font::GlyphInfo gi(c,Ogre::Font::UVRect(0,0,0,0),1.); + if (c == ' ') + gi.aspectRatio = .5; //@todo hack - replace with correct 'space' rendering + else + { + try { + gi = font_->getGlyphInfo(c); + } + catch (Ogre::Exception&) + { + assert( false && "failed to acquire glyph information for this character/code point" ); + } + } + + const Position topLeft(currPos.x,currPos.y); + //const vector2 size(scale.x*gi.aspectRatio, scale.y); + const vector2 size(scale.y*gi.aspectRatio, scale.y); + + // next character + //currPos.x += size.x; + currPos.x += real(int(size.x)+1); // round to full pixels, then convert + } + + // + if (currPos.x > maxSize.x) + maxSize.x = currPos.x; + + // prepare for next line: + currLineStartPos.y += scale.y/* * 1.5*/; + } + maxSize.y = currLineStartPos.y; + + return maxSize; + } + void Font::render(const string &text, const Position& pos, const Rectangle &clipRect,const colour& clr, const real z) + { + assert( font_ ); + assert( renderer_ ); + + colour currClr(clr); + + //const vector2 scale(12. * 4./3.,12.); //@todo original ".font" aspect ratio is not always 4/3 tsk tsk + const vector2 scale(size_,size_); + + renderer_->pushMaterial(materialName_); + + // split text into lines + StringVector lines; + StringUtil::split(lines, text, "\n"); + + // for each line: + Position currLineStartPos(pos); + for (StringVector::const_iterator it = lines.begin(); it != lines.end(); ++it) + { + const string& line = *it; + Position currPos(currLineStartPos); + + // for each character: + for (string::const_iterator itC = line.begin(); itC != line.end(); ++itC) + { + const char c = *itC; + + if (c == '\\') + { + if (itC == line.end()-1) + ; // just continue - the last character is really a '\' + else // more characters follow. let's see whether it's a control character: + { + const char cmd = *(itC + 1); + switch (cmd) + { + case 'c': // colour: + { + itC += 2; + assert( itC != line.end() && "unexpected end of command 'c'" ); + if (itC == line.end()) + continue; + assert( (*itC == '{') && "expected begin of parameters '{'" ); + ++itC; + const std::string::size_type from = itC - line.begin(); + std::string::size_type pos = line.find('}', from); + assert( (pos != std::string::npos) && "no parameter end marker '}' found" ); + std::string paramString = line.substr( from, (pos-from) ); + itC += (pos-from); // do not forget! + + std::vector<std::string> params; + split(params,paramString,boost::is_any_of(",;"),boost::token_compress_on); + if (params.size() == 1) + { + // named colours: + static std::map<std::string,colour> s_namedColours; + if (s_namedColours.empty()) + { + s_namedColours["white"] = colour(1,1,1); + s_namedColours["black"] = colour(0,0,0); + s_namedColours["gray"] = colour(.7,.7,.7); + s_namedColours["red"] = colour(1,0,0); + s_namedColours["blue"] = colour(0,0,1); + s_namedColours["green"] = colour(0,1,0); + } + std::map<std::string,colour>::const_iterator itColour = s_namedColours.find(params.at(0)); + assert( (itColour != s_namedColours.end()) && "unknown named colour" ); + if (itColour != s_namedColours.end()) + currClr = itColour->second; + } + // + continue; // go to next valid (printable) character or start of control character. + } + break; + default: + break; // just continue - treat as a '\', it's not a known command. @todo print error? + }; + } + } + + //@todo test for 32 ' ' + Ogre::Font::GlyphInfo gi(c,Ogre::Font::UVRect(0,0,0,0),1.); + if (c == ' ') + gi.aspectRatio = .5; //@todo hack - replace with correct 'space' rendering + else + { + try { + gi = font_->getGlyphInfo(c); + } + catch (Ogre::Exception&) + { + assert( false && "failed to acquire glyph information for this character/code point" ); + } + } + + const Position topLeft(currPos.x,currPos.y); + //const vector2 size(scale.x*gi.aspectRatio, scale.y); + const vector2 size(scale.y*gi.aspectRatio, scale.y); + + /* + Quadrangle verts; + verts[0] = topLeft; + verts[1] = topLeft + vector2(0,size.y); + verts[2] = topLeft + size; + verts[3] = topLeft + vector2(size.x,0); + Quadrangle clipped; + clip(clipRect,verts,clipped); + */ + Quadrangle clipped; + clipped[0] = topLeft; + clipped[1] = topLeft + vector2(0,size.y); + clipped[2] = topLeft + size; + clipped[3] = topLeft + vector2(size.x,0); + + renderer_->quad2duv(clipped[0], clipped[1], clipped[2], clipped[3], + vector2(gi.uvRect.left,gi.uvRect.top), // top left + vector2(gi.uvRect.left,gi.uvRect.bottom), + vector2(gi.uvRect.right,gi.uvRect.bottom), + vector2(gi.uvRect.right,gi.uvRect.top), + currClr, + z + ); + + // next character + //currPos.x += size.x; + currPos.x += real(int(size.x)+1); // round to full pixels, then convert + } + + // prepare for next line: + currLineStartPos.y += scale.y/* * 1.5*/; + } + + renderer_->popMaterial(); + } + //-------------------------------------- + GraphicsCore::GraphicsCore() : root_(0), cam_(0) + { + } + GraphicsCore::~GraphicsCore() + { + stop(); + } + /// Method which will define the source of resources (other than current folder) + void GraphicsCore::_setupResources() + { + using namespace Ogre; + + // Load resource paths from config file + ConfigFile cf; + cf.load("resources.cfg"); + + // Go through all sections & settings in the file + ConfigFile::SectionIterator seci = cf.getSectionIterator(); + + String secName, typeName, archName; + while (seci.hasMoreElements()) + { + secName = seci.peekNextKey(); + ConfigFile::SettingsMultiMap *settings = seci.getNext(); + ConfigFile::SettingsMultiMap::iterator i; + for (i = settings->begin(); i != settings->end(); ++i) + { + typeName = i->first; + archName = i->second; +#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE + // OS X does not set the working directory relative to the app, + // In order to make things portable on OS X we need to provide + // the loading with it's own bundle path location + ResourceGroupManager::getSingleton().addResourceLocation( + String(macBundlePath() + "/" + archName), typeName, secName); +#else + ResourceGroupManager::getSingleton().addResourceLocation( + archName, typeName, secName); +#endif + } + } + } + void GraphicsCore::start() + { + root_ = new Ogre::Root("plugins.cfg","ogre.cfg","ogre.log"); + + //@todo setup resource paths + + if (!root_->showConfigDialog()) + throw std::logic_error("ui.GraphicsCore:start(): User aborted."); //@todo convert to regular exit + + this->_setupResources(); + + window_ = root_->initialise(true/*=create default rendering system*/); + + sceneMgr_ = root_->createSceneManager(Ogre::ST_GENERIC, "GUIT_SMInstance"); + + { + cam_ = sceneMgr_->createCamera("PlayerCam"); + // Position it at 50 in Z direction + cam_->setPosition(Ogre::Vector3(0,0,50)); + // Look back along -Z + cam_->lookAt(Ogre::Vector3(0,0,-30)); + cam_->setNearClipDistance(1.); + } + + { + // Create one viewport, entire window + Ogre::Viewport* vp = window_->addViewport(cam_); + vp->setBackgroundColour(Ogre::ColourValue(0.1,0.1,0.15)); + + // Alter the camera aspect ratio to match the viewport + cam_->setAspectRatio( + Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight())); + + // + scrSize_.x = vp->getActualWidth(); + scrSize_.y = vp->getActualHeight(); + } + + Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5); + + // + Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); + + { + Ogre::Entity* e = sceneMgr_->createEntity("n1","ninja.mesh"); + sceneMgr_->getRootSceneNode()->createChildSceneNode()->attachObject(e); + } + /* + { + // Create a manual object for 2D + Ogre::ManualObject* manual = sceneMgr_->createManualObject("manual"); + manual->setUseIdentityProjection(true); + manual->setUseIdentityView(true); + manual->begin("BaseWhiteNoLighting", Ogre::RenderOperation::OT_LINE_STRIP); + manual->position(-0.2, -0.2, 0.0); + manual->position( 0.2, -0.2, 0.0); + manual->position( 0.2, 0.2, 0.0); + manual->position(-0.2, 0.2, 0.0); + manual->index(0); + manual->index(1); + manual->index(2); + manual->index(3); + manual->index(0); + manual->end(); + Ogre::AxisAlignedBox aabInf; aabInf.setInfinite(); + manual->setBoundingBox(aabInf); // Use infinite aab to always stay visible + manual->setRenderQueueGroup(Ogre::RENDER_QUEUE_OVERLAY - 1); + sceneMgr_->getRootSceneNode()->createChildSceneNode()->attachObject(manual); + } + */ + } + void GraphicsCore::stop() + { + if (root_) + { + root_->shutdown(); + delete root_; + root_ = 0; + } + } + void GraphicsCore::frame() + { + root_->renderOneFrame(); + + // Pump events on Win32 + MSG msg; + while( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) ) + //if( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) ) + { + TranslateMessage( &msg ); + DispatchMessage( &msg ); + } + ::Sleep(0); + } + //-------------------------------------- + /************************************************************************* + Utility function to create a render operation and vertex buffer to render quads + *************************************************************************/ + static void createQuadRenderOp(Ogre::RenderOperation &d_render_op, + Ogre::HardwareVertexBufferSharedPtr &d_buffer, size_t nquads) + { + using namespace Ogre; + // Create and initialise the Ogre specific parts required for use in rendering later. + d_render_op.vertexData = new VertexData; + d_render_op.vertexData->vertexStart = 0; + + // setup vertex declaration for the vertex format we use + VertexDeclaration* vd = d_render_op.vertexData->vertexDeclaration; + size_t vd_offset = 0; + vd->addElement(0, vd_offset, VET_FLOAT3, VES_POSITION); + vd_offset += VertexElement::getTypeSize(VET_FLOAT3); + vd->addElement(0, vd_offset, VET_COLOUR, VES_DIFFUSE); + vd_offset += VertexElement::getTypeSize(VET_COLOUR); + vd->addElement(0, vd_offset, VET_FLOAT2, VES_TEXTURE_COORDINATES); + + // create hardware vertex buffer + d_buffer = HardwareBufferManager::getSingleton().createVertexBuffer(vd->getVertexSize(0), nquads, + HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, false); + + // bind vertex buffer + d_render_op.vertexData->vertexBufferBinding->setBinding(0, d_buffer); + + // complete render operation basic initialisation + d_render_op.operationType = RenderOperation::OT_TRIANGLE_LIST; + d_render_op.useIndexes = false; + } + + static void destroyQuadRenderOp(Ogre::RenderOperation &d_render_op, + Ogre::HardwareVertexBufferSharedPtr &d_buffer) + { + delete d_render_op.vertexData; + d_render_op.vertexData = 0; + d_buffer.setNull(); + } + //-------------------------------------- + //-------------------------------------- + const size_t VERTEXBUFFER_INITIAL_CAPACITY = 512; + const size_t VERTEX_PER_QUAD = 6; + struct OgreWindowRenderer : public IWindowRenderer + { + //protected: + OgreWindowRenderer(GraphicsCore&); + virtual ~OgreWindowRenderer(); + public: + virtual void frame(); + + virtual void begin(); + virtual void beginWidget(Widget&); + virtual void endWidget(Widget&); + virtual void end(); + + virtual void getFrameStatistics(Statistics&) const; + + virtual void quad2duv(const Position& v0, const Position& v1, const Position& v2, const Position& v3, + const vector2& uv00, const vector2& uv01, const vector2& uv02, const vector2& uv03, + const colour& c0, const colour& c1, const colour& c2, const colour& c3, + const real z); + virtual void pushMaterial(const string& name); + virtual void popMaterial(); + private: + void _render(); + void _initRenderStates(); + + struct FrameStats + { + size_t numWidgets; + //size_t numMaterialChanges; + size_t numNewFaces; + FrameStats() + { + reset(); + } + void reset() + { + memset(this,0,sizeof(FrameStats)); + } + } frameStats_; + + std::deque<Ogre::TexturePtr> curMaterialStack_; + + struct RQListener : public Ogre::RenderQueueListener + { + RQListener(OgreWindowRenderer& owner, Ogre::uint8 qId); + private: + OgreWindowRenderer& owner_; + Ogre::uint8 qId_; + + private: + virtual void renderQueueStarted(Ogre::uint8 id, const Ogre::String& invocation, bool& skipThisQueue); + virtual void renderQueueEnded(Ogre::uint8 id, const Ogre::String& invocation, bool& repeatThisQueue); + }; + boost::shared_ptr<RQListener> listener_; + + FaceList faces_; + bool dirty_; + + WidgetRenderable::pointer currWidgetData_; + + Ogre::Root* oRoot_; + Ogre::RenderSystem* oSystem_; + Ogre::RenderOperation renderOp_; + Ogre::HardwareVertexBufferSharedPtr vertexBuffer_; + size_t bufferPos_; + Ogre::SceneManager* sceneMgr_; + Ogre::LayerBlendModeEx colourBlend_; + Ogre::LayerBlendModeEx alphaBlend_; + Ogre::TextureUnitState::UVWAddressingMode uvwAddressingMode_; + + vector2 texelOffset_; + GraphicsCore& core_; + + inline void toScreen(const Position& in, float& x, float& y, float& z) const + { + x = in.x / (scrSize_.x * .5); + y = in.y / (scrSize_.y * .5); + x -= 1.; + y -= 1.; + y *= -1.; + z = 0; + } + Position toScreen(const Position&) const; + real toScreenX(const real) const; + real toScreenY(const real) const; + }; + OgreWindowRenderer::OgreWindowRenderer(GraphicsCore& core) : IWindowRenderer(), + dirty_(false), + sceneMgr_(core._getSceneMgr()), + bufferPos_(0), + oRoot_(Ogre::Root::getSingletonPtr()), + oSystem_(0), + core_(core) + { + assert( core_._getWindow() ); + this->setScreenSize( core_._getWindow()->getWidth(), core_._getWindow()->getHeight() ); + + assert( oRoot_ ); + oSystem_ = oRoot_->getRenderSystem(); + + // Create and initialise the Ogre specific parts required for use in rendering later. + // Main GUI + createQuadRenderOp(renderOp_, vertexBuffer_, VERTEXBUFFER_INITIAL_CAPACITY); + + // initialise required texel offset + texelOffset_ = vector2(oSystem_->getHorizontalTexelOffset(), -oSystem_->getVerticalTexelOffset()); + + // create listener which will handler the rendering side of things for us. + //@todo d_ourlistener = new CEGUIRQListener(this, queue_id, post_queue); + + // Initialise blending modes to be used. + colourBlend_.blendType = Ogre::LBT_COLOUR; + /* + colourBlend_.source1 = Ogre::LBS_DIFFUSE; + colourBlend_.source2 = Ogre::LBS_CURRENT; + colourBlend_.operation = Ogre::LBX_BLEND_DIFFUSE_ALPHA; + */ + colourBlend_.source1 = Ogre::LBS_TEXTURE; + colourBlend_.source2 = Ogre::LBS_DIFFUSE; + colourBlend_.operation = Ogre::LBX_MODULATE; + + alphaBlend_.blendType = Ogre::LBT_ALPHA; + alphaBlend_.source1 = Ogre::LBS_TEXTURE; + alphaBlend_.source2 = Ogre::LBS_DIFFUSE; + alphaBlend_.operation = Ogre::LBX_MODULATE; + + uvwAddressingMode_.u = Ogre::TextureUnitState::TAM_CLAMP; + uvwAddressingMode_.v = Ogre::TextureUnitState::TAM_CLAMP; + uvwAddressingMode_.w = Ogre::TextureUnitState::TAM_CLAMP; + + listener_.reset( new RQListener(*this,Ogre::RENDER_QUEUE_OVERLAY-1) ); + assert( sceneMgr_ ); + sceneMgr_->addRenderQueueListener( listener_.get() ); + + faces_.reserve(2000); + } + OgreWindowRenderer::~OgreWindowRenderer() + { + if (sceneMgr_ && listener_) + sceneMgr_->removeRenderQueueListener( listener_.get() ); + listener_.reset(); + destroyQuadRenderOp( renderOp_, vertexBuffer_ ); + } + void OgreWindowRenderer::getFrameStatistics(Statistics& stats) const + { + stats["frame.numFaces"] = boost::lexical_cast<string>(faces_.size()); + stats["frame.newFaces"] = boost::lexical_cast<string>(frameStats_.numNewFaces); + } + void OgreWindowRenderer::pushMaterial(const string& name) + { + Ogre::ResourceManager::ResourceCreateOrRetrieveResult succ = + Ogre::TextureManager::getSingleton().createOrRetrieve(name,"General"); + Ogre::TexturePtr tex = succ.first; + + assert( tex.get() && "requested texture not available/loaded" ); + curMaterialStack_.push_back(tex); + + /* + Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(name); + curMaterialStack_.push_back(mat); + Ogre::Technique* tech = mat->getBestTechnique(0); + if (tech) + { + Ogre::Pass* pass = tech->getPass(0); + if (pass) + pass->getT + } + */ + } + void OgreWindowRenderer::popMaterial() + { + if (!curMaterialStack_.empty()) + curMaterialStack_.pop_back(); + } + void OgreWindowRenderer::beginWidget(Widget& w) + { + currWidgetData_ = boost::dynamic_pointer_cast<WidgetRenderable>(w._getCachedGeometry()); + if (currWidgetData_) + { + if (w.needsRepaint()) + { + currWidgetData_->clear(); + } + else + { + for (FaceList::const_iterator it = currWidgetData_->faces.begin(); + it != currWidgetData_->faces.end(); ++it) + { + addFace(faces_,*it); + } + } + } + else + currWidgetData_.reset(new WidgetRenderable()); + } + void OgreWindowRenderer::endWidget(Widget& w) + { + w._setCachedGeometry(currWidgetData_); + currWidgetData_.reset(); + } + OgreWindowRenderer::RQListener::RQListener(OgreWindowRenderer& owner, Ogre::uint8 qId) : qId_(qId), owner_(owner) + { + } + void OgreWindowRenderer::RQListener::renderQueueStarted(Ogre::uint8 id, const Ogre::String& invocation, bool& skipThisQueue) + { + if (qId_ <= id) + owner_._render(); + } + void OgreWindowRenderer::RQListener::renderQueueEnded(Ogre::uint8 id, const Ogre::String& invocation, bool& skipThisQueue) + { + } + void OgreWindowRenderer::frame() + { + core_.frame(); + } + void OgreWindowRenderer::begin() + { + frameStats_.reset(); + + // NB vector<>::clear() will not modify the capacity of the container, so there are no reallocations triggered. + faces_.clear(); //@todo optimize by reuse... + } + void OgreWindowRenderer::end() + { + } + void OgreWindowRenderer::_initRenderStates() + { + assert( oSystem_ ); + using namespace Ogre; + + // set-up matrices + oSystem_->_setWorldMatrix(Ogre::Matrix4::IDENTITY); + oSystem_->_setViewMatrix(Ogre::Matrix4::IDENTITY); + oSystem_->_setProjectionMatrix(Ogre::Matrix4::IDENTITY); + + // initialise render settings + oSystem_->setLightingEnabled(false); + oSystem_->_setDepthBufferParams(false, false); + oSystem_->_setDepthBias(0, 0); + oSystem_->_setCullingMode(CULL_NONE); + oSystem_->_setFog(FOG_NONE); + oSystem_->_setColourBufferWriteEnabled(true, true, true, true); + oSystem_->unbindGpuProgram(GPT_FRAGMENT_PROGRAM); + oSystem_->unbindGpuProgram(GPT_VERTEX_PROGRAM); + oSystem_->setShadingType(SO_GOURAUD); + oSystem_->_setPolygonMode(PM_SOLID); + + // initialise texture settings + oSystem_->_setTextureCoordCalculation(0, TEXCALC_NONE); + oSystem_->_setTextureCoordSet(0, 0); + oSystem_->_setTextureUnitFiltering(0, FO_LINEAR, FO_LINEAR, FO_POINT); + oSystem_->_setTextureAddressingMode(0, uvwAddressingMode_); + oSystem_->_setTextureMatrix(0, Ogre::Matrix4::IDENTITY); + oSystem_->_setAlphaRejectSettings(CMPF_ALWAYS_PASS, 0); + oSystem_->_setTextureBlendMode(0, colourBlend_); + oSystem_->_setTextureBlendMode(0, alphaBlend_); + oSystem_->_disableTextureUnitsFrom(1); + + // enable alpha blending + //oSystem_->_setSceneBlending(SBF_SOURCE_ALPHA, SBF_ONE_MINUS_SOURCE_ALPHA); + oSystem_->_setSceneBlending(SBF_SOURCE_ALPHA, SBF_ONE_MINUS_SOURCE_ALPHA); + } + void OgreWindowRenderer::_render() + { + if (dirty_) + { + //@todo sort by texture ... + + // adjust vertex buffer size (if necessary) + size_t size = vertexBuffer_->getNumVertices(); + size_t required = faces_.size() * VERTEX_PER_QUAD; + if (required > size) + { + while (required > size) + size *= 2; + destroyQuadRenderOp(renderOp_, vertexBuffer_); + createQuadRenderOp(renderOp_, vertexBuffer_, size); + } + //@todo adjust vertex buffer size after some time of "under-use" + + // fill + FaceVertex* vtx = reinterpret_cast<FaceVertex*>(vertexBuffer_->lock(Ogre::HardwareVertexBuffer::HBL_DISCARD)); + for (FaceList::const_iterator it = faces_.begin(); it != faces_.end(); ++it) + { + const Face& f = *it; +#if 1 + /* + memcpy(vtx,&f.vtx[0],sizeof(FaceVertex)); ++vtx; + memcpy(vtx,&f.vtx[1],sizeof(FaceVertex)); ++vtx; + memcpy(vtx,&f.vtx[2],sizeof(FaceVertex)); ++vtx; + */ + *vtx = f.vtx[0]; ++vtx; + *vtx = f.vtx[1]; ++vtx; + *vtx = f.vtx[2]; ++vtx; + + /* + memcpy(vtx,&f.vtx[0],sizeof(FaceVertex)); ++vtx; + memcpy(vtx,&f.vtx[2],sizeof(FaceVertex)); ++vtx; + memcpy(vtx,&f.vtx[3],sizeof(FaceVertex)); ++vtx; + */ + *vtx = f.vtx[0]; ++vtx; + *vtx = f.vtx[2]; ++vtx; + *vtx = f.vtx[3]; ++vtx; +#else + // 0,1,2 + memcpy(vtx,&f.vtx[0],sizeof(FaceVertex)*3); vtx += 3; + + // 0,2,3 + *vtx = f.vtx[0]; ++vtx; + memcpy(vtx,&f.vtx[2],sizeof(FaceVertex)*2); vtx += 2; +#endif + } + vertexBuffer_->unlock(); + } + // render: + bool first = true; + bufferPos_ = 0; + FaceList::const_iterator it = faces_.begin(); + while (it != faces_.end()) + { + renderOp_.vertexData->vertexStart = bufferPos_; + Ogre::TexturePtr tex = it->pTex0; + for (; it != faces_.end(); ++it) + { + const Face& f = *it; + if (f.pTex0 != tex) + break; + bufferPos_ += VERTEX_PER_QUAD; + } + renderOp_.vertexData->vertexCount = bufferPos_ - renderOp_.vertexData->vertexStart; + + if (first) + { + first = false; + _initRenderStates(); + } + + if (tex.get()) + oSystem_->_setTexture(0,true,tex); + else + oSystem_->_disableTextureUnit(0); + + oSystem_->_render(renderOp_); + } + } + Position OgreWindowRenderer::toScreen(const Position& in) const + { + Position out(in); + out.x /= (scrSize_.x * .5); + out.y /= (scrSize_.y * .5); + out.x -= 1.; + out.y -= 1.; + out.y *= -1.; + return out; + } + real OgreWindowRenderer::toScreenX(const real in) const + { + // xform to [-1,1] + real out = in / (scrSize_.x * .5); + out -= 1.; + return out; + } + real OgreWindowRenderer::toScreenY(const real in) const + { + // xform to [-1,1] (also flip Y) + real out = in / (scrSize_.y * .5); + out -= 1.; + out *= -1.; // flip Y + return out; + } + void OgreWindowRenderer::quad2duv(const Position& v0, const Position& v1, const Position& v2, const Position& v3, + const vector2& uv00, const vector2& uv01, const vector2& uv02, const vector2& uv03, + const colour& c0, const colour& c1, const colour& c2, const colour& c3, + const real z) + { + dirty_ = true; + ++frameStats_.numNewFaces; + + Face f; + //f.z = 0; //@todo FIXME z handling + oSystem_->convertColourValue(Ogre::ColourValue( c0.r, c0.g, c0.b, c0.a ), &f.vtx[0].diffuse); + oSystem_->convertColourValue(Ogre::ColourValue( c1.r, c1.g, c1.b, c1.a ), &f.vtx[1].diffuse); + oSystem_->convertColourValue(Ogre::ColourValue( c2.r, c2.g, c2.b, c2.a ), &f.vtx[2].diffuse); + oSystem_->convertColourValue(Ogre::ColourValue( c3.r, c3.g, c3.b, c3.a ), &f.vtx[3].diffuse); + toScreen(v0,f.vtx[0].x,f.vtx[0].y,f.vtx[0].z); + toScreen(v1,f.vtx[1].x,f.vtx[1].y,f.vtx[1].z); + toScreen(v2,f.vtx[2].x,f.vtx[2].y,f.vtx[2].z); + toScreen(v3,f.vtx[3].x,f.vtx[3].y,f.vtx[3].z); + f.vtx[0].tu0 = uv00.x + texelOffset_.x; + f.vtx[0].tv0 = uv00.y + texelOffset_.y; + f.vtx[1].tu0 = uv01.x + texelOffset_.x; + f.vtx[1].tv0 = uv01.y + texelOffset_.y; + f.vtx[2].tu0 = uv02.x + texelOffset_.x; + f.vtx[2].tv0 = uv02.y + texelOffset_.y; + f.vtx[3].tu0 = uv03.x + texelOffset_.x; + f.vtx[3].tv0 = uv03.y + texelOffset_.y; + + if (!curMaterialStack_.empty()) + f.pTex0 = curMaterialStack_.back(); + + addFace(faces_,f); + if (currWidgetData_) + addFace(currWidgetData_->faces,f); + + /* + // Input points (v0-v4) are counter-clockwise in space x=[0,abs_width],y=[0,abs_height] + + mesh->position( toScreenX(v0.x), toScreenY(v0.y), z ); + mesh->textureCoord( uv00.x, uv00.y ); + mesh->colour( c0.r, c0.g, c0.b, c0.a ); + mesh->position( toScreenX(v1.x), toScreenY(v1.y), z ); + mesh->textureCoord( uv01.x, uv01.y ); + mesh->colour( c1.r, c1.g, c1.b, c1.a ); + mesh->position( toScreenX(v2.x), toScreenY(v2.y), z ); + mesh->textureCoord( uv02.x, uv02.y ); + mesh->colour( c2.r, c2.g, c2.b, c2.a ); + mesh->position( toScreenX(v3.x), toScreenY(v3.y), z ); + mesh->textureCoord( uv03.x, uv03.y ); + mesh->colour( c3.r, c3.g, c3.b, c3.a ); + */ + } + + //----------------------------------------------------- + + //----------------------------------------------------- + OgreSystem::OgreSystem() + { + } + FontPtr OgreSystem::createFont(const string& id, const string& name, const real size) + { + NamedFonts::const_iterator it = fonts_.find(id); + if (it != fonts_.end()) + return it->second; + + try { + FontPtr fnt(new Font(name,getRenderer(),size)); + fonts_[id] = fnt; + return fnt; + } + catch (Exception&) + { + assert( false && "CAUGHT EXCEPTION during FONT CREATION" ); //@todo <- replace with logging? + throw; + } + } + FontPtr OgreSystem::getFont(const string& id) const + { + NamedFonts::const_iterator it = fonts_.find(id); + return (it == fonts_.end()) ? FontPtr() : it->second; + } + void OgreSystem::start() + { + assert( !core_.get() ); + if (core_.get()) + return; + core_.reset( new GraphicsCore() ); + core_->start(); + renderer_.reset( new OgreWindowRenderer(*core_) ); + } + void OgreSystem::stop() + { + renderer_.reset(); + fonts_.clear(); // !!! + if (core_.get()) + core_->stop(); + core_.reset(); + } + WindowRendererPtr OgreSystem::getRenderer() const + { + assert( renderer_ ); + return renderer_; + } + //----------------------------------------------------- + SystemPtr createOgreSystem() + { + static SystemPtr s_sys; + assert(!s_sys && "you can only create a single Ogre system!"); + if (!s_sys) + s_sys.reset( new OgreSystem() ); + return s_sys; + } +} // namespace ui +} // namespace yake Added: trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.h =================================================================== --- trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.h (rev 0) +++ trunk/yake/src/gui2/plugins/renderer.ogre/renderer.ogre.h 2008-03-30 22:43:07 UTC (rev 1911) @@ -0,0 +1,12 @@ +#ifndef UI_OGRE_RENDERER_H +#define UI_OGRE_RENDERER_H + +#include "../system.h" + +namespace ui { + + SystemPtr createOgreSystem(); + +} // namespace ui + +#endif Added: trunk/yake/src/gui2/plugins/style.lua/style.lua.cpp =================================================================== --- trunk/yake/src/gui2/plugins/style.lua/style.lua.cpp (rev 0) +++ trunk/yake/src/gui2/plugins/style.lua/style.lua.cpp 2008-03-30 22:43:07 UTC (rev 1911) @@ -0,0 +1,531 @@ +#include "yake/bindings.lua/common/yake.lua.shared_ptr.h" +#include "yake/bindings.lua/common/yake.lua.any_converter.h" + +extern "C" { + #include "lua.h" + #include "lualib.h" + #include "lauxlib.h" +} +#pragma warning(disable: 4996) // deprecated +#pragma warning(disable: 4251) +#include "luabind/luabind.hpp" +#include "luabind/operator.hpp" + +#include "yake/gui2/style.h" +#include "yake/gui2/widget.h" +#include "yake/gui2/renderer.h" +#include "yake/gui2/system.h" +#include "yake/gui2/font.h" +#include "yake/gui2/plugins/style.lua/style.lua.h" + +namespace yake { +namespace ui { + YAKE_REGISTER_CONCRETE(LuaStyle) + struct LuaStyleWidgetEntry + { + VMPtr vm; + typedef std::map<string,luabind::object> NamedFnMap; + NamedFnMap renderFns; + NamedFnMap methods; + }; + struct LuaStyleBatcher + { + void setRenderer(WindowRendererPtr r) + { renderer_ = r; } + void setSystem(SystemPtr sys) + { sys_ = sys; } + struct vertex + { + dim2 pos; + colour clr; + vector2 uv; + vertex(const dim2& p, const colour& c = colour()) : pos(p), clr(c) + {} + vertex(const dim2& p, const colour& c, const vector2& uv0) : pos(p), clr(c), uv(uv0) + {} + vertex(const dim2& p, const vector2& uv0) : pos(p), clr(1,1,1,1), uv(uv0) + {} + }; + + LuaStyleBatcher() : curr_(0), currZ_(0) + {} + void setCurrentWidget(Widget& w, real z) + { + curr_ = &w; + currZ_ = z; + //if (curr_) + // std::cout << "W " << curr_->id() << "\n"; + } + void pushMaterial(const string& name) + { + renderer_->pushMaterial(name); + } + void popMaterial() + { + renderer_->popMaterial(); + } + void quad(const dim2& v0, const dim2& v1, const dim2& v2, const dim2& v3) + { + this->quad(vertex(v0,clr_),vertex(v1,clr_),vertex(v2,clr_),vertex(v3,clr_)); + } + void quad(const dim2& v0, const dim2& v1, const dim2& v2, const dim2& v3, + const vector2& uv00, const vector2& uv01, const vector2& uv02, const vector2& uv03) + { + this->quad(vertex(v0,clr_,uv00),vertex(v1,clr_,uv01),vertex(v2,clr_,uv02),vertex(v3,clr_,uv03)); + } + void quad(const vertex& v0, const vertex& v1, const vertex& v2, const vertex& v3) + { + //assert( curr_ ); + const Position absPos = curr_ ? curr_->getDerivedPosition() : Position(); + const AbsSize size = curr_ ? curr_->getSize() : AbsSize(); + + //std::cout << "quad(" << v0 << v1 << v2 << v3 << ")\n"; + Position abs0 = absPos + toAbsolute(v0); + Position abs1 = absPos + toAbsolute(v1); + Position abs2 = absPos + toAbsolute(v2); + Position abs3 = absPos + toAbsolute(v3); + //std::cout << "quad(" << abs0 << abs1 << abs2 << abs3 << ")\n"; + if ((v0.clr.a <= 0.001) && (v1.clr.a <= 0.001) && (v2.clr.a <= 0.001) && (v3.clr.a <= 0.001)) + { + std::cout << "=> hidden quad\n"; + } + else if (renderer_) + { + renderer_->quad2duv(abs0,abs1,abs2,abs3, + v0.uv, v1.uv, v2.uv, v3.uv, + v0.clr, v1.clr, v2.clr, v3.clr, .01*currZ_+(curr_?curr_->getZBias():0.)); + } + } + void setColour(const colour& clr) + { + clr_ = clr; + //std::cout << "brush colour set to " << clr_ << "\n"; + } + void setColour(const real r, const real g, const real b, const real a) + { + this->setColour(colour(r,g,b,a)); + } + void setColour(const real r, const real g, const real b) + { + this->setColour(colour(r,g,b,1.)); + } + void text(const dim2& pos, const string& text, const string& font, const real size) + { + FontPtr fnt = sys_->getFont(font); + assert( fnt && "could not retrieve font" ); + if (fnt) + { + const Rectangle clip(curr_->getDerivedPosition(),curr_->getSize()); + fnt->render( text, curr_->getDerivedPosition() + toAbsolute(pos), clip, clr_, currZ_+curr_->getZBias() ); + } + } + void clearCurrentWidget() + { + curr_ = 0; + } + private: + Widget* curr_; + real currZ_; + colour clr_; + WindowRendererPtr renderer_; + SystemPtr sys_; + + Position toAbsolute(const dim2& pos) + { + return this->toAbsolute(pos.x,pos.y); + } + Position toAbsolute(const vertex& vtx) + { + return this->toAbsolute(vtx.pos.x,vtx.pos.y); + } + Position toAbsolute(const dim& x, const dim& y) + { + Position out; + if (curr_) + { + out.x = x.abs + curr_->getSize().x * x.rel; + out.y = y.abs + curr_->getSize().y * y.rel; + } + else + out = Position(x.abs, y.abs); + return out; + } + }; +} // namespace ui +} // namespace yake + +/* +any_converter_map& any_converters() +{ + std::auto_ptr<any_converter_map> s_map( new any_converter_map() ); + return *s_map; +} +*/ +/* +namespace { +struct RegisterCommonAnyConverters +{ + RegisterCommonAnyConverters() + { + register_any_converter<bool>(); + register_any_converter<int>(); + register_any_converter<float>(); + register_any_converter<yake::real>(); + register_any_converter<const char*>(); + register_any_converter<std::string>(); + } +} gs_register; +} +*/ + +// UI +namespace yake { +namespace ui { + int pcall_handler(lua_State* L) + { + return 1; + } + struct LuaVM + { + LuaVM() : L(0) + { + L = lua_open(); + + luaopen_base( L ); + //lua_baselibopen(L); + + luaopen_table( L ); + + //luaopen_io( L ); // see linit.c + lua_pushcfunction(L, luaopen_io); + lua_pushstring(L, "io"); + lua_call(L, 1, 0); + + + luaopen_string( L ); + luaopen_math( L ); + luaopen_debug( L ); + + luabind::open( L ); + } + ~LuaVM() + { + if (L) + lua_close( L ); + L = 0; + } + void doFile(const string& fn) + { + lua_pushcclosure(L, &pcall_handler, 0); + + if (luaL_loadfile(L, fn.c_str())) + { + std::string err(lua_tostring(L, -1)); + lua_pop(L, 2); + throw std::exception( err.c_str() ); + } + + if (lua_pcall(L, 0, 0, -2)) + { + std::string err(lua_tostring(L, -1)); + lua_pop(L, 2); + throw std::exception( err.c_str() ); + } + + lua_pop(L, 1); + } + lua_State* state() const + { + return L; + } + private: + lua_State* L; + }; + LuaStyle::LuaStyle(SystemPtr sys, WindowRendererPtr w) : sys_(sys), renderer_(w), batcher_( new LuaStyleBatcher() ) + { + batcher_->setRenderer( renderer_ ); + batcher_->setSystem( sys_ ); + + { + VMPtr init = this->createVM(); + init->doFile("lua.init.lua"); + { + lua_State* L = init->state(); + using namespace luabind; + object o = globals(L)["widgets"]; + if (o && (type(o) == LUA_TTABLE)) + { + for (iterator it(o), end; it != end; ++it) + { + boost::optional<std::string> key = object_cast_nothrow<std::string>(it.key()); + boost::optional<std::string> value = object_cast_nothrow<std::string>(*it); + if (key && value) + { + this->createVM(*key,*value); + } + } + } + /* + object o = globals(L)["images"]; + if (o && (type(o) == LUA_TTABLE)) + { + for (iterator it(o), end; it != end; ++it) + { + boost::optional<std::string> key = object_cast_nothrow<std::string>(it.key()); + boost::optional<std::string> value = object_cast_nothrow<std::string>(*it); + if (key && value) + { + this->images_[ *key ] = *value; + } + } + } + */ + } + } // startup VM +// +// this->createVM("Cursor","lua.cursor.lua"); +// +// this->createVM("Widget","lua.panel.lua"); +// this->createVM("Panel","lua.panel.lua"); +// this->createVM("Button","lua.button.lua"); +// this->createVM("StaticText","lua.statictext.lua"); +// this->createVM("Titlebar","lua.titlebar.lua"); +// this->createVM("TextEdit","lua.textedit.lua"); +// +// this->createVM("Dialog","lua.dialogpanel.lua"); +// this->createVM("DialogPanel","lua.dialogpanel.lua"); + } + + bool widget_hasMutator(Widget* w,const string& tag) + { + return (w ? (w->getMutator(tag).get()!=0) : false); + } + + void LuaStyle::bind(VMPtr vm) + { + lua_State* L = vm ? vm->state() : 0; + assert(L && "null state"); + if (!L) + return; + + using namespace luabind; + //module( L, "ui" ) + module( L ) + [ + class_<dim>("dim") + .def(constructor<real,real>()) + .def(self + other<dim>()) + .def(self * double()) + .def_readwrite("abs", &dim::abs), + + class_<dim2>("pos") + .def(constructor<dim,dim>()) + .def(constructor<real,real>()) + .def(constructor<dim,real>()) + .def(constructor<real,dim>()) + .def(self + other<dim2>()) + .def(self - other<dim2>()) + .def_readwrite("x", &dim2::x) + .def_readwrite("y", &dim2::y), + + class_<colour>("colour") + .def(constructor<real,real,real,real>()) + .def(constructor<real,real,real>()) + //.def(self + other<colour>()) + //.def(self - other<colour>()) + .def_readwrite("r", &colour::r) + .def_readwrite("g", &colour::g) + .def_readwrite("b", &colour::b) + .def_readwrite("a", &colour::a), + + class_<vector2>("vector2") + .def(constructor<real,real>()) + .def(self * real()) + .def(self + other<AbsSize>()) + .def(self - other<vector2>()) + .def_readwrite("x", &vector2::x) + .def_readwrite("y", &vector2::y) + , + + class_<MutatorBase, boost::shared_ptr<MutatorBase> >("mutator") + .def("update",&MutatorBase::update), + + class_<Widget>("widget") + .def("id", &Widget::id) + .def("add", (void(Widget::*)(MutatorBasePtr,const string&))&Widget::add) + .def("hasMutator",&widget_hasMutator) + .def("getMutator", &Widget::getMutator) + .def("numChildren", &Widget::numChildren) + //.def("setProperty", (void(Widget::*)(const string&,const boost::any&))&Widget::property) + //.def("getProperty", (const boost::any&(Widget::*)(const string&)const)&Widget::property) + //.def("property", (Widget::PropertyAccessor(Widget::*)(const string&))&Widget::property) + .def("property", (void(Widget::*)(const string&,const boost::any&))&Widget::property) + .def("property", (const boost::any&(Widget::*)(const string&)const)&Widget::property) + , + + // special "LuaStyle" stuff: + class_<LuaStyleBatcher::vertex>("vertex") + .def(constructor<dim2>()) + .def(constructor<dim2,colour>()) + .def(constructor<dim2,vector2>()), + + class_<LuaStyleBatcher, boost::shared_ptr<LuaStyleBatcher> >("LuaStyleBatcher") + .def("doquad",(void(LuaStyleBatcher::*)(const LuaStyleBatcher::vertex&,const LuaStyleBatcher::vertex&,const LuaStyleBatcher::vertex&,const LuaStyleBatcher::vertex&))&LuaStyleBatcher::quad) + .def("doquad",(void(LuaStyleBatcher::*)(const dim2&,const dim2&,const dim2&,const dim2&))&LuaStyleBatcher::quad) + .def("doquad",(void(LuaStyleBatcher::*)(const dim2&,const dim2&,const dim2&,const dim2&,const vector2&,const vector2&,const vector2&,const vector2&))&LuaStyleBatcher::quad) + .def("colour",(void(LuaStyleBatcher::*)(const colour&))&LuaStyleBatcher::setColour) + .def("colour",(void(LuaStyleBatcher::*)(real,real,real))&LuaStyleBatcher::setColour) + .def("colour",(void(LuaStyleBatcher::*)(real,real,real,real))&LuaStyleBatcher::setColour) + .def("text",&LuaStyleBatcher::text) + .def("pushMaterial",&LuaStyleBatcher::pushMaterial) + .def("popMaterial",&LuaStyleBatcher::popMaterial) + , + class_<IFont, FontPtr>("Font") + .def("getTextSize",&IFont::getTextSize) + .def("getHeight",&IFont::getHeight) + , + class_<ISystem, SystemPtr>("System") + .def("getFont",&ISystem::getFont) + ]; + + globals(L)["uv"] = globals(L)["vector2"]; + globals(L)["size"] = globals(L)["vector2"]; + + globals(L)["property"] = luabind::newtable(L); + globals(L)["geometry"] = luabind::newtable(L); + + globals(L)["render"] = batcher_; + batcher_->setRenderer( renderer_ ); + globals(L)["ui"] = sys_; + + globals(L)["methods"] = luabind::newtable(L); + + } + VMPtr LuaStyle::createVM() + { + VMPtr vm(new LuaVM()); + this->bind(vm); + return vm; + } + void LuaStyle::createVM(const string& widgetType,const string& fn) + { + vm_[ widgetType ].reset( new LuaStyleWidgetEntry() ); + LuaStyleWidgetEntryPtr widgetEntry = vm_[ widgetType ]; + + // + widgetEntry->vm = this->createVM(); + lua_State* L = widgetEntry->vm->state(); + widgetEntry->vm->doFile( fn.c_str() ); + + // + for (luabind::iterator it(luabind::globals(L)["property"]), end; it != end; ++it) + { + //std::cout << "(found property '" << luabind::object_cast<std::string>(*it) << "')\n"; + std::cout << "(found property '" << it.key() << "')\n"; + } + for (luabind::iterator it(luabind::globals(L)["geometry"]), end; it != end; ++it) + { + std::cout << "(found geometry for '" << it.key() << "')\n"; + luabind::object o = *it; + if (!o || luabind::type(o) != LUA_TFUNCTION) + throw std::exception("geometry value is NIL or not a function!"); + + widgetEntry->renderFns[ luabind::object_cast<std::string>(it.key()) ] = o; + } + for (luabind::iterator it(luabind::globals(L)["methods"]), end; it != end; ++it) + { + std::cout << "(found method '" << it.key() << "')\n"; + luabind::object o = *it; + if (!o || luabind::type(o) != LUA_TFUNCTION) + throw std::exception("method value is NIL or not a function!"); + + widgetEntry->methods[ luabind::object_cast<std::string>(it.key()) ] = o; + } + } + AbsSize LuaStyle::determineMinimumSize(ui::Widget& w) + { + try + { + VmMap::iterator itVM = this->vm_.find( w.getStyleWidgetType() ); + assert( itVM != this->vm_.end() ); + LuaStyleWidgetEntry& entry = *(itVM->second); + + luabind::object o = entry.methods.find("minimumSize")->second; + + luabind::globals(entry.vm->state())["this"] = &w; + + AbsSize value = luabind::call_function<AbsSize>( o ); + return value; + } + catch (luabind::error& e) + { + std::string code = lua_tostring( e.state(), -1 ); + throw Exception(code); + } + } + void LuaStyle::renderCursor(const Position& pos, const int zLevel) + { + assert( renderer_ ); + assert( batcher_ ); + batcher_->clearCurrentWidget(); + renderer_->setZLevel( zLevel ); + VmMap::iterator itVM = this->vm_.find("Cursor"); + if (itVM != this->vm_.end()) + { + try { + luabind::object o = luabind::globals(itVM->second->vm->state())["renderCursor"]; + assert( luabind::type(o) == LUA_TFUNCTION ); + //luabind::call_function(); + o( pos.x, pos.y ); + } + catch (luabind::error& e) + { + std::string code = lua_tostring( e.state(), -1 ); + throw Exception(code); + } + } + else + { + renderer_->pushMaterial("cursor2-glass1.png"); + const AbsSize size(16,16); + renderer_->quad2duv(pos,pos+AbsSize(0,16),pos+size,pos+AbsSize(16,0), + vector2(0,0),vector2(0,1),vector2(1,1),vector2(1,0),zLevel); + renderer_->popMaterial(); + } + } + void LuaStyle::renderSingleWidget(Widget& w, const int zLevel) + { + assert( renderer_ ); + renderer_->setZLevel( zLevel ); + renderer_->beginWidget( w ); + if (w.needsRepaint()) + { + VmMap::iterator itVM = this->vm_.find( w.getStyleWidgetType() ); + //assert( itVM != this->vm_.end() ); //@todo report error + if (itVM == this->vm_.end()) + itVM = this->vm_.find("Widget"); //fallback + assert( itVM != this->vm_.end() ); + LuaStyleWidgetEntry& entry = *(itVM->second); + + const string stateId = (w.getState() == Widget::S_HOVER) ? "hover" : "normal"; + LuaStyleWidgetEntry::NamedFnMap::const_iterator itFn = entry.renderFns.find(stateId); + if (itFn == entry.renderFns.end()) + { + // not defined -- try "normal" + if (w.getState() != Widget::S_NORMAL) + itFn = entry.renderFns.find("normal"); + assert( (itFn != entry.renderFns.end()) && "no fallback 'normal' render function defined" ); + } + luabind::object o = itFn->second; + assert( luabind::type(o) == LUA_TFUNCTION ); + + assert( batcher_ ); + batcher_->setCurrentWidget( w, zLevel ); + luabind::globals(entry.vm->state())["this"] = &w; + + o(); + } + renderer_->endWidget( w ); + } +} // namespace ui +} // namespace yake Added: trunk/yake/src/gui2/plugins/style.lua/style.lua.h =================================================================== --- trunk/yake/src/gui2/plugins/style.lua/style.lua.h (rev 0) +++ trunk/yake/src/gui2/plugins/style.lua/style.lua.h 2008-03-30 22:43:07 UTC (rev 1911) @@ -0,0 +1,37 @@ +#ifndef UI_LUASTYLE_H +#define UI_LUASTYLE_H + +namespace ui { + struct LuaVM; + typedef boost::shared_ptr<LuaVM> VMPtr; + struct LuaStyleWidgetEntry; + typedef boost::shared_ptr<LuaStyleWidgetEntry> LuaStyleWidgetEntryPtr; + struct LuaStyleBatcher; + struct LuaStyle : public IStyle + { + LuaStyle(SystemPtr,WindowRendererPtr); + virtual AbsSize determineMinimumSize(Widget&); + virtual void renderSingleWidget(Widget&, const int zLevel); + virtual void renderCursor(const Position&, const int zLevel); + + //void loadWidgetStyle(const string& scriptFile, const string& widgetType = ""); + private: + typedef std::map<string,LuaStyleWidgetEntryPtr> VmMap; + VmMap vm_; + //typedef std::map<string,string> ScriptMap; + //ScriptMap widgetScripts_; + + //typedef std::map<string,string> NamedImagesMap; + //NamedImagesMap images_; + + boost::shared_ptr<LuaStyleBatcher> batcher_; + WindowRendererPtr renderer_; + SystemPtr sys_; + + void bind(VMPtr); + VMPtr createVM(); + void createVM(const string&,const string&); + }; +} // namespace ui + +#endif Added: trunk/yake/src/gui2/plugins/system.ogreois/ogre_ois.cpp =================================================================== --- trunk/yake/src/gui2/plugins/system.ogreois/ogre_ois.cpp (rev 0) +++ trunk/yake/src/gui2/plugins/system.ogreois/ogre_ois.cpp 2008-03-30 22:43:07 UTC (rev 1911) @@ -0,0 +1,220 @@ +#include "yake/gui2/plugins/system.ogreois/ogre_ois.h" + +#include "Ogre.h" +//Use this define to signify OIS will be used as a DLL +//(so that dll import/export macros are in effect) +#define OIS_DYNAMIC_LIB +#include <OIS/OIS.h> + +namespace yake { +namespace ui { + YAKE_REGISTER_CONCRETE(OgreOIS_InputProvider); + namespace detail { + struct OgreOIS_FrameListener : public Ogre::FrameListener, public Ogre::WindowEventListener, + public OIS::KeyListener + { + private: + //OIS::KeyListener + std::string keys_; + virtual bool keyPressed( const OIS::KeyEvent &arg ) + { + return true; + } + virtual bool keyReleased( const OIS::KeyEvent &arg ) + { + if (arg.key == OIS::KC_BACK) + { + ; + } + else if ( + (arg.key >= OIS::KC_1 && arg.key <= OIS::KC_RBRACKET) || + (arg.key >= OIS::KC_A && arg.key <= OIS::KC_GRAVE) || + (arg.key >= OIS::KC_Z && arg.key <= OIS::KC_SLASH) || + (arg.key == OIS::KC_SPACE)) + keys_ += mKeyboard->getAsString(arg.key); + return true; + } + public: + const std::string& keys() const + { return keys_; } + void clearKeys() + { keys_.clear(); } + public: + // + OgreOIS_FrameListener(): + inputManager_(0) + { + YAKE_ASSERT( Ogre::LogManager::getSingletonPtr() ).debug("Ogre doesn't seem to have been initialized!"); + Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***"); + OIS::ParamList pl; + size_t windowHnd = 0; + std::ostringstream windowHndStr; + + window_ = Ogre::Root::getSingleton().getAutoCreatedWindow(); + YAKE_ASSERT( window_ ).debug("only auto created window supported, at the moment" ); + window_->getCustomAttribute("WINDOW", &windowHnd); + windowHndStr << windowHnd; + pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str())); + + inputManager_ = OIS::InputManager::createInputSystem( pl ); + + //Create all devices (We only catch joystick exceptions here, as, most people have Key/Mouse) + mKeyboard = static_cast<OIS::Keyboard*>(inputManager_->createInputObject( OIS::OISKeyboard, true/*buffered*/ )); + mKeyboard->setEventCallback(this); + mMouse = static_cast<OIS::Mouse*>(inputManager_->createInputObject( OIS::OISMouse, false/*buffered*/ )); + try { + mJoy = static_cast<OIS::JoyStick*>(inputManager_->createInputObject( OIS::OISJoyStick, false/*buffered*/ )); + } + catch(...) { + mJoy = 0; + } + + //Set initial mouse clipping size + this->windowResized(window_); + + //Register as a Window listener + Ogre::WindowEventUtilities::addWindowEventListener(window_, this); + + Ogre::Root::getSingleton().addFrameListener(this); + } + virtual ~OgreOIS_FrameListener() + { + Ogre::Root::getSingleton().removeFrameListener(this); + //Remove ourself as a Window listener + Ogre::WindowEventUtilities::removeWindowEventListener(window_, this); + this->windowClosed(window_); + } + //Adjust mouse clipping area + virtual void windowResized(Ogre::RenderWindow* rw) + { + unsigned int width, height, depth; + int left, top; + rw->getMetrics(width, height, depth, left, top); + + const OIS::MouseState &ms = mMouse->getMouseState(); + ms.width = width; + ms.height = height; + } + //Unattach OIS before window shutdown (very important under Linux) + virtual void windowClosed(Ogre::RenderWindow* rw) + { + //Only close for window that created OIS (the main window in these demos) + if( rw == window_ ) + { + if( inputManager_ ) + { + inputManager_->destroyInputObject( mMouse ); + inputManager_->destroyInputObject( mKeyboard ); + inputManager_->destroyInputObject( mJoy ); + + OIS::InputManager::destroyInpu... [truncated message content] |
From: <psy...@us...> - 2008-03-24 21:31:34
|
Revision: 1910 http://yake.svn.sourceforge.net/yake/?rev=1910&view=rev Author: psyclonist Date: 2008-03-24 14:31:15 -0700 (Mon, 24 Mar 2008) Log Message: ----------- * [vehicle] fixed GenericVehicle::setSteering() Modified Paths: -------------- trunk/yake/src/vehicle/yakeNativeOde.cpp trunk/yake/yake/vehicle/yakeNativeOde.h Modified: trunk/yake/src/vehicle/yakeNativeOde.cpp =================================================================== --- trunk/yake/src/vehicle/yakeNativeOde.cpp 2008-03-24 21:30:20 UTC (rev 1909) +++ trunk/yake/src/vehicle/yakeNativeOde.cpp 2008-03-24 21:31:15 UTC (rev 1910) @@ -424,12 +424,16 @@ newVal = -1.; else if (newVal > 1.) newVal = 1.; - ConstVectorIterator< Deque<OdeWheel*> > itWheel( mSteeringGroups[ sg ] ); - while (itWheel.hasMoreElements()) + SteeringGroupList::const_iterator itSG = mSteeringGroups.find(sg); + YAKE_ASSERT( itSG != mSteeringGroups.end() )(sg).debug("steering group not found"); + if ( itSG != mSteeringGroups.end() ) { - OdeWheel* pW = itWheel.getNext(); - YAKE_ASSERT( pW ); - pW->setSteering( newVal ); + YAKE_FOR_EACH(Deque<OdeWheel*>::const_iterator, itWheel, itSG->second) + { + OdeWheel* pW = *itWheel; + YAKE_ASSERT( pW ); + pW->setSteering( newVal ); + } } } real GenericVehicle::getSteering( const uint32 sg ) const Modified: trunk/yake/yake/vehicle/yakeNativeOde.h =================================================================== --- trunk/yake/yake/vehicle/yakeNativeOde.h 2008-03-24 21:30:20 UTC (rev 1909) +++ trunk/yake/yake/vehicle/yakeNativeOde.h 2008-03-24 21:31:15 UTC (rev 1910) @@ -126,7 +126,7 @@ physics::IActorPtr mpChassis; - typedef AssocVector<uint32,Deque<OdeWheel*> > SteeringGroupList; + typedef std::map<uint32,Deque<OdeWheel*> > SteeringGroupList; SteeringGroupList mSteeringGroups; typedef std::pair<ICarEngine*,Deque<OdeWheel*> > CarEngineWheelsPair; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2008-03-24 21:30:47
|
Revision: 1909 http://yake.svn.sourceforge.net/yake/?rev=1909&view=rev Author: psyclonist Date: 2008-03-24 14:30:20 -0700 (Mon, 24 Mar 2008) Log Message: ----------- * added yake::factory template library * [base] replaced macro "mess" in yakeRegistry.h with yake::factory base implementation Modified Paths: -------------- trunk/yake/src/graphics/yakeGraphicsSystem.cpp trunk/yake/yake/audio/yakeAudioSystem.h trunk/yake/yake/base/templates/yakeRegistry.h trunk/yake/yake/graphics/yakeGraphicalWorld.h trunk/yake/yake/graphics/yakeGraphicsSystem.h Added Paths: ----------- trunk/yake/yake/factory/ trunk/yake/yake/factory/config.h trunk/yake/yake/factory/dynamic_factory.h trunk/yake/yake/factory/global_dynamic_factory.h trunk/yake/yake/factory/policies.h Modified: trunk/yake/src/graphics/yakeGraphicsSystem.cpp =================================================================== --- trunk/yake/src/graphics/yakeGraphicsSystem.cpp 2008-01-20 21:50:46 UTC (rev 1908) +++ trunk/yake/src/graphics/yakeGraphicsSystem.cpp 2008-03-24 21:30:20 UTC (rev 1909) @@ -33,13 +33,10 @@ #include <yake/graphics/yakeEntity.h> #include <yake/graphics/yakeGeometryAccess.h> -//============================================================================ -// INTERFACE STRUCTURES / UTILITY CLASSES -//============================================================================ namespace yake { namespace graphics { - YAKE_IMPLEMENT_REGISTRY( IGraphicsSystem ); + YAKE_IMPLEMENT_REGISTRY(IGraphicsSystem) /// GraphicsEntity GraphicsEntity::GraphicsEntity() : mName( uniqueName::create( "graphics" ) ) Modified: trunk/yake/yake/audio/yakeAudioSystem.h =================================================================== --- trunk/yake/yake/audio/yakeAudioSystem.h 2008-01-20 21:50:46 UTC (rev 1908) +++ trunk/yake/yake/audio/yakeAudioSystem.h 2008-03-24 21:30:20 UTC (rev 1909) @@ -153,11 +153,10 @@ */ class YAKE_AUDIO_API IAudioSystem { + YAKE_DECLARE_REGISTRY_0(IAudioSystem,String) public: virtual ~IAudioSystem(); virtual WorldPtr createWorld() = 0; - - YAKE_DECLARE_REGISTRY_0( IAudioSystem, yake::String ) }; } Modified: trunk/yake/yake/base/templates/yakeRegistry.h =================================================================== --- trunk/yake/yake/base/templates/yakeRegistry.h 2008-01-20 21:50:46 UTC (rev 1908) +++ trunk/yake/yake/base/templates/yakeRegistry.h 2008-03-24 21:30:20 UTC (rev 1909) @@ -27,9 +27,6 @@ #ifndef YAKE_BASE_TEMPLATES_REGISTRY_H #define YAKE_BASE_TEMPLATES_REGISTRY_H -//============================================================================ -// IMPLEMENTATION HEADERS -//============================================================================ // Standard headers #ifndef YAKE_BASEPREREQUISITES_H #include "yake/base/yakePrerequisites.h" @@ -38,190 +35,94 @@ #include <yake/base/yakeException.h> #include <yake/base/templates/yakeSmartAssert.h> #include <yake/base/templates/yakePointer.h> -#include <yake/base/templates/yakeManager.h> -#include <yake/base/mpl/yakeBuildArguments.h> +#include <yake/factory/global_dynamic_factory.h> -//============================================================================ -// INTERFACE STRUCTURES / UTILITY CLASSES -//============================================================================ -namespace yake -{ -namespace templates -{ +namespace yake { +namespace templates { -/* Helpers */ -#define FUNCTION(number) \ - YAKE_TYPES_ONE_FREE(number) \ - SharedPtr<T> create(typename T::RegistryType::Id id, YAKE_ARGUMENTS_ONE_FREE(number)) \ - { return T::getRegistry().getObject(id)->create(YAKE_USE_ARGUMENTS(number)); } -YAKE_IMPLEMENT_FUNCTION(FUNCTION) -#undef FUNCTION - -#define FUNCTION(number) \ - YAKE_TYPES_ONE_FREE(number) \ - SharedPtr<T> create_default(YAKE_ARGUMENTS_ONE_FREE(number)) \ - { return T::getRegistry().getDefaultCreator()->create(YAKE_USE_ARGUMENTS(number)); } -YAKE_IMPLEMENT_FUNCTION(FUNCTION) -#undef FUNCTION - -/* Registry */ -// todo: functors instead of creators -// todo: if we cannot simplify manager template, remove it -template <class ConfigClass> -class Registry : public Manager< typename ConfigClass::Id, SharedPtr< typename ConfigClass::ICreator >, RegisterFunctionsNames > -{ -YAKE_DECLARE_CLASS( yake::templates::Registry ) -public: // types - typedef ConfigClass Config; - typedef typename Config::Base Base; - typedef typename Config::Id Id; - typedef typename Config::ICreator ICreator; - -public: // constructors - Registry() : m_pDefaultCreator() {} - -private: // no copy - Registry( const Registry & ); - Registry & operator=( const Registry & ); - -public: // methods -#define FUNCTION( number ) \ - YAKE_TYPES( number ) \ - SharedPtr< Base > create( Id id, YAKE_ARGUMENTS_ONE_FREE( number ) ) \ - { return getObject( id )->create( YAKE_USE_ARGUMENTS( number ) ); } -YAKE_IMPLEMENT_FUNCTION( FUNCTION ) -#undef FUNCTION - - SharedPtr< ICreator > getDefaultCreator() - { - YAKE_ASSERT( ( Manager< typename ConfigClass::Id, SharedPtr< typename ConfigClass::ICreator>,RegisterFunctionsNames >::getIdentifiers().size() ) > 0 ).debug( "No default creator available." ); // todo: does not work in release mode, should throw exception - if( !m_pDefaultCreator ) m_pDefaultCreator = getObject( *Manager< typename ConfigClass::Id, SharedPtr< typename ConfigClass::ICreator >, RegisterFunctionsNames >::getIdentifiers().begin() ); // todo: (if(!m_pDefaultCreator) m_pDefaultCreator = front(); - return m_pDefaultCreator; - } - - void setDefaultCreator( const SharedPtr< ICreator > pCreator ) - { m_pDefaultCreator = pCreator; } - -private: // data - SharedPtr< ICreator > m_pDefaultCreator; -}; - - // Note: there already has to be a registry configuration class called RegistryConfig. // Note: this macro has to be used inside the class declaration. -#define YAKE_DECLARE_REGISTRY() \ +#define YAKE_DECLARE_REGISTRY_EX(INTERFACE,IDTYPE,PARAMS) \ public: \ - typedef yake::templates::Registry< RegistryConfig > RegistryType; \ - static RegistryType& getRegistry(); + typedef YAKE_FACTORY_NS::factory<IDTYPE,INTERFACE,SharedPtr<INTERFACE> PARAMS,YAKE_FACTORY_NS::ThrowErrorPolicy,YAKE_FACTORY_NS::SingletonPolicy> factory_t; \ + typedef factory_t::key_type id_type; \ + static factory_t& getRegistry(); // Note: you have to use DECLARE_REGISTRY() before. #define YAKE_IMPLEMENT_REGISTRY( Class ) \ - Class::RegistryType& Class::getRegistry() \ + Class::factory_t& Class::getRegistry() \ { \ - static RegistryType* registry_s = 0; \ - if( !registry_s ) registry_s = new RegistryType; \ - return *registry_s; \ + static factory_t* s_instance = new factory_t(); \ + return factory_t::instance(); \ } // Note: this macro has to be used inside the class declaration. -#define YAKE_DECLARE_CONCRETE( Concrete, id ) \ +#define YAKE_DECLARE_CONCRETE( Concrete, ID ) \ public: \ - static RegistryType::Id getId() \ + static factory_t::key_type getId() \ { \ - return id; \ - } \ - static void Register() \ - { \ - getRegistry().doRegister( getId(), yake::SharedPtr< RegistryConfig::ConcreteCreator< Concrete > >( new RegistryConfig::ConcreteCreator< Concrete > ) ); \ + return ID; \ } -// getRegistry().doAdd( getId(), yake::SharedPtr< RegistryConfig::ConcreteCreator< Concrete > >::create() ); \ todo - // Registers a concrete implementation which has been declared before. #define YAKE_REGISTER_CONCRETE( Concrete ) \ namespace \ { \ static struct Concrete##Initor \ { \ + typedef Concrete::factory_t factory_t; \ Concrete##Initor() \ { \ static int counter = 0; \ if( counter++ > 0 ) return; \ - typedef Concrete ConcreteT; \ - ConcreteT::Register(); \ + Concrete::getRegistry().reg_ctor_smartptr<Concrete>(Concrete::getId()); \ } \ + ~Concrete##Initor() \ + { \ + Concrete::getRegistry().remove(Concrete::getId()); \ + } \ } g_##Concrete##Initor; \ } // nameless + template<typename Interface, typename Kt> + inline SharedPtr<Interface> create(const Kt& id) + { + return SharedPtr<Interface>(Interface::getRegistry().create(id)); + } + template<typename Interface, typename Kt, typename A0> + inline SharedPtr<Interface> create(const Kt& id, const A0& a0) + { + return SharedPtr<Interface>(Interface::getRegistry().create(id,a0)); + } + template<typename Interface> + inline SharedPtr<Interface> create_default() + { + return SharedPtr<Interface>(Interface::getRegistry().create_default()); + } + template<typename Interface, typename A0> + inline SharedPtr<Interface> create_default(const A0& a0) + { + return SharedPtr<Interface>(Interface::getRegistry().create_default(a0)); + } + } // templates +using templates::create; +using templates::create_default; } // yake // Declares a registry for types with an empty constructor. #define YAKE_DECLARE_REGISTRY_0(BaseClass, IdClass) \ public: \ - struct RegistryConfig \ - { \ - typedef BaseClass Base; \ - typedef IdClass Id; \ - struct ICreator \ - { \ - virtual yake::SharedPtr< Base > create() = 0; \ - }; \ - template <typename T> \ - struct ConcreteCreator : public ICreator \ - { \ - yake::SharedPtr<Base> create() \ - { return yake::SharedPtr<T>(new T); } \ - }; \ - }; \ - YAKE_DECLARE_REGISTRY() + YAKE_DECLARE_REGISTRY_EX(BaseClass, IdClass, ()) - // return yake::SharedPtr< T >::create(); \ Todo - - // Declares a registry for types with a constructor that takes one parameter. #define YAKE_DECLARE_REGISTRY_1(BaseClass, IdClass, Param1) \ public: \ - struct RegistryConfig \ - { \ - typedef BaseClass Base; \ - typedef IdClass Id; \ - struct ICreator \ - { \ - virtual yake::SharedPtr<Base> create(Param1 p1) = 0; \ - }; \ - template <typename T> \ - struct ConcreteCreator : public ICreator \ - { \ - yake::SharedPtr<Base> create(Param1 p1) \ - { return yake::SharedPtr<T>(new T(p1)); } \ - }; \ - }; \ - YAKE_DECLARE_REGISTRY() + YAKE_DECLARE_REGISTRY_EX(BaseClass, IdClass, (Param1)) -// Declares a registry for types with a constructor that takes one parameter. -#define YAKE_DECLARE_REGISTRY_01(BaseClass, IdClass, Param1) \ +#define YAKE_DECLARE_REGISTRY_2(BaseClass, IdClass, Param1, Param2) \ public: \ - struct RegistryConfig \ - { \ - typedef BaseClass Base; \ - typedef IdClass Id; \ - struct ICreator \ - { \ - virtual yake::SharedPtr<Base> create() = 0; \ - virtual yake::SharedPtr<Base> create(Param1 p1) = 0; \ - }; \ - template <typename T> \ - struct ConcreteCreator : public ICreator \ - { \ - yake::SharedPtr<Base> create() \ - { return yake::SharedPtr<T>(new T()); } \ - \ - yake::SharedPtr<Base> create(Param1 p1) \ - { return yake::SharedPtr<T>(new T(p1)); } \ - }; \ - }; \ - YAKE_DECLARE_REGISTRY() + YAKE_DECLARE_REGISTRY_EX(BaseClass, IdClass, (Param1,Param2)) #endif // YAKE_BASE_TEMPLATES_REGISTRY_H Added: trunk/yake/yake/factory/config.h =================================================================== --- trunk/yake/yake/factory/config.h (rev 0) +++ trunk/yake/yake/factory/config.h 2008-03-24 21:30:20 UTC (rev 1909) @@ -0,0 +1,9 @@ +#ifndef YAKE_FACTORY_CONFIG_H +#define YAKE_FACTORY_CONFIG_H + +#define YAKE_FACTORY_EXCEPTION_BASE std::exception +#define YAKE_FACTORY_NS ::yake::factory +#define YAKE_FACTORY_NS_BEGIN() namespace yake { namespace factory { +#define YAKE_FACTORY_NS_END() }} + +#endif Added: trunk/yake/yake/factory/dynamic_factory.h =================================================================== --- trunk/yake/yake/factory/dynamic_factory.h (rev 0) +++ trunk/yake/yake/factory/dynamic_factory.h 2008-03-24 21:30:20 UTC (rev 1909) @@ -0,0 +1,216 @@ +#ifndef YAKE_FACTORY_DYNAMIC_FACTORY_H +#define YAKE_FACTORY_DYNAMIC_FACTORY_H + +#include "config.h" +#include "policies.h" + +YAKE_FACTORY_NS_BEGIN() + +namespace detail { + + template< + class X, + typename Kt, + typename Signature> + struct creator; + + template< + class X, + typename Kt, + typename R> + struct creator<X,Kt,R()> + { + typedef boost::function<R()> function_t; + typedef R return_t; + R create(const Kt& id) + { + std::cout << "attempt create '" << typeid(X::return_t).name() << "' id='" << id << "' sig='" << typeid(X::signature_t).name() << "'\n"; + typedef X::Id2Class::const_iterator it_t; + const X& x = static_cast<X&>(*this); + it_t it = x.id2class_.find(id); + if (it == x.id2class_.end()) + { + X::error_t::onError(NotFoundException("creator not registered for id '"+id+"'")); + return R(); + } + return (it->second)(); + } + R create_default() + { + std::cout << "attempt create default sig='" << typeid(X::signature_t).name() << "'\n"; + typedef X::Id2Class::const_iterator it_t; + const X& x = static_cast<X&>(*this); + it_t it = x.id2class_.begin(); + if (it == x.id2class_.end()) + { + X::error_t::onError(NotFoundException("default creator not registered")); + return R(); + } + return (it->second)(); + } + }; + + + template< + class X, + typename Kt, + typename R, typename A0> + struct creator<X,Kt,R(A0)> + { + typedef boost::function<R(A0)> function_t; + typedef R return_t; + R create(const Kt& id, const A0& a0 = A0()) + { + std::cout << "attempt create '" << typeid(X::return_t).name() << "' id='" << id << "' sig='" << typeid(X::signature_t).name() << "'\n"; + typedef X::Id2Class::const_iterator it_t; + const X& x = static_cast<X&>(*this); + it_t it = x.id2class_.find(id); + if (it == x.id2class_.end()) + { + X::error_t::onError(NotFoundException("creator not registered for id '"+id+"'")); + return R(); + } + return (it->second)(a0); + } + R create_default(const A0& a0 = A0()) + { + std::cout << "attempt create default sig='" << typeid(X::signature_t).name() << "'\n"; + typedef X::Id2Class::const_iterator it_t; + const X& x = static_cast<X&>(*this); + it_t it = x.id2class_.begin(); + if (it == x.id2class_.end()) + { + X::error_t::onError(NotFoundException("default creator not registered")); + return R(); + } + return (it->second)(a0); + } + }; + + template< + class T, + typename Signature> + struct new_fn; + + template< + class T, + typename R> + struct new_fn<T,R()> + { + R* operator()() + { + return Holder(new T()); + } + }; + + template< + class T, + typename R, + typename A0> + struct new_fn<T,R(A0)> + { + R* operator()(const A0& a0) + { + return Holder(new T(a0)); + } + }; + + + template< + class T, + typename Holder, + typename Signature> + struct new_fn_h; + + template< + class T, + typename Holder, + typename R> + struct new_fn_h<T,Holder,R()> + { + Holder operator()() + { + return Holder(new T()); + } + }; + + template< + class T, + typename Holder, + typename R, + typename A0> + struct new_fn_h<T,Holder,R(A0)> + { + Holder operator()(const A0& a0) + { + return Holder(new T(a0)); + } + }; +} // namespace detail + + +/** + @note No virtual destructors use, so do not delete via pointer-to-base! + @param Kt key type aka ids for registered creators/products + @param Interface product base interface/class + @param Signature Signature of the creator objects/functions (e.g. MyInterface*(int,const string&)) + @param ErrorPolicy Error handling can be configured (default: NoThrowErrorPolicy). + @param InstancePolicy Factory instance policy can be configured (default: NoInstancePolicy). +*/ +template< + typename Kt, + class Interface, + typename Signature, + class ErrorPolicy = NoThrowErrorPolicy, + template<class> class InstancePolicy = NoInstancePolicy + /*,template<class,typename,typename> class CreatorType = detail::creator*/> +struct factory : + public InstancePolicy<factory<Kt,Interface,Signature,ErrorPolicy,InstancePolicy> >, + public detail::creator<factory<Kt,Interface,Signature,ErrorPolicy,InstancePolicy>,Kt,Signature > +{ + typedef Kt key_type; + typedef Interface interface_t; + typedef ErrorPolicy error_t; + typedef Signature signature_t; + + typedef detail::creator<factory<Kt,Interface,Signature,ErrorPolicy,InstancePolicy>,Kt,Signature > creator_t; + friend struct creator_t; + typedef typename creator_t::function_t function_t; + typedef typename creator_t::return_t return_t; + //using creator_t::create; + + template<typename Handler0> + void reg(const key_type& id, Handler0 h0) + { + std::cout << "reg '" << id << "'\n"; + id2class_[ id ] = function_t(h0); + } + + template<typename ProductT> + void reg_ctor(const key_type& id) + { + detail::new_fn<ProductT,,Signature> c_t; + reg(id,c_t); + } + + template<typename ProductT> + void reg_ctor_smartptr(const key_type& id) + { + detail::new_fn_h<ProductT,return_t,Signature> c_t; + reg(id,c_t); + } + + void remove(const key_type& id) + { + Id2Class::iterator it = id2class_.find(id); + if (it != id2class_.end()) + id2class_.erase(it); + } +private: + typedef std::map<key_type,function_t> Id2Class; + Id2Class id2class_; +}; + +YAKE_FACTORY_NS_END() + +#endif Added: trunk/yake/yake/factory/global_dynamic_factory.h =================================================================== --- trunk/yake/yake/factory/global_dynamic_factory.h (rev 0) +++ trunk/yake/yake/factory/global_dynamic_factory.h 2008-03-24 21:30:20 UTC (rev 1909) @@ -0,0 +1,134 @@ +#ifndef YAKE_FACTORY_GLOBAL_DYNAMIC_FACTORY_H +#define YAKE_FACTORY_GLOBAL_DYNAMIC_FACTORY_H + +#include "config.h" +#include "policies.h" +#include "dynamic_factory.h" + +YAKE_FACTORY_NS_BEGIN() + + +template<typename Interface> +struct global_interface_traits +{ + typedef Interface*(signature_t)(); + typedef boost::shared_ptr<Interface> holder_t; +}; + +/** Do NOT directly use this interface... */ +template<class Interface> +struct global_factory +{ + typedef std::string key_type; + typedef typename global_interface_traits<Interface>::signature_t signature_t; + typedef yake::factory::factory<key_type,Interface,signature_t,NoThrowErrorPolicy,SingletonPolicy> factory_t; + + //typedef typename factory_t::holder_t holder_t; + typedef typename global_interface_traits<Interface>::holder_t holder_t; + + static factory_t& instance() + { + return factory_t::instance(); + } + template<class Interface, class ConcreteT, typename CreatorFn> + void reg_product(const key_type& id, CreatorFn fn) + { + instance().reg(id,fn); + } + + template<typename Interface, typename Kt> + holder_t create(const Kt& id) + { + return instance().create(id); + } + template<typename Interface, typename Kt, typename A0> + holder_t create(const Kt& id, const A0& a0) + { + return instance().create(id,a0); + } +}; + +template<class Interface, class Kt> +typename global_interface_traits<Interface>::holder_t create(const Kt& id) +{ + typedef typename global_interface_traits<Interface>::holder_t holder_t; + return holder_t(global_factory<Interface>::instance().create(id)); +} +template<class Interface, class Kt, typename A0> +typename global_interface_traits<Interface>::holder_t create(const Kt& id, const A0& a0) +{ + typedef typename global_interface_traits<Interface>::holder_t holder_t; + return holder_t(global_factory<Interface>::instance().create(id,a0)); +} + +//////////////////////////////////////////////////////////////// +// Found in Dr.Dobb's: http://www.ddj.com/cpp/184401206 // +// Modifications: // +// added YAKE_ prefix // +// // +// // +//////////////////// UtilityMacros.h ///////////////// rado //// +// // +// Copyright (c) 1999 Radoslav Getov // +// // +// Permission to use, copy, modify and distribute this // +// software is granted without fee, provided that the above // +// copyright notice and this permission notice appear in the // +// modified source and the source files that #include it. // +// // +//////////////////////////////////////////////////////////////// +// // +#define YAKE_UNIQUE_NAME_1(prefix, x) prefix##x +#define YAKE_UNIQUE_NAME_2(prefix, x) YAKE_UNIQUE_NAME_1 (prefix, x) +#define YAKE_UNIQUE_NAME_WP(prefix) YAKE_UNIQUE_NAME_2 (prefix, __LINE__) +#define YAKE_UNIQUE_NAME YAKE_UNIQUE_NAME_WP(uniqueNameOnLine_) +#define YAKE_UNIQUE_NAME2 YAKE_UNIQUE_NAME_WP(uniqueNameOnLine2_) +// // +//////////////////////////////////////////////////////////////// + +// Shortcuts for registering global products: +// YAKE_REGISTER_GLOBAL_PRODUCT +// YAKE_REGISTER_GLOBAL_PRODUCT1 + +#define YAKE_REGISTER_GLOBAL_PRODUCT(INTERFACE,PRODUCT,ID,CREATORFN) \ +namespace { \ +struct YAKE_UNIQUE_NAME \ +{ \ + YAKE_UNIQUE_NAME() \ + { \ + YAKE_FACTORY_NS::global_factory<INTERFACE>::instance().reg(ID,boost::bind(CREATORFN)); \ + } \ +} YAKE_UNIQUE_NAME2; \ +} +#define YAKE_REGISTER_GLOBAL_PRODUCT1(INTERFACE,PRODUCT,ID,CREATORFN) \ +namespace { \ +struct YAKE_UNIQUE_NAME \ +{ \ + YAKE_UNIQUE_NAME() \ + { \ + YAKE_FACTORY_NS::global_factory<INTERFACE>::instance().reg(ID,boost::bind(CREATORFN,_1)); \ + } \ +} YAKE_UNIQUE_NAME2; \ +} + +// Shortcuts for registering global factories: +// YAKE_REGISTER_GLOBAL_FACTORY_EX +// YAKE_REGISTER_GLOBAL_FACTORY + +#define YAKE_REGISTER_GLOBAL_FACTORY_EX(INTERFACE,RETURNTYPE,PARAMS,HOLDER) \ + YAKE_FACTORY_NS_BEGIN() \ + template<> \ + struct global_interface_traits<INTERFACE> \ + { \ + typedef RETURNTYPE(signature_t)PARAMS; \ + typedef HOLDER holder_t; \ + }; \ + YAKE_FACTORY_NS_END() + +#define YAKE_REGISTER_GLOBAL_FACTORY(INTERFACE,PARAMS) \ + YAKE_REGISTER_GLOBAL_FACTORY_EX(INTERFACE,INTERFACE *,PARAMS,boost::shared_ptr<INTERFACE>) + + +YAKE_FACTORY_NS_END() + +#endif Added: trunk/yake/yake/factory/policies.h =================================================================== --- trunk/yake/yake/factory/policies.h (rev 0) +++ trunk/yake/yake/factory/policies.h 2008-03-24 21:30:20 UTC (rev 1909) @@ -0,0 +1,70 @@ +#ifndef YAKE_FACTORY_POLICIES_H +#define YAKE_FACTORY_POLICIES_H + +#include "config.h" +#include <string> +#include <iostream> // for the std::cerr (used in error policies) +#include <map> +#include <exception> +#include <boost/shared_ptr.hpp> +#include <boost/function.hpp> +#include <boost/bind.hpp> + +YAKE_FACTORY_NS_BEGIN() + + +// Exceptions + +struct Exception : public std::exception +{ + Exception(const std::string& msg) : msg_(msg) + {} + virtual const char* what() const + { + return msg_.c_str(); + } +private: + std::string msg_; +}; +typedef Exception NotFoundException; + +// Error Policies + +struct NoThrowErrorPolicy +{ + template<typename Et> + static void onError(const Et& ex) + { + std::cerr << "ERROR: " << ex.what() << "\n"; + } +}; +struct ThrowErrorPolicy +{ + template<typename Et> + static void onError(const Et& ex) + { + std::cerr << "ERROR: " << ex.what() << "\n"; + throw ex; + } +}; + +// Instance Policies + +template<class X> +struct NoInstancePolicy +{ +}; + +template<class X> +struct SingletonPolicy +{ + static X& instance() + { + static X s_instance; + return s_instance; + } +}; + +YAKE_FACTORY_NS_END() + +#endif Modified: trunk/yake/yake/graphics/yakeGraphicalWorld.h =================================================================== --- trunk/yake/yake/graphics/yakeGraphicalWorld.h 2008-01-20 21:50:46 UTC (rev 1908) +++ trunk/yake/yake/graphics/yakeGraphicalWorld.h 2008-03-24 21:30:20 UTC (rev 1909) @@ -470,7 +470,6 @@ class YAKE_GRAPHICS_INTERFACE_API IFx { - YAKE_DECLARE_REGISTRY_01(IFx, String, IWorld&); public: virtual ~IFx() {} }; @@ -478,5 +477,7 @@ } // graphics } // yake +YAKE_REGISTER_GLOBAL_FACTORY( yake::graphics::IFx, (yake::graphics::IWorld&) ) + #endif // YAKE_GRAPHICALWORLD_H Modified: trunk/yake/yake/graphics/yakeGraphicsSystem.h =================================================================== --- trunk/yake/yake/graphics/yakeGraphicsSystem.h 2008-01-20 21:50:46 UTC (rev 1908) +++ trunk/yake/yake/graphics/yakeGraphicsSystem.h 2008-03-24 21:30:20 UTC (rev 1909) @@ -76,7 +76,7 @@ { typedef AssocVector<String, String> ParamMap; - YAKE_DECLARE_REGISTRY_01(IGraphicsSystem, String, ParamMap); + YAKE_DECLARE_REGISTRY_1(IGraphicsSystem, String, ParamMap); virtual ~IGraphicsSystem(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2008-01-20 21:50:46
|
Revision: 1908 http://yake.svn.sourceforge.net/yake/?rev=1908&view=rev Author: psyclonist Date: 2008-01-20 13:50:46 -0800 (Sun, 20 Jan 2008) Log Message: ----------- * [build] removed *_samples.cmd Removed Paths: ------------- branches/v0-7-0/yake/scripts/cb_gnu_win/build_samples.cmd branches/v0-7-0/yake/scripts/cb_gnu_win/clean_samples.cmd Deleted: branches/v0-7-0/yake/scripts/cb_gnu_win/build_samples.cmd =================================================================== --- branches/v0-7-0/yake/scripts/cb_gnu_win/build_samples.cmd 2008-01-20 21:49:52 UTC (rev 1907) +++ branches/v0-7-0/yake/scripts/cb_gnu_win/build_samples.cmd 2008-01-20 21:50:46 UTC (rev 1908) @@ -1,7 +0,0 @@ -@echo off -pushd ..\premake -setlocal -set SOLUTION_TARGET_DIR=cb_gnu_win -premake --file samples.lua --target cb-gcc --os windows -popd -pause Deleted: branches/v0-7-0/yake/scripts/cb_gnu_win/clean_samples.cmd =================================================================== --- branches/v0-7-0/yake/scripts/cb_gnu_win/clean_samples.cmd 2008-01-20 21:49:52 UTC (rev 1907) +++ branches/v0-7-0/yake/scripts/cb_gnu_win/clean_samples.cmd 2008-01-20 21:50:46 UTC (rev 1908) @@ -1,7 +0,0 @@ -@echo off -pushd ..\premake -setlocal -set SOLUTION_TARGET_DIR=cb_gnu_win -premake --file samples.lua --clean -popd -pause This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2008-01-20 21:50:19
|
Revision: 1907 http://yake.svn.sourceforge.net/yake/?rev=1907&view=rev Author: psyclonist Date: 2008-01-20 13:49:52 -0800 (Sun, 20 Jan 2008) Log Message: ----------- * [build] removed *_samples.cmd Removed Paths: ------------- branches/v0-7-0/yake/scripts/msvc80/build_samples.cmd branches/v0-7-0/yake/scripts/msvc80/clean_samples.cmd Deleted: branches/v0-7-0/yake/scripts/msvc80/build_samples.cmd =================================================================== --- branches/v0-7-0/yake/scripts/msvc80/build_samples.cmd 2007-12-12 21:48:34 UTC (rev 1906) +++ branches/v0-7-0/yake/scripts/msvc80/build_samples.cmd 2008-01-20 21:49:52 UTC (rev 1907) @@ -1,7 +0,0 @@ -@echo off -pushd ..\premake -setlocal -set SOLUTION_TARGET_DIR=msvc80 -premake --file samples.lua --target vs2005 -popd -pause Deleted: branches/v0-7-0/yake/scripts/msvc80/clean_samples.cmd =================================================================== --- branches/v0-7-0/yake/scripts/msvc80/clean_samples.cmd 2007-12-12 21:48:34 UTC (rev 1906) +++ branches/v0-7-0/yake/scripts/msvc80/clean_samples.cmd 2008-01-20 21:49:52 UTC (rev 1907) @@ -1,7 +0,0 @@ -@echo off -pushd ..\premake -setlocal -set SOLUTION_TARGET_DIR=msvc80 -premake --file samples.lua --clean -popd -pause This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-12-12 21:48:32
|
Revision: 1906 http://yake.svn.sourceforge.net/yake/?rev=1906&view=rev Author: psyclonist Date: 2007-12-12 13:48:34 -0800 (Wed, 12 Dec 2007) Log Message: ----------- merge 1890:HEAD branches/v0-7-0 trunk Modified Paths: -------------- trunk/yake/documentation/api/DoxySfile trunk/yake/documentation/api/Doxyfile trunk/yake/samples/audio/demo1/demo.cpp trunk/yake/samples/bin/release/raf_common.cfg trunk/yake/samples/cmdrmayhem/yakeDemo.cpp trunk/yake/scripts/msvc80/yake.suo trunk/yake/scripts/premake/plugins.lua trunk/yake/scripts/premake/samples.lua trunk/yake/src/base/native/win32/yakeTime.cpp trunk/yake/src/bindings.lua/detail/property.lua.cpp trunk/yake/src/plugins/audioOpenAL/yakeAudioWorldOpenAL.cpp trunk/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h Added Paths: ----------- trunk/yake/common/media/graphics.materials/scripts/yake.material trunk/yake/common/media/gui/imagesets/Imageset.xsd trunk/yake/common/media/gui/imagesets/TaharezLook.imageset trunk/yake/common/media/gui/imagesets/TaharezLook.tga trunk/yake/common/media/gui/looknfeel/TaharezLook.looknfeel trunk/yake/common/media/gui/schemes/GUIScheme.xsd trunk/yake/common/media/gui/schemes/TaharezLookSkin.scheme trunk/yake/common/media/gui/schemes/TaharezLookWidgetAliases.scheme trunk/yake/samples/bin/debug/sampleCmdrMayhem.cfg trunk/yake/samples/bin/release/commclient.cfg trunk/yake/samples/bin/release/commserver.cfg trunk/yake/samples/bin/release/roclient.cfg trunk/yake/samples/bin/release/rodemo.cfg trunk/yake/samples/bin/release/roserver.cfg trunk/yake/samples/bin/release/sampleCmdrMayhem.cfg trunk/yake/samples/bin/release/sampleGuiConsole.cfg trunk/yake/samples/bin/release/sampleRaf1.cfg trunk/yake/samples/bin/release/sampleRafLua1.cfg trunk/yake/samples/bin/release/sampleRafLua2.cfg trunk/yake/samples/bin/release/sampleVehicle.cfg Copied: trunk/yake/common/media/graphics.materials/scripts/yake.material (from rev 1905, branches/v0-7-0/yake/common/media/graphics.materials/scripts/yake.material) =================================================================== --- trunk/yake/common/media/graphics.materials/scripts/yake.material (rev 0) +++ trunk/yake/common/media/graphics.materials/scripts/yake.material 2007-12-12 21:48:34 UTC (rev 1906) @@ -0,0 +1,44 @@ +material blue_translucent +{ + receive_shadows off + technique + { + pass + { + //lighting off + + // alpha=opacity (1.=opaque,0=transparent) + diffuse .2 .2 1 0.6 + ambient 1 1 1 + //specular 1 1 1 + depth_write off + //depth_check off + + //scene_blend modulate + scene_blend alpha_blend + //scene_blend modulate + } + } +} +material red_translucent +{ + receive_shadows off + technique + { + pass + { + //lighting off + + // alpha=opacity (1.=opaque,0=transparent) + diffuse 1 0 0 0.6 + ambient 1 1 1 + //specular 1 1 1 + depth_write off + //depth_check off + + //scene_blend modulate + scene_blend alpha_blend + //scene_blend modulate + } + } +} Copied: trunk/yake/common/media/gui/imagesets/Imageset.xsd (from rev 1905, branches/v0-7-0/yake/common/media/gui/imagesets/Imageset.xsd) =================================================================== --- trunk/yake/common/media/gui/imagesets/Imageset.xsd (rev 0) +++ trunk/yake/common/media/gui/imagesets/Imageset.xsd 2007-12-12 21:48:34 UTC (rev 1906) @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + + <xsd:element name="Imageset" type="ImagesetType"/> + + <xsd:complexType name="ImagesetType"> + <xsd:sequence> + <xsd:element name="Image" type="ImageType" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="Imagefile" type="xsd:string" use="required"/> + <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="Name" type="xsd:string" use="required"/> + <xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" /> + <xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" /> + <xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" /> + </xsd:complexType> + + <xsd:complexType name="ImageType"> + <xsd:attribute name="Name" type="xsd:string" use="required"/> + <xsd:attribute name="XPos" type="xsd:nonNegativeInteger" use="required"/> + <xsd:attribute name="YPos" type="xsd:nonNegativeInteger" use="required"/> + <xsd:attribute name="Width" type="xsd:nonNegativeInteger" use="required"/> + <xsd:attribute name="Height" type="xsd:nonNegativeInteger" use="required"/> + <xsd:attribute name="XOffset" type="xsd:integer" use="optional" default="0"/> + <xsd:attribute name="YOffset" type="xsd:integer" use="optional" default="0"/> + </xsd:complexType> + +</xsd:schema> Copied: trunk/yake/common/media/gui/imagesets/TaharezLook.imageset (from rev 1905, branches/v0-7-0/yake/common/media/gui/imagesets/TaharezLook.imageset) =================================================================== --- trunk/yake/common/media/gui/imagesets/TaharezLook.imageset (rev 0) +++ trunk/yake/common/media/gui/imagesets/TaharezLook.imageset 2007-12-12 21:48:34 UTC (rev 1906) @@ -0,0 +1,242 @@ +<?xml version="1.0" ?> +<Imageset Name="TaharezLook" Imagefile="TaharezLook.tga" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"> + <Image Name="ClientBrush" XPos="2" YPos="2" Width="64" Height="64" /> + <Image Name="WindowLeftEdge" XPos="6" YPos="95" Width="1" Height="22" XOffset="4" /> + <Image Name="WindowRightEdge" XPos="34" YPos="95" Width="1" Height="22" XOffset="-5" /> + <Image Name="WindowTopEdge" XPos="9" YPos="68" Width="23" Height="1" /> + <Image Name="WindowBottomEdge" XPos="9" YPos="143" Width="23" Height="1" /> + <Image Name="WindowTopLeft" XPos="2" YPos="68" Width="5" Height="24" /> + <Image Name="WindowTopRight" XPos="34" YPos="68" Width="5" Height="24" /> + <Image Name="WindowBottomLeft" XPos="2" YPos="120" Width="5" Height="24" /> + <Image Name="WindowBottomRight" XPos="34" YPos="120" Width="5" Height="24" /> + <Image Name="ButtonLeftNormal" XPos="68" YPos="20" Width="12" Height="16" /> + <Image Name="ButtonMiddleNormal" XPos="82" YPos="20" Width="12" Height="16" /> + <Image Name="ButtonRightNormal" XPos="96" YPos="20" Width="12" Height="16" /> + <Image Name="ButtonLeftPushed" XPos="68" YPos="38" Width="12" Height="16" /> + <Image Name="ButtonMiddlePushed" XPos="82" YPos="38" Width="12" Height="16" /> + <Image Name="ButtonRightPushed" XPos="96" YPos="38" Width="12" Height="16" /> + <Image Name="ButtonLeftHighlight" XPos="68" YPos="56" Width="12" Height="16" /> + <Image Name="ButtonMiddleHighlight" XPos="82" YPos="56" Width="12" Height="16" /> + <Image Name="ButtonRightHighlight" XPos="96" YPos="56" Width="12" Height="16" /> + <Image Name="CheckboxNormal" XPos="110" YPos="2" Width="12" Height="12" /> + <Image Name="CheckboxHover" XPos="110" YPos="30" Width="12" Height="12" /> + <Image Name="CheckboxMark" XPos="110" YPos="16" Width="12" Height="12" /> + <Image Name="RadioButtonNormal" XPos="124" YPos="2" Width="12" Height="12" /> + <Image Name="RadioButtonHover" XPos="124" YPos="30" Width="12" Height="12" /> + <Image Name="RadioButtonMark" XPos="124" YPos="16" Width="12" Height="12" /> + <Image Name="TitlebarLeft" XPos="68" YPos="2" Width="8" Height="16" /> + <Image Name="TitlebarMiddle" XPos="78" YPos="2" Width="8" Height="16" /> + <Image Name="TitlebarRight" XPos="88" YPos="2" Width="8" Height="16" /> + <Image Name="NewTitlebarLeft" XPos="61" YPos="127" Width="13" Height="16" /> + <Image Name="NewTitlebarMiddle" XPos="77" YPos="127" Width="12" Height="16" /> + <Image Name="NewTitlebarRight" XPos="92" YPos="127" Width="12" Height="16" /> + <Image Name="SysAreaMiddle" XPos="107" YPos="127" Width="12" Height="16" /> + <Image Name="SysAreaRight" XPos="122" YPos="127" Width="13" Height="16" /> + <Image Name="StaticLeft" XPos="41" YPos="89" Width="6" Height="6" /> + <Image Name="StaticRight" XPos="63" YPos="89" Width="6" Height="6" /> + <Image Name="StaticTop" XPos="52" YPos="78" Width="6" Height="6" /> + <Image Name="StaticBottom" XPos="52" YPos="100" Width="6" Height="6" /> + <Image Name="StaticTopLeft" XPos="41" YPos="78" Width="6" Height="6" /> + <Image Name="StaticTopRight" XPos="63" YPos="78" Width="6" Height="6" /> + <Image Name="StaticBottomLeft" XPos="41" YPos="100" Width="6" Height="6" /> + <Image Name="StaticBottomRight" XPos="63" YPos="100" Width="6" Height="6" /> + <Image Name="StaticBackdrop" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="ProgressBarLeft" XPos="71" YPos="74" Width="7" Height="12" /> + <Image Name="ProgressBarMiddle" XPos="80" YPos="74" Width="6" Height="12" /> + <Image Name="ProgressBarRight" XPos="88" YPos="74" Width="6" Height="12" /> + <Image Name="ProgressBarDimSegment" XPos="96" YPos="74" Width="8" Height="12" /> + <Image Name="ProgressBarLitSegment" XPos="106" YPos="74" Width="8" Height="12" /> + <Image Name="EditBoxLeft" XPos="41" YPos="108" Width="4" Height="18" /> + <Image Name="EditBoxMiddle" XPos="47" YPos="108" Width="4" Height="18" /> + <Image Name="EditBoxRight" XPos="53" YPos="108" Width="4" Height="18" /> + <Image Name="EditBoxCarat" XPos="60" YPos="108" Width="4" Height="18" /> + <Image Name="SpinnerUpNormal" XPos="68" YPos="110" Width="10" Height="6" /> + <Image Name="SpinnerDownNormal" XPos="68" YPos="118" Width="10" Height="6" /> + <Image Name="SpinnerUpHover" XPos="82" YPos="110" Width="10" Height="6" /> + <Image Name="SpinnerDownHover" XPos="82" YPos="118" Width="10" Height="6" /> + <Image Name="TextSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" /> + <Image Name="VertScrollTop" XPos="182" YPos="2" Width="20" Height="8" /> + <Image Name="VertScrollMiddle" XPos="182" YPos="12" Width="20" Height="8" /> + <Image Name="VertScrollBottom" XPos="182" YPos="22" Width="20" Height="8" /> + <Image Name="VertScrollBarSegment" XPos="206" YPos="2" Width="4" Height="10" /> + <Image Name="VertScrollThumbNormal" XPos="214" YPos="2" Width="8" Height="24" /> + <Image Name="VertScrollThumbHover" XPos="224" YPos="2" Width="8" Height="24" /> + <Image Name="VertScrollUpNormal" XPos="196" YPos="32" Width="12" Height="12" /> + <Image Name="VertScrollDownNormal" XPos="182" YPos="32" Width="12" Height="12" /> + <Image Name="VertScrollUpHover" XPos="196" YPos="46" Width="12" Height="12" /> + <Image Name="VertScrollDownHover" XPos="182" YPos="46" Width="12" Height="12" /> + <Image Name="MiniVertScrollBarSegment" XPos="207" YPos="60" Width="4" Height="10" /> + <Image Name="MiniVertScrollThumbNormal" XPos="214" YPos="59" Width="7" Height="22" /> + <Image Name="MiniVertScrollThumbTopNormal" XPos="214" YPos="59" Width="7" Height="5" /> + <Image Name="MiniVertScrollThumbMiddleNormal" XPos="214" YPos="65" Width="7" Height="5" /> + <Image Name="MiniVertScrollThumbBottomNormal" XPos="214" YPos="76" Width="7" Height="5" /> + <Image Name="MiniVertScrollThumbTopHover" XPos="223" YPos="59" Width="7" Height="5" /> + <Image Name="MiniVertScrollThumbMiddleHover" XPos="223" YPos="65" Width="7" Height="5" /> + <Image Name="MiniVertScrollThumbBottomHover" XPos="223" YPos="76" Width="7" Height="5" /> + <Image Name="MiniVertScrollThumbHover" XPos="223" YPos="59" Width="7" Height="22" /> + <Image Name="MiniVertScrollUpNormal" XPos="194" YPos="60" Width="10" Height="9" /> + <Image Name="MiniVertScrollDownNormal" XPos="182" YPos="59" Width="10" Height="9" /> + <Image Name="MiniVertScrollUpHover" XPos="194" YPos="70" Width="10" Height="9" /> + <Image Name="MiniVertScrollDownHover" XPos="182" YPos="69" Width="10" Height="9" /> + <Image Name="VertSliderBody" XPos="234" YPos="2" Width="9" Height="48" /> + <Image Name="VertSliderThumbNormal" XPos="217" YPos="28" Width="15" Height="6" /> + <Image Name="VertSliderThumbHover" XPos="217" YPos="36" Width="15" Height="6" /> + <Image Name="MiniHorzScrollBarSegment" XPos="244" YPos="80" Width="10" Height="4" /> + <Image Name="MiniHorzScrollThumbNormal" XPos="233" YPos="87" Width="22" Height="7" /> + <Image Name="MiniHorzScrollThumbLeftNormal" XPos="233" YPos="87" Width="5" Height="7" /> + <Image Name="MiniHorzScrollThumbMiddleNormal" XPos="239" YPos="87" Width="5" Height="7" /> + <Image Name="MiniHorzScrollThumbRightNormal" XPos="250" YPos="87" Width="5" Height="7" /> + <Image Name="MiniHorzScrollThumbHover" XPos="233" YPos="96" Width="22" Height="7" /> + <Image Name="MiniHorzScrollThumbLeftHover" XPos="233" YPos="96" Width="5" Height="7" /> + <Image Name="MiniHorzScrollThumbMiddleHover" XPos="239" YPos="96" Width="5" Height="7" /> + <Image Name="MiniHorzScrollThumbRightHover" XPos="250" YPos="96" Width="5" Height="7" /> + <Image Name="MiniHorzScrollLeftNormal" XPos="246" YPos="55" Width="9" Height="10" /> + <Image Name="MiniHorzScrollRightNormal" XPos="245" YPos="67" Width="9" Height="10" /> + <Image Name="MiniHorzScrollLeftHover" XPos="236" YPos="55" Width="9" Height="10" /> + <Image Name="MiniHorzScrollRightHover" XPos="235" YPos="67" Width="9" Height="10" /> + <Image Name="ListboxLeft" XPos="41" YPos="89" Width="7" Height="6" /> + <Image Name="ListboxRight" XPos="62" YPos="89" Width="7" Height="6" /> + <Image Name="ListboxTop" XPos="52" YPos="78" Width="6" Height="7" /> + <Image Name="ListboxBottom" XPos="52" YPos="99" Width="6" Height="7" /> + <Image Name="ListboxTopLeft" XPos="41" YPos="78" Width="7" Height="7" /> + <Image Name="ListboxTopRight" XPos="62" YPos="78" Width="7" Height="7" /> + <Image Name="ListboxBottomLeft" XPos="41" YPos="99" Width="7" Height="7" /> + <Image Name="ListboxBottomRight" XPos="62" YPos="99" Width="7" Height="7" /> + <Image Name="ListboxBackdrop" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="ListboxSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" /> + <Image Name="ComboboxEditLeft" XPos="138" YPos="2" Width="8" Height="16" /> + <Image Name="ComboboxEditMiddle" XPos="148" YPos="2" Width="8" Height="16" /> + <Image Name="ComboboxListButtonNormal" XPos="158" YPos="2" Width="16" Height="16" /> + <Image Name="ComboboxListButtonHover" XPos="158" YPos="20" Width="16" Height="16" /> + <Image Name="ComboboxListLeft" XPos="138" YPos="48" Width="8" Height="8" /> + <Image Name="ComboboxListRight" XPos="158" YPos="48" Width="8" Height="8" /> + <Image Name="ComboboxListTop" XPos="148" YPos="48" Width="8" Height="8" /> + <Image Name="ComboboxListBottom" XPos="148" YPos="58" Width="8" Height="8" /> + <Image Name="ComboboxListTopLeft" XPos="138" YPos="38" Width="8" Height="8" /> + <Image Name="ComboboxListTopRight" XPos="158" YPos="38" Width="8" Height="8" /> + <Image Name="ComboboxListBottomLeft" XPos="138" YPos="58" Width="8" Height="8" /> + <Image Name="ComboboxListBottomRight" XPos="158" YPos="58" Width="8" Height="8" /> + <Image Name="ComboboxListBackdrop" XPos="148" YPos="48" Width="8" Height="8" /> + <Image Name="ComboboxSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" /> + <Image Name="ComboboxDividerLeft" XPos="138" YPos="68" Width="14" Height="1" /> + <Image Name="ComboboxDividerMiddle" XPos="154" YPos="68" Width="8" Height="1" /> + <Image Name="ComboboxDividerRight" XPos="164" YPos="68" Width="14" Height="1" /> + <Image Name="HeaderBarBackdropNormal" XPos="230" YPos="163" Width="10" Height="12" /> + <Image Name="HeaderBarBackdropHover" XPos="230" YPos="163" Width="10" Height="12" /> + <Image Name="HeaderBarSplitterNormal" XPos="225" YPos="92" Width="3" Height="16" /> + <Image Name="HeaderBarSplitterHover" XPos="200" YPos="92" Width="3" Height="16" /> + <Image Name="HeaderBarSortUp" XPos="233" YPos="178" Width="8" Height="8" /> + <Image Name="HeaderBarSortDown" XPos="244" YPos="178" Width="8" Height="8" /> + <Image Name="MultiListLeft" XPos="170" YPos="92" Width="7" Height="6" /> + <Image Name="MultiListRight" XPos="191" YPos="92" Width="7" Height="6" /> + <Image Name="MultiListTop" XPos="181" YPos="81" Width="6" Height="7" /> + <Image Name="MultiListBottom" XPos="181" YPos="102" Width="6" Height="7" /> + <Image Name="MultiListTopLeft" XPos="170" YPos="81" Width="7" Height="7" /> + <Image Name="MultiListTopRight" XPos="191" YPos="81" Width="7" Height="7" /> + <Image Name="MultiListBottomLeft" XPos="170" YPos="102" Width="7" Height="7" /> + <Image Name="MultiListBottomRight" XPos="191" YPos="102" Width="7" Height="7" /> + <Image Name="MultiListBackdrop" XPos="181" YPos="92" Width="6" Height="6" /> + <Image Name="MultiListSelectionBrush" XPos="9" YPos="71" Width="14" Height="14" /> + <Image Name="AltProgressLeft" XPos="71" YPos="88" Width="8" Height="12" /> + <Image Name="AltProgressMiddle" XPos="81" YPos="88" Width="8" Height="12" /> + <Image Name="AltProgressRight" XPos="91" YPos="88" Width="8" Height="12" /> + <Image Name="AltProgressQuarter" XPos="102" YPos="89" Width="3" Height="4" /> + <Image Name="AltProgressHalf" XPos="109" YPos="89" Width="4" Height="5" /> + <Image Name="AltProgressLight1" XPos="100" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight2" XPos="106" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight3" XPos="112" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight4" XPos="118" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight5" XPos="124" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight6" XPos="130" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight7" XPos="136" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight8" XPos="142" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight9" XPos="148" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight10" XPos="154" YPos="97" Width="4" Height="8" /> + <Image Name="CloseButtonNormal" XPos="41" YPos="128" Width="16" Height="16" /> + <Image Name="CloseButtonHover" XPos="41" YPos="146" Width="16" Height="16" /> + <Image Name="CloseButtonPressed" XPos="41" YPos="164" Width="16" Height="16" /> + <Image Name="NewCloseButtonNormal" XPos="90" YPos="146" Width="10" Height="10" /> + <Image Name="NewCloseButtonHover" XPos="90" YPos="146" Width="10" Height="10" /> + <Image Name="NewCloseButtonPressed" XPos="90" YPos="146" Width="10" Height="10" /> + <Image Name="MultiLineEditboxLeft" XPos="41" YPos="89" Width="6" Height="6" /> + <Image Name="MultiLineEditboxRight" XPos="63" YPos="89" Width="6" Height="6" /> + <Image Name="MultiLineEditboxTop" XPos="52" YPos="78" Width="6" Height="6" /> + <Image Name="MultiLineEditboxBottom" XPos="52" YPos="100" Width="6" Height="6" /> + <Image Name="MultiLineEditboxTopLeft" XPos="41" YPos="78" Width="6" Height="6" /> + <Image Name="MultiLineEditboxTopRight" XPos="63" YPos="78" Width="6" Height="6" /> + <Image Name="MultiLineEditboxBottomLeft" XPos="41" YPos="100" Width="6" Height="6" /> + <Image Name="MultiLineEditboxBottomRight" XPos="63" YPos="100" Width="6" Height="6" /> + <Image Name="MultiLineEditboxBackdrop" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="MultiLineEditboxSelectionBrush" XPos="9" YPos="71" Width="14" Height="14" /> + <Image Name="MouseTarget" XPos="182" YPos="127" Width="17" Height="17" XOffset="-8" YOffset="-8" /> + <Image Name="MouseArrow" XPos="138" YPos="127" Width="31" Height="25" XOffset="0" YOffset="0" /> + <Image Name="MouseMoveCursor" XPos="201" YPos="127" Width="18" Height="18" XOffset="-8" YOffset="-8" /> + <Image Name="MouseNoSoCursor" XPos="221" YPos="127" Width="8" Height="18" XOffset="-3" YOffset="-8" /> + <Image Name="MouseEsWeCursor" XPos="182" YPos="150" Width="18" Height="8" XOffset="-8" YOffset="-3" /> + <Image Name="MouseNeSwCursor" XPos="201" YPos="147" Width="14" Height="14" XOffset="-7" YOffset="-7" /> + <Image Name="MouseNwSeCursor" XPos="230" YPos="126" Width="14" Height="14" XOffset="-7" YOffset="-7" /> + <Image Name="MouseTextBar" XPos="173" YPos="127" Width="7" Height="18" XOffset="-2" YOffset="-9" /> + <Image Name="TabHorizontalFiller" XPos="197" YPos="201" Width="7" Height="1" /> + <Image Name="TabContentPaneUpperLeft" XPos="41" YPos="78" Width="7" Height="7" /> + <Image Name="TabContentPaneUpper" XPos="52" YPos="78" Width="6" Height="7" /> + <Image Name="TabContentPaneUpperRight" XPos="62" YPos="78" Width="7" Height="7" /> + <Image Name="TabContentPaneLeft" XPos="41" YPos="89" Width="7" Height="6" /> + <Image Name="TabContentPaneRight" XPos="62" YPos="89" Width="7" Height="6" /> + <Image Name="TabContentPaneLower" XPos="52" YPos="99" Width="6" Height="7" /> + <Image Name="TabContentPaneLowerLeft" XPos="41" YPos="99" Width="7" Height="7" /> + <Image Name="TabContentPaneLowerRight" XPos="62" YPos="99" Width="7" Height="7" /> + <Image Name="TabContentPaneMiddle" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="TabButtonScrollLeftNormal" XPos="97" YPos="108" Width="16" Height="17" /> + <Image Name="TabButtonScrollRightNormal" XPos="112" YPos="108" Width="16" Height="17" /> + <Image Name="TabButtonScrollLeftHover" XPos="127" YPos="108" Width="16" Height="17" /> + <Image Name="TabButtonScrollRightHover" XPos="142" YPos="108" Width="16" Height="17" /> + <Image Name="TabButtonLeftNormal" XPos="41" YPos="89" Width="7" Height="6" /> + <Image Name="TabButtonRightNormal" XPos="62" YPos="89" Width="7" Height="6" /> + <Image Name="TabButtonUpperNormal" XPos="52" YPos="78" Width="6" Height="7" /> + <Image Name="TabButtonLowerNormal" XPos="52" YPos="99" Width="6" Height="7" /> + <Image Name="TabButtonUpperLeftNormal" XPos="41" YPos="78" Width="7" Height="7" /> + <Image Name="TabButtonUpperLeft2Normal" XPos="186" YPos="164" Width="7" Height="7" /> + <Image Name="TabButtonUpperRightNormal" XPos="62" YPos="78" Width="7" Height="7" /> + <Image Name="TabButtonLowerLeftNormal" XPos="41" YPos="99" Width="7" Height="7" /> + <Image Name="TabButtonLowerRightNormal" XPos="62" YPos="99" Width="7" Height="7" /> + <Image Name="TabButtonLowerRight2Normal" XPos="187" YPos="195" Width="7" Height="7" /> + <Image Name="TabButtonMiddleNormal" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="TabButtonLeftSelected" XPos="41" YPos="89" Width="7" Height="6" /> + <Image Name="TabButtonRightSelected" XPos="62" YPos="89" Width="7" Height="6" /> + <Image Name="TabButtonUpperSelected" XPos="52" YPos="78" Width="6" Height="7" /> + <Image Name="TabButtonLowerSelected" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="TabButtonUpperLeftSelected" XPos="41" YPos="78" Width="7" Height="7" /> + <Image Name="TabButtonUpperRightSelected" XPos="62" YPos="78" Width="7" Height="7" /> + <Image Name="TabButtonLowerLeftSelected" XPos="41" YPos="99" Width="7" Height="7" /> + <Image Name="TabButtonLowerRightSelected" XPos="62" YPos="99" Width="7" Height="7" /> + <Image Name="TabButtonMiddleSelected" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="TooltipTopLeft" XPos="61" YPos="160" Width="4" Height="4" /> + <Image Name="TooltipTopRight" XPos="85" YPos="160" Width="5" Height="4" /> + <Image Name="TooltipBottomLeft" XPos="61" YPos="184" Width="4" Height="5" /> + <Image Name="TooltipBottomRight" XPos="85" YPos="184" Width="5" Height="5" /> + <Image Name="TooltipLeftEdge" XPos="61" YPos="171" Width="4" Height="6" /> + <Image Name="TooltipRightEdge" XPos="85" YPos="171" Width="5" Height="6" /> + <Image Name="TooltipTopEdge" XPos="72" YPos="160" Width="6" Height="4" /> + <Image Name="TooltipBottomEdge" XPos="72" YPos="184" Width="6" Height="5" /> + <Image Name="TooltipMiddle" XPos="72" YPos="171" Width="6" Height="6" /> + <Image Name="MenuTopLeft" XPos="166" YPos="204" Width="2" Height="2" /> + <Image Name="MenuTopRight" XPos="175" YPos="204" Width="3" Height="2" /> + <Image Name="MenuBottomLeft" XPos="166" YPos="213" Width="2" Height="3" /> + <Image Name="MenuBottomRight" XPos="175" YPos="213" Width="3" Height="3" /> + <Image Name="MenuLeft" XPos="166" YPos="209" Width="2" Height="1" /> + <Image Name="MenuRight" XPos="175" YPos="209" Width="3" Height="1" /> + <Image Name="MenuTop" XPos="171" YPos="204" Width="1" Height="2" /> + <Image Name="MenuBottom" XPos="171" YPos="213" Width="1" Height="3" /> + <Image Name="MenuMiddle" XPos="171" YPos="209" Width="1" Height="1" /> + <Image Name="PopupMenuFrameTopLeft" XPos="186" YPos="204" Width="2" Height="2" /> + <Image Name="PopupMenuFrameTopRight" XPos="195" YPos="204" Width="4" Height="2" /> + <Image Name="PopupMenuFrameBottomLeft" XPos="186" YPos="213" Width="2" Height="4" /> + <Image Name="PopupMenuFrameBottomRight" XPos="195" YPos="213" Width="4" Height="4" /> + <Image Name="PopupMenuFrameLeft" XPos="186" YPos="209" Width="2" Height="1" /> + <Image Name="PopupMenuFrameRight" XPos="195" YPos="209" Width="4" Height="1" /> + <Image Name="PopupMenuFrameTop" XPos="191" YPos="204" Width="1" Height="2" /> + <Image Name="PopupMenuFrameBottom" XPos="191" YPos="213" Width="1" Height="4" /> + <Image Name="PopupMenuMiddle" XPos="191" YPos="209" Width="1" Height="1" /> + <Image Name="PopupMenuArrowRight" XPos="179" YPos="204" Width="5" Height="5" /> + <Image Name="PopupMenuArrowLeft" XPos="179" YPos="210" Width="5" Height="5" /> +</Imageset> Copied: trunk/yake/common/media/gui/imagesets/TaharezLook.tga (from rev 1905, branches/v0-7-0/yake/common/media/gui/imagesets/TaharezLook.tga) =================================================================== (Binary files differ) Copied: trunk/yake/common/media/gui/looknfeel/TaharezLook.looknfeel (from rev 1905, branches/v0-7-0/yake/common/media/gui/looknfeel/TaharezLook.looknfeel) =================================================================== --- trunk/yake/common/media/gui/looknfeel/TaharezLook.looknfeel (rev 0) +++ trunk/yake/common/media/gui/looknfeel/TaharezLook.looknfeel 2007-12-12 21:48:34 UTC (rev 1906) @@ -0,0 +1,4315 @@ +<?xml version="1.0" ?> +<Falagard> + <!-- + *************************************************** + TaharezLook/Button + *************************************************** + --> + <WidgetLook name="TaharezLook/Button"> + <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" /> + <PropertyDefinition name="VertLabelFormatting" initialValue="CentreAligned" /> + <PropertyDefinition name="HorzLabelFormatting" initialValue="CentreAligned" /> + <PropertyDefinition name="NormalImage" initialValue="" redrawOnWrite="true" /> + <PropertyDefinition name="HoverImage" initialValue="" redrawOnWrite="true" /> + <PropertyDefinition name="PushedImage" initialValue="" redrawOnWrite="true" /> + <PropertyDefinition name="DisabledImage" initialValue="" redrawOnWrite="true" /> + <PropertyDefinition name="VertImageFormatting" initialValue="Stretched" redrawOnWrite="true" /> + <PropertyDefinition name="HorzImageFormatting" initialValue="Stretched" redrawOnWrite="true" /> + <ImagerySection name="label"> + <TextComponent> + <Area> + <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim> + <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <VertFormatProperty name="VertLabelFormatting" /> + <HorzFormatProperty name="HorzLabelFormatting" /> + </TextComponent> + </ImagerySection> + <ImagerySection name="normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim> + <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftNormal" /> + <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightNormal" /> + <Image type="Background" imageset="TaharezLook" image="ButtonMiddleNormal" /> + </FrameComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <ImageProperty name="NormalImage" /> + <VertFormatProperty name="VertImageFormatting" /> + <HorzFormatProperty name="HorzImageFormatting" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="hover"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftHighlight" /> + <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightHighlight" /> + <Image type="Background" imageset="TaharezLook" image="ButtonMiddleHighlight" /> + </FrameComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <ImageProperty name="HoverImage" /> + <VertFormatProperty name="VertImageFormatting" /> + <HorzFormatProperty name="HorzImageFormatting" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="pushed"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftPushed" /> + <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightPushed" /> + <Image type="Background" imageset="TaharezLook" image="ButtonMiddlePushed" /> + </FrameComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <ImageProperty name="PushedImage" /> + <VertFormatProperty name="VertImageFormatting" /> + <HorzFormatProperty name="HorzImageFormatting" /> + </ImageryComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + <Section section="label"> + <ColourProperty name="NormalTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + <Section section="label"> + <ColourProperty name="HoverTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Pushed"> + <Layer> + <Section section="pushed" /> + <Section section="label"> + <ColourProperty name="PushedTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="PushedOff"> + <Layer> + <Section section="hover" /> + <Section section="label"> + <ColourProperty name="HoverTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="label"> + <ColourProperty name="DisabledTextColour" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + TaharezLook/RadioButton + *************************************************** + --> + <WidgetLook name="TaharezLook/RadioButton"> + <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" /> + <ImagerySection name="label"> + <TextComponent> + <Area> + <Dim type="LeftEdge" > + <ImageDim imageset="TaharezLook" image="RadioButtonNormal" dimension="Width"> + <DimOperator op="Add"> + <AbsoluteDim value="3" /> + </DimOperator> + </ImageDim> + </Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </TextComponent> + </ImagerySection> + <ImagerySection name="normal"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="RadioButtonNormal" /> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="hover"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="RadioButtonHover" /> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="select_mark"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="RadioButtonMark" /> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </ImageryComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + <Section section="label"> + <ColourProperty name="NormalTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + <Section section="label"> + <ColourProperty name="HoverTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="label"> + <ColourProperty name="DisabledTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="SelectedNormal"> + <Layer> + <Section section="normal" /> + <Section section="select_mark" /> + <Section section="label"> + <ColourProperty name="NormalTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="SelectedHover"> + <Layer> + <Section section="hover" /> + <Section section="select_mark" /> + <Section section="label"> + <ColourProperty name="HoverTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="SelectedDisabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="select_mark"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="label"> + <ColourProperty name="DisabledTextColour" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + TaharezLook/Checkbox + *************************************************** + --> + <WidgetLook name="TaharezLook/Checkbox"> + <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" /> + <ImagerySection name="label"> + <TextComponent> + <Area> + <Dim type="LeftEdge" > + <ImageDim imageset="TaharezLook" image="CheckboxNormal" dimension="Width"> + <DimOperator op="Add"> + <AbsoluteDim value="3" /> + </DimOperator> + </ImageDim> + </Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </TextComponent> + </ImagerySection> + <ImagerySection name="normal"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="CheckboxNormal" /> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="hover"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="CheckboxHover" /> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="select_mark"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="CheckboxMark" /> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </ImageryComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + <Section section="label"> + <ColourProperty name="NormalTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + <Section section="label"> + <ColourProperty name="HoverTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="label"> + <ColourProperty name="DisabledTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="SelectedNormal"> + <Layer> + <Section section="normal" /> + <Section section="select_mark" /> + <Section section="label"> + <ColourProperty name="NormalTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="SelectedHover"> + <Layer> + <Section section="hover" /> + <Section section="select_mark" /> + <Section section="label"> + <ColourProperty name="HoverTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="SelectedDisabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="select_mark"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="label"> + <ColourProperty name="DisabledTextColour" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + TaharezLook/Editbox + *************************************************** + --> + <WidgetLook name="TaharezLook/Editbox"> + <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" /> + <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" /> + <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" /> + <Property name="MouseCursorImage" value="set:TaharezLook image:MouseTextBar" /> + <NamedArea name="TextArea"> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="5" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-5" type="BottomEdge" /></Dim> + </Area> + </NamedArea> + <ImagerySection name="container_normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="TaharezLook" image="EditBoxLeft" /> + <Image type="RightEdge" imageset="TaharezLook" image="EditBoxRight" /> + <Image type="Background" imageset="TaharezLook" image="EditBoxMiddle" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="selection"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim> + </Area> + <Image imageset="TaharezLook" image="TextSelectionBrush" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="Carat"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><ImageDim imageset="TaharezLook" image="EditBoxCarat" dimension="Width" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim> + </Area> + <Image imageset="TaharezLook" image="EditBoxCarat" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> + <StateImagery name="Enabled"> + <Layer> + <Section section="container_normal" /> + </Layer> + </StateImagery> + <StateImagery name="ReadOnly"> + <Layer> + <Section section="container_normal" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="container_normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="ActiveSelection"> + <Layer> + <Section section="selection"> + <ColourProperty name="ActiveSelectionColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="InactiveSelection"> + <Layer> + <Section section="selection"> + <ColourProperty name="InactiveSelectionColour" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + TaharezLook/Titlebar + *************************************************** + --> + <WidgetLook name="TaharezLook/Titlebar"> + <PropertyDefinition name="CaptionColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <ImagerySection name="main"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="NewTitlebarLeft" /> + <VertFormat type="Stretched" /> + </ImageryComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width"> + <DimOperator op="Add"> + <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width" /> + </DimOperator> + </ImageDim> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="NewTitlebarRight" /> + <VertFormat type="Stretched" /> + <HorzFormat type="RightAligned" /> + </ImageryComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width" /> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="SysAreaMiddle" /> + <VertFormat type="Stretched" /> + <HorzFormat type="RightAligned" /> + </ImageryComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="SysAreaRight" /> + <VertFormat type="Stretched" /> + <HorzFormat type="RightAligned" /> + </ImageryComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="NewTitlebarLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width"> + <DimOperator op="Add"> + <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width"> + <DimOperator op="Add"> + <ImageDim imageset="TaharezLook" image="NewTitlebarRight" dimension="Width" /> + </DimOperator> + </ImageDim> + </DimOperator> + </ImageDim> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="NewTitlebarMiddle" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="caption"> + <TextComponent> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="NewTitlebarLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" offset="-75" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <ColourProperty name="CaptionColour" /> + <VertFormat type="CentreAligned" /> + </TextComponent> + </ImagerySection> + <StateImagery name="Active"> + <Layer> + <Section section="main" /> + <Section section="caption" /> + </Layer> + </StateImagery> + <StateImagery name="Inactive"> + <Layer> + <Section section="main" /> + <Section section="caption" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="main"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="caption"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + TaharezLook/FrameWindow + *************************************************** + --> + <WidgetLook name="TaharezLook/FrameWindow"> + <PropertyLinkDefinition name="CaptionColour" widget="__auto_titlebar__" targetProperty="CaptionColour" initialValue="FFFFFFFF" /> + <PropertyLinkDefinition name="TitlebarFont" widget="__auto_titlebar__" targetProperty="Font" /> + <Property name="NSSizingCursorImage" value="set:TaharezLook image:MouseNoSoCursor" /> + <Property name="EWSizingCursorImage" value="set:TaharezLook image:MouseEsWeCursor" /> + <Property name="NWSESizingCursorImage" value="set:TaharezLook image:MouseNwSeCursor" /> + <Property name="NESWSizingCursorImage" value="set:TaharezLook image:MouseNeSwCursor" /> + <NamedArea name="ClientWithTitleWithFrame"> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="WindowTopLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="WindowTopRight" dimension="Width" /> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="BottomEdge" > + <UnifiedDim scale="1" type="BottomEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="WindowBottomEdge" dimension="Height" /> + </DimOperator> + </UnifiedDim> + </Dim> + </Area> + </NamedArea> + <NamedArea name="ClientWithTitleNoFrame"> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="BottomEdge" ><WidgetDim dimension="BottomEdge" /></Dim> + </Area> + </NamedArea> + <NamedArea name="ClientNoTitleWithFrame"> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="WindowTopLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="WindowTopEdge" dimension="Height" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="WindowTopRight" dimension="Width" /> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="BottomEdge" > + <UnifiedDim scale="1" type="BottomEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="WindowBottomEdge" dimension="Height" /> + </DimOperator> + </UnifiedDim> + </Dim> + </Area> + </NamedArea> + <NamedArea name="ClientNoTitleNoFrame"> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + </NamedArea> + <Child type="TaharezLook/Titlebar" nameSuffix="__auto_titlebar__"> + <Area> + <... [truncated message content] |
From: <psy...@us...> - 2007-12-11 23:00:53
|
Revision: 1905 http://yake.svn.sourceforge.net/yake/?rev=1905&view=rev Author: psyclonist Date: 2007-12-11 15:00:58 -0800 (Tue, 11 Dec 2007) Log Message: ----------- * [build] added missing library references in premake scripts (thx to cdkeito) Modified Paths: -------------- branches/v0-7-0/yake/scripts/premake/samples.lua Modified: branches/v0-7-0/yake/scripts/premake/samples.lua =================================================================== --- branches/v0-7-0/yake/scripts/premake/samples.lua 2007-12-11 22:56:23 UTC (rev 1904) +++ branches/v0-7-0/yake/scripts/premake/samples.lua 2007-12-11 23:00:58 UTC (rev 1905) @@ -47,6 +47,7 @@ useComponent("scripting") useComponent("ent") useComponent("bindings.lua") + useComponent("res") useDep("lua") useDep("luabind") end @@ -102,6 +103,7 @@ sampleUsesConsole() useComponent("base") useComponent("res") + useComponent("raf") useComponent("bindings.lua") useDep("lua") useDep("luabind") @@ -130,6 +132,9 @@ useComponent("base") useComponent("raf") useComponent("bindings.lua") + useComponent("input") + useComponent("ent") + useComponent("scriptingLua") useDep("lua") useDep("luabind") @@ -138,6 +143,9 @@ useComponent("base") useComponent("raf") useComponent("bindings.lua") + useComponent("input") + useComponent("ent") + useComponent("scriptingLua") useDep("lua") useDep("luabind") end @@ -174,6 +182,7 @@ useComponent("scripting") useComponent("bindings.lua") useComponent("scriptingLua") + useComponent("res") useDep("lua") useDep("luabind") end @@ -243,6 +252,7 @@ sampleUsesConsole() useComponent("base") useComponent("scripting") + useComponent("res") useComponent("bindings.lua") end @@ -262,7 +272,8 @@ useComponent("scripting") useComponent("bindings.lua") -- <- This resolved all deps of bindings.lua, too! useComponent("scriptingLua") - useDep("lua") + useComponent("res") + useDep("lua") useDep("luabind") end end This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-12-11 22:56:18
|
Revision: 1904 http://yake.svn.sourceforge.net/yake/?rev=1904&view=rev Author: psyclonist Date: 2007-12-11 14:56:23 -0800 (Tue, 11 Dec 2007) Log Message: ----------- * [demo] disabled cegui and cmdrmayhem demos for this released. they will be completely revamped for 0.8 Modified Paths: -------------- branches/v0-7-0/yake/scripts/premake/samples.lua Modified: branches/v0-7-0/yake/scripts/premake/samples.lua =================================================================== --- branches/v0-7-0/yake/scripts/premake/samples.lua 2007-12-11 22:55:29 UTC (rev 1903) +++ branches/v0-7-0/yake/scripts/premake/samples.lua 2007-12-11 22:56:23 UTC (rev 1904) @@ -81,6 +81,7 @@ end -------------------------------------- +--[[ if PLUGIN_GRAPHICS_OGRE then makeSample("sampleCmdrMayhem","samples/cmdrmayhem") useComponent("base") @@ -91,6 +92,7 @@ useComponent("raf") useDep("cegui") end +--]] -------------------------------------- --if SAMPLES_RES then @@ -142,6 +144,7 @@ end -------------------------------------- +--[[ if PLUGIN_GRAPHICS_OGRE then makeSample("sampleGuiConsole","samples/gui/console") useComponent("base") @@ -156,6 +159,7 @@ useDep("lua") useDep("luabind") end +--]] -------------------------------------- makeSample("sampleProperty1","samples/property/demo1") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-12-11 22:55:26
|
Revision: 1903 http://yake.svn.sourceforge.net/yake/?rev=1903&view=rev Author: psyclonist Date: 2007-12-11 14:55:29 -0800 (Tue, 11 Dec 2007) Log Message: ----------- * [demo] fixed sampleCmdrMayhem * [media] updated materials Modified Paths: -------------- branches/v0-7-0/yake/samples/cmdrmayhem/yakeDemo.cpp Added Paths: ----------- branches/v0-7-0/yake/common/media/graphics.materials/scripts/yake.material Added: branches/v0-7-0/yake/common/media/graphics.materials/scripts/yake.material =================================================================== --- branches/v0-7-0/yake/common/media/graphics.materials/scripts/yake.material (rev 0) +++ branches/v0-7-0/yake/common/media/graphics.materials/scripts/yake.material 2007-12-11 22:55:29 UTC (rev 1903) @@ -0,0 +1,44 @@ +material blue_translucent +{ + receive_shadows off + technique + { + pass + { + //lighting off + + // alpha=opacity (1.=opaque,0=transparent) + diffuse .2 .2 1 0.6 + ambient 1 1 1 + //specular 1 1 1 + depth_write off + //depth_check off + + //scene_blend modulate + scene_blend alpha_blend + //scene_blend modulate + } + } +} +material red_translucent +{ + receive_shadows off + technique + { + pass + { + //lighting off + + // alpha=opacity (1.=opaque,0=transparent) + diffuse 1 0 0 0.6 + ambient 1 1 1 + //specular 1 1 1 + depth_write off + //depth_check off + + //scene_blend modulate + scene_blend alpha_blend + //scene_blend modulate + } + } +} Modified: branches/v0-7-0/yake/samples/cmdrmayhem/yakeDemo.cpp =================================================================== --- branches/v0-7-0/yake/samples/cmdrmayhem/yakeDemo.cpp 2007-12-11 22:53:31 UTC (rev 1902) +++ branches/v0-7-0/yake/samples/cmdrmayhem/yakeDemo.cpp 2007-12-11 22:55:29 UTC (rev 1903) @@ -13,7 +13,7 @@ #include <CEGUIString.h> #endif -#define DEMO_USES_SPHERE +//#define DEMO_USES_SPHERE using namespace yake; @@ -333,7 +333,7 @@ // newUp = gravity_source to position #ifdef DEMO_USES_SPHERE - const Vector3 newGravityVector = (Vector3::kZero/*source of gravity*/ - mPlayerRep->getPosition()).normalisedCopy(); + const Vector3 newGravityVector = (Point3::kZero/*source of gravity*/ - mPlayerRep->getPosition()).normalisedCopy(); mPlayerRep->setGravityDirection( newGravityVector ); #else mPlayerRep->setGravityDirection( Vector3(0,1,0) ); @@ -694,7 +694,10 @@ class TheApp : public raf::ExampleApplication<TheConfiguration> { public: - TheApp() {} + TheApp() + { + getConfiguration().get().load("sampleCmdrMayhem.cfg"); + } protected: virtual raf::MainState* createMainState() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-12-11 22:53:27
|
Revision: 1902 http://yake.svn.sourceforge.net/yake/?rev=1902&view=rev Author: psyclonist Date: 2007-12-11 14:53:31 -0800 (Tue, 11 Dec 2007) Log Message: ----------- * [demo] added cfg files Added Paths: ----------- branches/v0-7-0/yake/samples/bin/debug/sampleCmdrMayhem.cfg branches/v0-7-0/yake/samples/bin/release/sampleCmdrMayhem.cfg Added: branches/v0-7-0/yake/samples/bin/debug/sampleCmdrMayhem.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/debug/sampleCmdrMayhem.cfg (rev 0) +++ branches/v0-7-0/yake/samples/bin/debug/sampleCmdrMayhem.cfg 2007-12-11 22:53:31 UTC (rev 1902) @@ -0,0 +1,18 @@ +[resource.sources] # <- evaluated by RAF +file=../../../common/media/scripts/ # <- do NOT forget trialing '/' !! + +#----------------------------------- +[raf.startup.libraries] +# Libraries to be loaded automatically at startup + +graphicsOgre +inputOgreOIS +physicsODE + +#----------------------------------- +[raf.startup.systems] +# System to be created & initialized automatically + +graphics=ogre3d +input=ois +physics=ode Added: branches/v0-7-0/yake/samples/bin/release/sampleCmdrMayhem.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/release/sampleCmdrMayhem.cfg (rev 0) +++ branches/v0-7-0/yake/samples/bin/release/sampleCmdrMayhem.cfg 2007-12-11 22:53:31 UTC (rev 1902) @@ -0,0 +1,18 @@ +[resource.sources] # <- evaluated by RAF +file=../../../common/media/scripts/ # <- do NOT forget trialing '/' !! + +#----------------------------------- +[raf.startup.libraries] +# Libraries to be loaded automatically at startup + +graphicsOgre +inputOgreOIS +physicsODE + +#----------------------------------- +[raf.startup.systems] +# System to be created & initialized automatically + +graphics=ogre3d +input=ois +physics=ode This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-12-11 22:45:23
|
Revision: 1901 http://yake.svn.sourceforge.net/yake/?rev=1901&view=rev Author: psyclonist Date: 2007-12-11 14:45:26 -0800 (Tue, 11 Dec 2007) Log Message: ----------- * [media] added missing cegui related files Added Paths: ----------- branches/v0-7-0/yake/common/media/gui/imagesets/Imageset.xsd branches/v0-7-0/yake/common/media/gui/imagesets/TaharezLook.imageset branches/v0-7-0/yake/common/media/gui/imagesets/TaharezLook.tga branches/v0-7-0/yake/common/media/gui/looknfeel/TaharezLook.looknfeel branches/v0-7-0/yake/common/media/gui/schemes/GUIScheme.xsd branches/v0-7-0/yake/common/media/gui/schemes/TaharezLookSkin.scheme branches/v0-7-0/yake/common/media/gui/schemes/TaharezLookWidgetAliases.scheme Added: branches/v0-7-0/yake/common/media/gui/imagesets/Imageset.xsd =================================================================== --- branches/v0-7-0/yake/common/media/gui/imagesets/Imageset.xsd (rev 0) +++ branches/v0-7-0/yake/common/media/gui/imagesets/Imageset.xsd 2007-12-11 22:45:26 UTC (rev 1901) @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> + + <xsd:element name="Imageset" type="ImagesetType"/> + + <xsd:complexType name="ImagesetType"> + <xsd:sequence> + <xsd:element name="Image" type="ImageType" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="Imagefile" type="xsd:string" use="required"/> + <xsd:attribute name="ResourceGroup" type="xsd:string" use="optional" default="" /> + <xsd:attribute name="Name" type="xsd:string" use="required"/> + <xsd:attribute name="NativeHorzRes" type="xsd:nonNegativeInteger" use="optional" default="640" /> + <xsd:attribute name="NativeVertRes" type="xsd:nonNegativeInteger" use="optional" default="480" /> + <xsd:attribute name="AutoScaled" type="xsd:boolean" use="optional" default="false" /> + </xsd:complexType> + + <xsd:complexType name="ImageType"> + <xsd:attribute name="Name" type="xsd:string" use="required"/> + <xsd:attribute name="XPos" type="xsd:nonNegativeInteger" use="required"/> + <xsd:attribute name="YPos" type="xsd:nonNegativeInteger" use="required"/> + <xsd:attribute name="Width" type="xsd:nonNegativeInteger" use="required"/> + <xsd:attribute name="Height" type="xsd:nonNegativeInteger" use="required"/> + <xsd:attribute name="XOffset" type="xsd:integer" use="optional" default="0"/> + <xsd:attribute name="YOffset" type="xsd:integer" use="optional" default="0"/> + </xsd:complexType> + +</xsd:schema> Added: branches/v0-7-0/yake/common/media/gui/imagesets/TaharezLook.imageset =================================================================== --- branches/v0-7-0/yake/common/media/gui/imagesets/TaharezLook.imageset (rev 0) +++ branches/v0-7-0/yake/common/media/gui/imagesets/TaharezLook.imageset 2007-12-11 22:45:26 UTC (rev 1901) @@ -0,0 +1,242 @@ +<?xml version="1.0" ?> +<Imageset Name="TaharezLook" Imagefile="TaharezLook.tga" NativeHorzRes="800" NativeVertRes="600" AutoScaled="true"> + <Image Name="ClientBrush" XPos="2" YPos="2" Width="64" Height="64" /> + <Image Name="WindowLeftEdge" XPos="6" YPos="95" Width="1" Height="22" XOffset="4" /> + <Image Name="WindowRightEdge" XPos="34" YPos="95" Width="1" Height="22" XOffset="-5" /> + <Image Name="WindowTopEdge" XPos="9" YPos="68" Width="23" Height="1" /> + <Image Name="WindowBottomEdge" XPos="9" YPos="143" Width="23" Height="1" /> + <Image Name="WindowTopLeft" XPos="2" YPos="68" Width="5" Height="24" /> + <Image Name="WindowTopRight" XPos="34" YPos="68" Width="5" Height="24" /> + <Image Name="WindowBottomLeft" XPos="2" YPos="120" Width="5" Height="24" /> + <Image Name="WindowBottomRight" XPos="34" YPos="120" Width="5" Height="24" /> + <Image Name="ButtonLeftNormal" XPos="68" YPos="20" Width="12" Height="16" /> + <Image Name="ButtonMiddleNormal" XPos="82" YPos="20" Width="12" Height="16" /> + <Image Name="ButtonRightNormal" XPos="96" YPos="20" Width="12" Height="16" /> + <Image Name="ButtonLeftPushed" XPos="68" YPos="38" Width="12" Height="16" /> + <Image Name="ButtonMiddlePushed" XPos="82" YPos="38" Width="12" Height="16" /> + <Image Name="ButtonRightPushed" XPos="96" YPos="38" Width="12" Height="16" /> + <Image Name="ButtonLeftHighlight" XPos="68" YPos="56" Width="12" Height="16" /> + <Image Name="ButtonMiddleHighlight" XPos="82" YPos="56" Width="12" Height="16" /> + <Image Name="ButtonRightHighlight" XPos="96" YPos="56" Width="12" Height="16" /> + <Image Name="CheckboxNormal" XPos="110" YPos="2" Width="12" Height="12" /> + <Image Name="CheckboxHover" XPos="110" YPos="30" Width="12" Height="12" /> + <Image Name="CheckboxMark" XPos="110" YPos="16" Width="12" Height="12" /> + <Image Name="RadioButtonNormal" XPos="124" YPos="2" Width="12" Height="12" /> + <Image Name="RadioButtonHover" XPos="124" YPos="30" Width="12" Height="12" /> + <Image Name="RadioButtonMark" XPos="124" YPos="16" Width="12" Height="12" /> + <Image Name="TitlebarLeft" XPos="68" YPos="2" Width="8" Height="16" /> + <Image Name="TitlebarMiddle" XPos="78" YPos="2" Width="8" Height="16" /> + <Image Name="TitlebarRight" XPos="88" YPos="2" Width="8" Height="16" /> + <Image Name="NewTitlebarLeft" XPos="61" YPos="127" Width="13" Height="16" /> + <Image Name="NewTitlebarMiddle" XPos="77" YPos="127" Width="12" Height="16" /> + <Image Name="NewTitlebarRight" XPos="92" YPos="127" Width="12" Height="16" /> + <Image Name="SysAreaMiddle" XPos="107" YPos="127" Width="12" Height="16" /> + <Image Name="SysAreaRight" XPos="122" YPos="127" Width="13" Height="16" /> + <Image Name="StaticLeft" XPos="41" YPos="89" Width="6" Height="6" /> + <Image Name="StaticRight" XPos="63" YPos="89" Width="6" Height="6" /> + <Image Name="StaticTop" XPos="52" YPos="78" Width="6" Height="6" /> + <Image Name="StaticBottom" XPos="52" YPos="100" Width="6" Height="6" /> + <Image Name="StaticTopLeft" XPos="41" YPos="78" Width="6" Height="6" /> + <Image Name="StaticTopRight" XPos="63" YPos="78" Width="6" Height="6" /> + <Image Name="StaticBottomLeft" XPos="41" YPos="100" Width="6" Height="6" /> + <Image Name="StaticBottomRight" XPos="63" YPos="100" Width="6" Height="6" /> + <Image Name="StaticBackdrop" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="ProgressBarLeft" XPos="71" YPos="74" Width="7" Height="12" /> + <Image Name="ProgressBarMiddle" XPos="80" YPos="74" Width="6" Height="12" /> + <Image Name="ProgressBarRight" XPos="88" YPos="74" Width="6" Height="12" /> + <Image Name="ProgressBarDimSegment" XPos="96" YPos="74" Width="8" Height="12" /> + <Image Name="ProgressBarLitSegment" XPos="106" YPos="74" Width="8" Height="12" /> + <Image Name="EditBoxLeft" XPos="41" YPos="108" Width="4" Height="18" /> + <Image Name="EditBoxMiddle" XPos="47" YPos="108" Width="4" Height="18" /> + <Image Name="EditBoxRight" XPos="53" YPos="108" Width="4" Height="18" /> + <Image Name="EditBoxCarat" XPos="60" YPos="108" Width="4" Height="18" /> + <Image Name="SpinnerUpNormal" XPos="68" YPos="110" Width="10" Height="6" /> + <Image Name="SpinnerDownNormal" XPos="68" YPos="118" Width="10" Height="6" /> + <Image Name="SpinnerUpHover" XPos="82" YPos="110" Width="10" Height="6" /> + <Image Name="SpinnerDownHover" XPos="82" YPos="118" Width="10" Height="6" /> + <Image Name="TextSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" /> + <Image Name="VertScrollTop" XPos="182" YPos="2" Width="20" Height="8" /> + <Image Name="VertScrollMiddle" XPos="182" YPos="12" Width="20" Height="8" /> + <Image Name="VertScrollBottom" XPos="182" YPos="22" Width="20" Height="8" /> + <Image Name="VertScrollBarSegment" XPos="206" YPos="2" Width="4" Height="10" /> + <Image Name="VertScrollThumbNormal" XPos="214" YPos="2" Width="8" Height="24" /> + <Image Name="VertScrollThumbHover" XPos="224" YPos="2" Width="8" Height="24" /> + <Image Name="VertScrollUpNormal" XPos="196" YPos="32" Width="12" Height="12" /> + <Image Name="VertScrollDownNormal" XPos="182" YPos="32" Width="12" Height="12" /> + <Image Name="VertScrollUpHover" XPos="196" YPos="46" Width="12" Height="12" /> + <Image Name="VertScrollDownHover" XPos="182" YPos="46" Width="12" Height="12" /> + <Image Name="MiniVertScrollBarSegment" XPos="207" YPos="60" Width="4" Height="10" /> + <Image Name="MiniVertScrollThumbNormal" XPos="214" YPos="59" Width="7" Height="22" /> + <Image Name="MiniVertScrollThumbTopNormal" XPos="214" YPos="59" Width="7" Height="5" /> + <Image Name="MiniVertScrollThumbMiddleNormal" XPos="214" YPos="65" Width="7" Height="5" /> + <Image Name="MiniVertScrollThumbBottomNormal" XPos="214" YPos="76" Width="7" Height="5" /> + <Image Name="MiniVertScrollThumbTopHover" XPos="223" YPos="59" Width="7" Height="5" /> + <Image Name="MiniVertScrollThumbMiddleHover" XPos="223" YPos="65" Width="7" Height="5" /> + <Image Name="MiniVertScrollThumbBottomHover" XPos="223" YPos="76" Width="7" Height="5" /> + <Image Name="MiniVertScrollThumbHover" XPos="223" YPos="59" Width="7" Height="22" /> + <Image Name="MiniVertScrollUpNormal" XPos="194" YPos="60" Width="10" Height="9" /> + <Image Name="MiniVertScrollDownNormal" XPos="182" YPos="59" Width="10" Height="9" /> + <Image Name="MiniVertScrollUpHover" XPos="194" YPos="70" Width="10" Height="9" /> + <Image Name="MiniVertScrollDownHover" XPos="182" YPos="69" Width="10" Height="9" /> + <Image Name="VertSliderBody" XPos="234" YPos="2" Width="9" Height="48" /> + <Image Name="VertSliderThumbNormal" XPos="217" YPos="28" Width="15" Height="6" /> + <Image Name="VertSliderThumbHover" XPos="217" YPos="36" Width="15" Height="6" /> + <Image Name="MiniHorzScrollBarSegment" XPos="244" YPos="80" Width="10" Height="4" /> + <Image Name="MiniHorzScrollThumbNormal" XPos="233" YPos="87" Width="22" Height="7" /> + <Image Name="MiniHorzScrollThumbLeftNormal" XPos="233" YPos="87" Width="5" Height="7" /> + <Image Name="MiniHorzScrollThumbMiddleNormal" XPos="239" YPos="87" Width="5" Height="7" /> + <Image Name="MiniHorzScrollThumbRightNormal" XPos="250" YPos="87" Width="5" Height="7" /> + <Image Name="MiniHorzScrollThumbHover" XPos="233" YPos="96" Width="22" Height="7" /> + <Image Name="MiniHorzScrollThumbLeftHover" XPos="233" YPos="96" Width="5" Height="7" /> + <Image Name="MiniHorzScrollThumbMiddleHover" XPos="239" YPos="96" Width="5" Height="7" /> + <Image Name="MiniHorzScrollThumbRightHover" XPos="250" YPos="96" Width="5" Height="7" /> + <Image Name="MiniHorzScrollLeftNormal" XPos="246" YPos="55" Width="9" Height="10" /> + <Image Name="MiniHorzScrollRightNormal" XPos="245" YPos="67" Width="9" Height="10" /> + <Image Name="MiniHorzScrollLeftHover" XPos="236" YPos="55" Width="9" Height="10" /> + <Image Name="MiniHorzScrollRightHover" XPos="235" YPos="67" Width="9" Height="10" /> + <Image Name="ListboxLeft" XPos="41" YPos="89" Width="7" Height="6" /> + <Image Name="ListboxRight" XPos="62" YPos="89" Width="7" Height="6" /> + <Image Name="ListboxTop" XPos="52" YPos="78" Width="6" Height="7" /> + <Image Name="ListboxBottom" XPos="52" YPos="99" Width="6" Height="7" /> + <Image Name="ListboxTopLeft" XPos="41" YPos="78" Width="7" Height="7" /> + <Image Name="ListboxTopRight" XPos="62" YPos="78" Width="7" Height="7" /> + <Image Name="ListboxBottomLeft" XPos="41" YPos="99" Width="7" Height="7" /> + <Image Name="ListboxBottomRight" XPos="62" YPos="99" Width="7" Height="7" /> + <Image Name="ListboxBackdrop" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="ListboxSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" /> + <Image Name="ComboboxEditLeft" XPos="138" YPos="2" Width="8" Height="16" /> + <Image Name="ComboboxEditMiddle" XPos="148" YPos="2" Width="8" Height="16" /> + <Image Name="ComboboxListButtonNormal" XPos="158" YPos="2" Width="16" Height="16" /> + <Image Name="ComboboxListButtonHover" XPos="158" YPos="20" Width="16" Height="16" /> + <Image Name="ComboboxListLeft" XPos="138" YPos="48" Width="8" Height="8" /> + <Image Name="ComboboxListRight" XPos="158" YPos="48" Width="8" Height="8" /> + <Image Name="ComboboxListTop" XPos="148" YPos="48" Width="8" Height="8" /> + <Image Name="ComboboxListBottom" XPos="148" YPos="58" Width="8" Height="8" /> + <Image Name="ComboboxListTopLeft" XPos="138" YPos="38" Width="8" Height="8" /> + <Image Name="ComboboxListTopRight" XPos="158" YPos="38" Width="8" Height="8" /> + <Image Name="ComboboxListBottomLeft" XPos="138" YPos="58" Width="8" Height="8" /> + <Image Name="ComboboxListBottomRight" XPos="158" YPos="58" Width="8" Height="8" /> + <Image Name="ComboboxListBackdrop" XPos="148" YPos="48" Width="8" Height="8" /> + <Image Name="ComboboxSelectionBrush" XPos="8" YPos="70" Width="16" Height="16" /> + <Image Name="ComboboxDividerLeft" XPos="138" YPos="68" Width="14" Height="1" /> + <Image Name="ComboboxDividerMiddle" XPos="154" YPos="68" Width="8" Height="1" /> + <Image Name="ComboboxDividerRight" XPos="164" YPos="68" Width="14" Height="1" /> + <Image Name="HeaderBarBackdropNormal" XPos="230" YPos="163" Width="10" Height="12" /> + <Image Name="HeaderBarBackdropHover" XPos="230" YPos="163" Width="10" Height="12" /> + <Image Name="HeaderBarSplitterNormal" XPos="225" YPos="92" Width="3" Height="16" /> + <Image Name="HeaderBarSplitterHover" XPos="200" YPos="92" Width="3" Height="16" /> + <Image Name="HeaderBarSortUp" XPos="233" YPos="178" Width="8" Height="8" /> + <Image Name="HeaderBarSortDown" XPos="244" YPos="178" Width="8" Height="8" /> + <Image Name="MultiListLeft" XPos="170" YPos="92" Width="7" Height="6" /> + <Image Name="MultiListRight" XPos="191" YPos="92" Width="7" Height="6" /> + <Image Name="MultiListTop" XPos="181" YPos="81" Width="6" Height="7" /> + <Image Name="MultiListBottom" XPos="181" YPos="102" Width="6" Height="7" /> + <Image Name="MultiListTopLeft" XPos="170" YPos="81" Width="7" Height="7" /> + <Image Name="MultiListTopRight" XPos="191" YPos="81" Width="7" Height="7" /> + <Image Name="MultiListBottomLeft" XPos="170" YPos="102" Width="7" Height="7" /> + <Image Name="MultiListBottomRight" XPos="191" YPos="102" Width="7" Height="7" /> + <Image Name="MultiListBackdrop" XPos="181" YPos="92" Width="6" Height="6" /> + <Image Name="MultiListSelectionBrush" XPos="9" YPos="71" Width="14" Height="14" /> + <Image Name="AltProgressLeft" XPos="71" YPos="88" Width="8" Height="12" /> + <Image Name="AltProgressMiddle" XPos="81" YPos="88" Width="8" Height="12" /> + <Image Name="AltProgressRight" XPos="91" YPos="88" Width="8" Height="12" /> + <Image Name="AltProgressQuarter" XPos="102" YPos="89" Width="3" Height="4" /> + <Image Name="AltProgressHalf" XPos="109" YPos="89" Width="4" Height="5" /> + <Image Name="AltProgressLight1" XPos="100" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight2" XPos="106" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight3" XPos="112" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight4" XPos="118" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight5" XPos="124" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight6" XPos="130" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight7" XPos="136" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight8" XPos="142" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight9" XPos="148" YPos="97" Width="4" Height="8" /> + <Image Name="AltProgressLight10" XPos="154" YPos="97" Width="4" Height="8" /> + <Image Name="CloseButtonNormal" XPos="41" YPos="128" Width="16" Height="16" /> + <Image Name="CloseButtonHover" XPos="41" YPos="146" Width="16" Height="16" /> + <Image Name="CloseButtonPressed" XPos="41" YPos="164" Width="16" Height="16" /> + <Image Name="NewCloseButtonNormal" XPos="90" YPos="146" Width="10" Height="10" /> + <Image Name="NewCloseButtonHover" XPos="90" YPos="146" Width="10" Height="10" /> + <Image Name="NewCloseButtonPressed" XPos="90" YPos="146" Width="10" Height="10" /> + <Image Name="MultiLineEditboxLeft" XPos="41" YPos="89" Width="6" Height="6" /> + <Image Name="MultiLineEditboxRight" XPos="63" YPos="89" Width="6" Height="6" /> + <Image Name="MultiLineEditboxTop" XPos="52" YPos="78" Width="6" Height="6" /> + <Image Name="MultiLineEditboxBottom" XPos="52" YPos="100" Width="6" Height="6" /> + <Image Name="MultiLineEditboxTopLeft" XPos="41" YPos="78" Width="6" Height="6" /> + <Image Name="MultiLineEditboxTopRight" XPos="63" YPos="78" Width="6" Height="6" /> + <Image Name="MultiLineEditboxBottomLeft" XPos="41" YPos="100" Width="6" Height="6" /> + <Image Name="MultiLineEditboxBottomRight" XPos="63" YPos="100" Width="6" Height="6" /> + <Image Name="MultiLineEditboxBackdrop" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="MultiLineEditboxSelectionBrush" XPos="9" YPos="71" Width="14" Height="14" /> + <Image Name="MouseTarget" XPos="182" YPos="127" Width="17" Height="17" XOffset="-8" YOffset="-8" /> + <Image Name="MouseArrow" XPos="138" YPos="127" Width="31" Height="25" XOffset="0" YOffset="0" /> + <Image Name="MouseMoveCursor" XPos="201" YPos="127" Width="18" Height="18" XOffset="-8" YOffset="-8" /> + <Image Name="MouseNoSoCursor" XPos="221" YPos="127" Width="8" Height="18" XOffset="-3" YOffset="-8" /> + <Image Name="MouseEsWeCursor" XPos="182" YPos="150" Width="18" Height="8" XOffset="-8" YOffset="-3" /> + <Image Name="MouseNeSwCursor" XPos="201" YPos="147" Width="14" Height="14" XOffset="-7" YOffset="-7" /> + <Image Name="MouseNwSeCursor" XPos="230" YPos="126" Width="14" Height="14" XOffset="-7" YOffset="-7" /> + <Image Name="MouseTextBar" XPos="173" YPos="127" Width="7" Height="18" XOffset="-2" YOffset="-9" /> + <Image Name="TabHorizontalFiller" XPos="197" YPos="201" Width="7" Height="1" /> + <Image Name="TabContentPaneUpperLeft" XPos="41" YPos="78" Width="7" Height="7" /> + <Image Name="TabContentPaneUpper" XPos="52" YPos="78" Width="6" Height="7" /> + <Image Name="TabContentPaneUpperRight" XPos="62" YPos="78" Width="7" Height="7" /> + <Image Name="TabContentPaneLeft" XPos="41" YPos="89" Width="7" Height="6" /> + <Image Name="TabContentPaneRight" XPos="62" YPos="89" Width="7" Height="6" /> + <Image Name="TabContentPaneLower" XPos="52" YPos="99" Width="6" Height="7" /> + <Image Name="TabContentPaneLowerLeft" XPos="41" YPos="99" Width="7" Height="7" /> + <Image Name="TabContentPaneLowerRight" XPos="62" YPos="99" Width="7" Height="7" /> + <Image Name="TabContentPaneMiddle" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="TabButtonScrollLeftNormal" XPos="97" YPos="108" Width="16" Height="17" /> + <Image Name="TabButtonScrollRightNormal" XPos="112" YPos="108" Width="16" Height="17" /> + <Image Name="TabButtonScrollLeftHover" XPos="127" YPos="108" Width="16" Height="17" /> + <Image Name="TabButtonScrollRightHover" XPos="142" YPos="108" Width="16" Height="17" /> + <Image Name="TabButtonLeftNormal" XPos="41" YPos="89" Width="7" Height="6" /> + <Image Name="TabButtonRightNormal" XPos="62" YPos="89" Width="7" Height="6" /> + <Image Name="TabButtonUpperNormal" XPos="52" YPos="78" Width="6" Height="7" /> + <Image Name="TabButtonLowerNormal" XPos="52" YPos="99" Width="6" Height="7" /> + <Image Name="TabButtonUpperLeftNormal" XPos="41" YPos="78" Width="7" Height="7" /> + <Image Name="TabButtonUpperLeft2Normal" XPos="186" YPos="164" Width="7" Height="7" /> + <Image Name="TabButtonUpperRightNormal" XPos="62" YPos="78" Width="7" Height="7" /> + <Image Name="TabButtonLowerLeftNormal" XPos="41" YPos="99" Width="7" Height="7" /> + <Image Name="TabButtonLowerRightNormal" XPos="62" YPos="99" Width="7" Height="7" /> + <Image Name="TabButtonLowerRight2Normal" XPos="187" YPos="195" Width="7" Height="7" /> + <Image Name="TabButtonMiddleNormal" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="TabButtonLeftSelected" XPos="41" YPos="89" Width="7" Height="6" /> + <Image Name="TabButtonRightSelected" XPos="62" YPos="89" Width="7" Height="6" /> + <Image Name="TabButtonUpperSelected" XPos="52" YPos="78" Width="6" Height="7" /> + <Image Name="TabButtonLowerSelected" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="TabButtonUpperLeftSelected" XPos="41" YPos="78" Width="7" Height="7" /> + <Image Name="TabButtonUpperRightSelected" XPos="62" YPos="78" Width="7" Height="7" /> + <Image Name="TabButtonLowerLeftSelected" XPos="41" YPos="99" Width="7" Height="7" /> + <Image Name="TabButtonLowerRightSelected" XPos="62" YPos="99" Width="7" Height="7" /> + <Image Name="TabButtonMiddleSelected" XPos="52" YPos="89" Width="6" Height="6" /> + <Image Name="TooltipTopLeft" XPos="61" YPos="160" Width="4" Height="4" /> + <Image Name="TooltipTopRight" XPos="85" YPos="160" Width="5" Height="4" /> + <Image Name="TooltipBottomLeft" XPos="61" YPos="184" Width="4" Height="5" /> + <Image Name="TooltipBottomRight" XPos="85" YPos="184" Width="5" Height="5" /> + <Image Name="TooltipLeftEdge" XPos="61" YPos="171" Width="4" Height="6" /> + <Image Name="TooltipRightEdge" XPos="85" YPos="171" Width="5" Height="6" /> + <Image Name="TooltipTopEdge" XPos="72" YPos="160" Width="6" Height="4" /> + <Image Name="TooltipBottomEdge" XPos="72" YPos="184" Width="6" Height="5" /> + <Image Name="TooltipMiddle" XPos="72" YPos="171" Width="6" Height="6" /> + <Image Name="MenuTopLeft" XPos="166" YPos="204" Width="2" Height="2" /> + <Image Name="MenuTopRight" XPos="175" YPos="204" Width="3" Height="2" /> + <Image Name="MenuBottomLeft" XPos="166" YPos="213" Width="2" Height="3" /> + <Image Name="MenuBottomRight" XPos="175" YPos="213" Width="3" Height="3" /> + <Image Name="MenuLeft" XPos="166" YPos="209" Width="2" Height="1" /> + <Image Name="MenuRight" XPos="175" YPos="209" Width="3" Height="1" /> + <Image Name="MenuTop" XPos="171" YPos="204" Width="1" Height="2" /> + <Image Name="MenuBottom" XPos="171" YPos="213" Width="1" Height="3" /> + <Image Name="MenuMiddle" XPos="171" YPos="209" Width="1" Height="1" /> + <Image Name="PopupMenuFrameTopLeft" XPos="186" YPos="204" Width="2" Height="2" /> + <Image Name="PopupMenuFrameTopRight" XPos="195" YPos="204" Width="4" Height="2" /> + <Image Name="PopupMenuFrameBottomLeft" XPos="186" YPos="213" Width="2" Height="4" /> + <Image Name="PopupMenuFrameBottomRight" XPos="195" YPos="213" Width="4" Height="4" /> + <Image Name="PopupMenuFrameLeft" XPos="186" YPos="209" Width="2" Height="1" /> + <Image Name="PopupMenuFrameRight" XPos="195" YPos="209" Width="4" Height="1" /> + <Image Name="PopupMenuFrameTop" XPos="191" YPos="204" Width="1" Height="2" /> + <Image Name="PopupMenuFrameBottom" XPos="191" YPos="213" Width="1" Height="4" /> + <Image Name="PopupMenuMiddle" XPos="191" YPos="209" Width="1" Height="1" /> + <Image Name="PopupMenuArrowRight" XPos="179" YPos="204" Width="5" Height="5" /> + <Image Name="PopupMenuArrowLeft" XPos="179" YPos="210" Width="5" Height="5" /> +</Imageset> Added: branches/v0-7-0/yake/common/media/gui/imagesets/TaharezLook.tga =================================================================== (Binary files differ) Property changes on: branches/v0-7-0/yake/common/media/gui/imagesets/TaharezLook.tga ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/v0-7-0/yake/common/media/gui/looknfeel/TaharezLook.looknfeel =================================================================== --- branches/v0-7-0/yake/common/media/gui/looknfeel/TaharezLook.looknfeel (rev 0) +++ branches/v0-7-0/yake/common/media/gui/looknfeel/TaharezLook.looknfeel 2007-12-11 22:45:26 UTC (rev 1901) @@ -0,0 +1,4315 @@ +<?xml version="1.0" ?> +<Falagard> + <!-- + *************************************************** + TaharezLook/Button + *************************************************** + --> + <WidgetLook name="TaharezLook/Button"> + <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" /> + <PropertyDefinition name="VertLabelFormatting" initialValue="CentreAligned" /> + <PropertyDefinition name="HorzLabelFormatting" initialValue="CentreAligned" /> + <PropertyDefinition name="NormalImage" initialValue="" redrawOnWrite="true" /> + <PropertyDefinition name="HoverImage" initialValue="" redrawOnWrite="true" /> + <PropertyDefinition name="PushedImage" initialValue="" redrawOnWrite="true" /> + <PropertyDefinition name="DisabledImage" initialValue="" redrawOnWrite="true" /> + <PropertyDefinition name="VertImageFormatting" initialValue="Stretched" redrawOnWrite="true" /> + <PropertyDefinition name="HorzImageFormatting" initialValue="Stretched" redrawOnWrite="true" /> + <ImagerySection name="label"> + <TextComponent> + <Area> + <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim> + <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <VertFormatProperty name="VertLabelFormatting" /> + <HorzFormatProperty name="HorzLabelFormatting" /> + </TextComponent> + </ImagerySection> + <ImagerySection name="normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge"><AbsoluteDim value="0" /></Dim> + <Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftNormal" /> + <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightNormal" /> + <Image type="Background" imageset="TaharezLook" image="ButtonMiddleNormal" /> + </FrameComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <ImageProperty name="NormalImage" /> + <VertFormatProperty name="VertImageFormatting" /> + <HorzFormatProperty name="HorzImageFormatting" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="hover"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftHighlight" /> + <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightHighlight" /> + <Image type="Background" imageset="TaharezLook" image="ButtonMiddleHighlight" /> + </FrameComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <ImageProperty name="HoverImage" /> + <VertFormatProperty name="VertImageFormatting" /> + <HorzFormatProperty name="HorzImageFormatting" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="pushed"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="TaharezLook" image="ButtonLeftPushed" /> + <Image type="RightEdge" imageset="TaharezLook" image="ButtonRightPushed" /> + <Image type="Background" imageset="TaharezLook" image="ButtonMiddlePushed" /> + </FrameComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <ImageProperty name="PushedImage" /> + <VertFormatProperty name="VertImageFormatting" /> + <HorzFormatProperty name="HorzImageFormatting" /> + </ImageryComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + <Section section="label"> + <ColourProperty name="NormalTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + <Section section="label"> + <ColourProperty name="HoverTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Pushed"> + <Layer> + <Section section="pushed" /> + <Section section="label"> + <ColourProperty name="PushedTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="PushedOff"> + <Layer> + <Section section="hover" /> + <Section section="label"> + <ColourProperty name="HoverTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="label"> + <ColourProperty name="DisabledTextColour" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + TaharezLook/RadioButton + *************************************************** + --> + <WidgetLook name="TaharezLook/RadioButton"> + <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" /> + <ImagerySection name="label"> + <TextComponent> + <Area> + <Dim type="LeftEdge" > + <ImageDim imageset="TaharezLook" image="RadioButtonNormal" dimension="Width"> + <DimOperator op="Add"> + <AbsoluteDim value="3" /> + </DimOperator> + </ImageDim> + </Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </TextComponent> + </ImagerySection> + <ImagerySection name="normal"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="RadioButtonNormal" /> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="hover"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="RadioButtonHover" /> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="select_mark"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="RadioButtonMark" /> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </ImageryComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + <Section section="label"> + <ColourProperty name="NormalTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + <Section section="label"> + <ColourProperty name="HoverTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="label"> + <ColourProperty name="DisabledTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="SelectedNormal"> + <Layer> + <Section section="normal" /> + <Section section="select_mark" /> + <Section section="label"> + <ColourProperty name="NormalTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="SelectedHover"> + <Layer> + <Section section="hover" /> + <Section section="select_mark" /> + <Section section="label"> + <ColourProperty name="HoverTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="SelectedDisabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="select_mark"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="label"> + <ColourProperty name="DisabledTextColour" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + TaharezLook/Checkbox + *************************************************** + --> + <WidgetLook name="TaharezLook/Checkbox"> + <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" /> + <ImagerySection name="label"> + <TextComponent> + <Area> + <Dim type="LeftEdge" > + <ImageDim imageset="TaharezLook" image="CheckboxNormal" dimension="Width"> + <DimOperator op="Add"> + <AbsoluteDim value="3" /> + </DimOperator> + </ImageDim> + </Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </TextComponent> + </ImagerySection> + <ImagerySection name="normal"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="CheckboxNormal" /> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="hover"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="CheckboxHover" /> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="select_mark"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="CheckboxMark" /> + <VertFormat type="CentreAligned" /> + <HorzFormat type="LeftAligned" /> + </ImageryComponent> + </ImagerySection> + <StateImagery name="Normal"> + <Layer> + <Section section="normal" /> + <Section section="label"> + <ColourProperty name="NormalTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Hover"> + <Layer> + <Section section="hover" /> + <Section section="label"> + <ColourProperty name="HoverTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="label"> + <ColourProperty name="DisabledTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="SelectedNormal"> + <Layer> + <Section section="normal" /> + <Section section="select_mark" /> + <Section section="label"> + <ColourProperty name="NormalTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="SelectedHover"> + <Layer> + <Section section="hover" /> + <Section section="select_mark" /> + <Section section="label"> + <ColourProperty name="HoverTextColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="SelectedDisabled"> + <Layer> + <Section section="normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="select_mark"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="label"> + <ColourProperty name="DisabledTextColour" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + TaharezLook/Editbox + *************************************************** + --> + <WidgetLook name="TaharezLook/Editbox"> + <PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <PropertyDefinition name="SelectedTextColour" initialValue="FF000000" redrawOnWrite="true" /> + <PropertyDefinition name="ActiveSelectionColour" initialValue="FF607FFF" redrawOnWrite="true" /> + <PropertyDefinition name="InactiveSelectionColour" initialValue="FF808080" redrawOnWrite="true" /> + <Property name="MouseCursorImage" value="set:TaharezLook image:MouseTextBar" /> + <NamedArea name="TextArea"> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="5" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="5" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1.0" offset="-5" type="RightEdge" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" offset="-5" type="BottomEdge" /></Dim> + </Area> + </NamedArea> + <ImagerySection name="container_normal"> + <FrameComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <Image type="LeftEdge" imageset="TaharezLook" image="EditBoxLeft" /> + <Image type="RightEdge" imageset="TaharezLook" image="EditBoxRight" /> + <Image type="Background" imageset="TaharezLook" image="EditBoxMiddle" /> + </FrameComponent> + </ImagerySection> + <ImagerySection name="selection"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" ><UnifiedDim scale="1.0" type="RightEdge" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim> + </Area> + <Image imageset="TaharezLook" image="TextSelectionBrush" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="Carat"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><ImageDim imageset="TaharezLook" image="EditBoxCarat" dimension="Width" /></Dim> + <Dim type="BottomEdge" ><UnifiedDim scale="1.0" type="BottomEdge" /></Dim> + </Area> + <Image imageset="TaharezLook" image="EditBoxCarat" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> + <StateImagery name="Enabled"> + <Layer> + <Section section="container_normal" /> + </Layer> + </StateImagery> + <StateImagery name="ReadOnly"> + <Layer> + <Section section="container_normal" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="container_normal"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="ActiveSelection"> + <Layer> + <Section section="selection"> + <ColourProperty name="ActiveSelectionColour" /> + </Section> + </Layer> + </StateImagery> + <StateImagery name="InactiveSelection"> + <Layer> + <Section section="selection"> + <ColourProperty name="InactiveSelectionColour" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + TaharezLook/Titlebar + *************************************************** + --> + <WidgetLook name="TaharezLook/Titlebar"> + <PropertyDefinition name="CaptionColour" initialValue="FFFFFFFF" redrawOnWrite="true" /> + <ImagerySection name="main"> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="NewTitlebarLeft" /> + <VertFormat type="Stretched" /> + </ImageryComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width"> + <DimOperator op="Add"> + <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width" /> + </DimOperator> + </ImageDim> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="NewTitlebarRight" /> + <VertFormat type="Stretched" /> + <HorzFormat type="RightAligned" /> + </ImageryComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width" /> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="SysAreaMiddle" /> + <VertFormat type="Stretched" /> + <HorzFormat type="RightAligned" /> + </ImageryComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1.0" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="SysAreaRight" /> + <VertFormat type="Stretched" /> + <HorzFormat type="RightAligned" /> + </ImageryComponent> + <ImageryComponent> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="NewTitlebarLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width"> + <DimOperator op="Add"> + <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width"> + <DimOperator op="Add"> + <ImageDim imageset="TaharezLook" image="NewTitlebarRight" dimension="Width" /> + </DimOperator> + </ImageDim> + </DimOperator> + </ImageDim> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="Height" ><UnifiedDim scale="1.0" type="Height" /></Dim> + </Area> + <Image imageset="TaharezLook" image="NewTitlebarMiddle" /> + <VertFormat type="Stretched" /> + <HorzFormat type="Stretched" /> + </ImageryComponent> + </ImagerySection> + <ImagerySection name="caption"> + <TextComponent> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="NewTitlebarLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" offset="-75" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + <ColourProperty name="CaptionColour" /> + <VertFormat type="CentreAligned" /> + </TextComponent> + </ImagerySection> + <StateImagery name="Active"> + <Layer> + <Section section="main" /> + <Section section="caption" /> + </Layer> + </StateImagery> + <StateImagery name="Inactive"> + <Layer> + <Section section="main" /> + <Section section="caption" /> + </Layer> + </StateImagery> + <StateImagery name="Disabled"> + <Layer> + <Section section="main"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + <Section section="caption"> + <Colours topLeft="FF7F7F7F" topRight="FF7F7F7F" bottomLeft="FF7F7F7F" bottomRight="FF7F7F7F" /> + </Section> + </Layer> + </StateImagery> + </WidgetLook> + + <!-- + *************************************************** + TaharezLook/FrameWindow + *************************************************** + --> + <WidgetLook name="TaharezLook/FrameWindow"> + <PropertyLinkDefinition name="CaptionColour" widget="__auto_titlebar__" targetProperty="CaptionColour" initialValue="FFFFFFFF" /> + <PropertyLinkDefinition name="TitlebarFont" widget="__auto_titlebar__" targetProperty="Font" /> + <Property name="NSSizingCursorImage" value="set:TaharezLook image:MouseNoSoCursor" /> + <Property name="EWSizingCursorImage" value="set:TaharezLook image:MouseEsWeCursor" /> + <Property name="NWSESizingCursorImage" value="set:TaharezLook image:MouseNwSeCursor" /> + <Property name="NESWSizingCursorImage" value="set:TaharezLook image:MouseNeSwCursor" /> + <NamedArea name="ClientWithTitleWithFrame"> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="WindowTopLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="WindowTopRight" dimension="Width" /> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="BottomEdge" > + <UnifiedDim scale="1" type="BottomEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="WindowBottomEdge" dimension="Height" /> + </DimOperator> + </UnifiedDim> + </Dim> + </Area> + </NamedArea> + <NamedArea name="ClientWithTitleNoFrame"> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><WidgetDim widget="__auto_titlebar__" dimension="BottomEdge" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="BottomEdge" ><WidgetDim dimension="BottomEdge" /></Dim> + </Area> + </NamedArea> + <NamedArea name="ClientNoTitleWithFrame"> + <Area> + <Dim type="LeftEdge" ><ImageDim imageset="TaharezLook" image="WindowTopLeft" dimension="Width" /></Dim> + <Dim type="TopEdge" ><ImageDim imageset="TaharezLook" image="WindowTopEdge" dimension="Height" /></Dim> + <Dim type="RightEdge" > + <UnifiedDim scale="1" type="RightEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="WindowTopRight" dimension="Width" /> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="BottomEdge" > + <UnifiedDim scale="1" type="BottomEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="WindowBottomEdge" dimension="Height" /> + </DimOperator> + </UnifiedDim> + </Dim> + </Area> + </NamedArea> + <NamedArea name="ClientNoTitleNoFrame"> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim> + </Area> + </NamedArea> + <Child type="TaharezLook/Titlebar" nameSuffix="__auto_titlebar__"> + <Area> + <Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim> + <Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim> + <Dim type="Height" ><FontDim type="LineSpacing" padding="8" /></Dim> + </Area> + <Property name="AlwaysOnTop" value="False" /> + </Child> + <Child type="TaharezLook/SystemButton" nameSuffix="__auto_closebutton__"> + <Area> + <Dim type="LeftEdge" > + <UnifiedDim scale="1" type="LeftEdge"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="SysAreaRight" dimension="Width"> + <DimOperator op="Add"> + <ImageDim imageset="TaharezLook" image="SysAreaMiddle" dimension="Width" /> + </DimOperator> + </ImageDim> + </DimOperator> + </UnifiedDim> + </Dim> + <Dim type="TopEdge" > + <AbsoluteDim value="0.5"> + <DimOperator op="Multiply"> + <WidgetDim widget="__auto_titlebar__" dimension="Height"> + <DimOperator op="Subtract"> + <ImageDim imageset="TaharezLook" image="NewCloseButtonNormal" dimension="Width" /> + </DimOperator> + </WidgetDim> + </DimOperator> + </AbsoluteDim> + </Dim> + <Dim type="Width" ><ImageDim imageset="TaharezLook" image="NewCloseButtonNormal" dimension="Width" /></Dim> + <Dim type="Height" ><ImageDim imageset="TaharezLook" image="NewCloseButtonNormal" dimension="Width" /></Dim> + </Area> + <Property name="AlwaysOnTop" value="True" /> + <Property name="NormalImage" value="set:TaharezLook image:NewCloseButtonNormal" /> + <Property name="HoverImage" value="set:TaharezLook image:NewCloseButtonHover" /> + <Property name="PushedImage" value="set:TaharezLook image:NewCloseButtonPressed" /> + </Child> + <ImagerySection name="withtitle_frame"> + <FrameComponent> + ... [truncated message content] |
From: <psy...@us...> - 2007-12-11 21:08:50
|
Revision: 1900 http://yake.svn.sourceforge.net/yake/?rev=1900&view=rev Author: psyclonist Date: 2007-12-11 13:08:53 -0800 (Tue, 11 Dec 2007) Log Message: ----------- * [build] fixed build condition (thanks cdkeito for reporting) Modified Paths: -------------- branches/v0-7-0/yake/scripts/premake/plugins.lua Modified: branches/v0-7-0/yake/scripts/premake/plugins.lua =================================================================== --- branches/v0-7-0/yake/scripts/premake/plugins.lua 2007-12-11 20:48:28 UTC (rev 1899) +++ branches/v0-7-0/yake/scripts/premake/plugins.lua 2007-12-11 21:08:53 UTC (rev 1900) @@ -61,7 +61,7 @@ useDep("ode") -------------------------------------- -if PLUGIN_INPUT_OGRE and PLUGIN_GRAPHICS_OGRE then +if (PLUGIN_INPUT_OGRE or PLUGIN_INPUT_OGRE_OIS) and PLUGIN_GRAPHICS_OGRE then makeComponentPlugin("ceguiOgreRendererAdapter","YAKE_CEGUIRENDERERADAPTER_OGRE_EXPORTS") addDependency("base") addDependency("graphics") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-12-11 20:48:37
|
Revision: 1899 http://yake.svn.sourceforge.net/yake/?rev=1899&view=rev Author: psyclonist Date: 2007-12-11 12:48:28 -0800 (Tue, 11 Dec 2007) Log Message: ----------- * [audio] small fixes Modified Paths: -------------- branches/v0-7-0/yake/samples/audio/demo1/demo.cpp branches/v0-7-0/yake/src/plugins/audioOpenAL/yakeAudioWorldOpenAL.cpp branches/v0-7-0/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h Modified: branches/v0-7-0/yake/samples/audio/demo1/demo.cpp =================================================================== --- branches/v0-7-0/yake/samples/audio/demo1/demo.cpp 2007-12-11 01:23:08 UTC (rev 1898) +++ branches/v0-7-0/yake/samples/audio/demo1/demo.cpp 2007-12-11 20:48:28 UTC (rev 1899) @@ -1,6 +1,10 @@ #include <yake/audio/yakeAudio.h> #include <yake/base/yakeLibrary.h> +#if YAKE_PLATFORM == PLATFORM_WIN32 +#define WIN32_LEAN_AND_MEAN +#include <windows.h> +#endif int main(int argc,char* argv[]) { try { @@ -14,7 +18,6 @@ // create world audio::WorldPtr world = pAudio->createWorld(); - /* // init listener audio::ListenerPtr listener = world->createListener(); world->setActiveListener( listener ); @@ -35,15 +38,16 @@ sourceSong->setSoundData( song ); //source->setSoundData( sound1 ); - //std::cin.get(); - // start playing //source->play(); sourceSong->play(); std::cout << "waiting for play...\n"; while (sourceSong->getState() != audio::ISource::Playing) - //usleep(1000); +#if YAKE_PLATFORM == PLATFORM_WIN32 Sleep(0); +#else + usleep(1000); +#endif // wait for stop std::cout << "running...\npress a key to stop...\n"; @@ -57,7 +61,6 @@ world.reset(); pAudio.reset(); pLib.reset(); - */ } catch (yake::Exception& e) { Modified: branches/v0-7-0/yake/src/plugins/audioOpenAL/yakeAudioWorldOpenAL.cpp =================================================================== --- branches/v0-7-0/yake/src/plugins/audioOpenAL/yakeAudioWorldOpenAL.cpp 2007-12-11 01:23:08 UTC (rev 1898) +++ branches/v0-7-0/yake/src/plugins/audioOpenAL/yakeAudioWorldOpenAL.cpp 2007-12-11 20:48:28 UTC (rev 1899) @@ -91,7 +91,7 @@ void WorldOpenAL::setActiveListener( ListenerPtr pListener ) { - YAKE_ASSERT( false ).warning("setActiveListener: not supported"); + mActiveListener = pListener; } void WorldOpenAL::setDopplerFactor( real factor ) Modified: branches/v0-7-0/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h =================================================================== --- branches/v0-7-0/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h 2007-12-11 01:23:08 UTC (rev 1898) +++ branches/v0-7-0/yake/yake/plugins/audioOpenAL/yakeAudioSystemOpenAL.h 2007-12-11 20:48:28 UTC (rev 1899) @@ -157,6 +157,7 @@ protected: openalpp::ref_ptr<openalpp::AudioEnvironment> mEnv; + ListenerPtr mActiveListener; }; class AudioSystemOpenAL : public IAudioSystem This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-12-11 01:23:05
|
Revision: 1898 http://yake.svn.sourceforge.net/yake/?rev=1898&view=rev Author: psyclonist Date: 2007-12-10 17:23:08 -0800 (Mon, 10 Dec 2007) Log Message: ----------- * [docs] .7 Modified Paths: -------------- branches/v0-7-0/yake/documentation/api/DoxySfile branches/v0-7-0/yake/documentation/api/Doxyfile Modified: branches/v0-7-0/yake/documentation/api/DoxySfile =================================================================== --- branches/v0-7-0/yake/documentation/api/DoxySfile 2007-12-10 21:52:09 UTC (rev 1897) +++ branches/v0-7-0/yake/documentation/api/DoxySfile 2007-12-11 01:23:08 UTC (rev 1898) @@ -4,7 +4,7 @@ # General configuration options #--------------------------------------------------------------------------- PROJECT_NAME = YAKE -PROJECT_NUMBER = 0.6.0-dev +PROJECT_NUMBER = 0.7.0-dev INPUT = documentation/api yake/audio yake/base/math yake/base/mpl yake/base/native yake/base/templates yake/base yake/bindings.lua yake/common yake/data yake/ent yake/file yake/graphics yake/gui yake/gui_adapter yake/gui_addons yake/input yake/loader yake/model yake/msg yake/net yake/netsvc yake/netrepsvc yake/object yake/physics yake/prop yake/property yake/raf yake/scripting yake/statemachine yake/task yake/vehicle yake/yappbase OUTPUT_DIRECTORY = documentation/api/html GENERATE_DOXYS_HELP = YES Modified: branches/v0-7-0/yake/documentation/api/Doxyfile =================================================================== --- branches/v0-7-0/yake/documentation/api/Doxyfile 2007-12-10 21:52:09 UTC (rev 1897) +++ branches/v0-7-0/yake/documentation/api/Doxyfile 2007-12-11 01:23:08 UTC (rev 1898) @@ -31,14 +31,14 @@ # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 0.6.x +PROJECT_NUMBER = 0.7.x # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = documentation/api/doxy.html +OUTPUT_DIRECTORY = documentation/api/ # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-12-10 21:52:11
|
Revision: 1897 http://yake.svn.sourceforge.net/yake/?rev=1897&view=rev Author: psyclonist Date: 2007-12-10 13:52:09 -0800 (Mon, 10 Dec 2007) Log Message: ----------- * updated IDE/debug settings Modified Paths: -------------- branches/v0-7-0/yake/scripts/msvc80/yake.suo Modified: branches/v0-7-0/yake/scripts/msvc80/yake.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-12-10 21:49:15
|
Revision: 1896 http://yake.svn.sourceforge.net/yake/?rev=1896&view=rev Author: psyclonist Date: 2007-12-10 13:49:17 -0800 (Mon, 10 Dec 2007) Log Message: ----------- * [base] remove unnecessary double->float casts (thanks Sydonia for reporting) Modified Paths: -------------- branches/v0-7-0/yake/src/base/native/win32/yakeTime.cpp Modified: branches/v0-7-0/yake/src/base/native/win32/yakeTime.cpp =================================================================== --- branches/v0-7-0/yake/src/base/native/win32/yakeTime.cpp 2007-12-10 18:09:00 UTC (rev 1895) +++ branches/v0-7-0/yake/src/base/native/win32/yakeTime.cpp 2007-12-10 21:49:17 UTC (rev 1896) @@ -53,7 +53,7 @@ public: // Public member for a gain of speed. Win32::LARGE_INTEGER mTimerFrequency; - real mStart; + double mStart; // Constructor. TimerInit() @@ -61,7 +61,7 @@ if( !Win32::QueryPerformanceFrequency( &mTimerFrequency ) ) { mTimerFrequency.QuadPart = 0; - mStart = real( Win32::timeGetTime() ) / 1000.0f; + mStart = Win32::timeGetTime() / 1000.0f; } else { @@ -71,7 +71,7 @@ double count = double( largeCount.QuadPart ); double frequency = double( mTimerFrequency.QuadPart ); - mStart = real( count / frequency ); + mStart = count / frequency; } } } TimerInit_g; @@ -81,7 +81,7 @@ { // No performance timer available. if( TimerInit_g.mTimerFrequency.QuadPart == 0 ) - return real( Win32::timeGetTime() ) / 1000.0f - TimerInit_g.mStart; + return real( Win32::timeGetTime() / 1000.0f - TimerInit_g.mStart ); Win32::LARGE_INTEGER largeCount; Win32::QueryPerformanceCounter( &largeCount ); @@ -89,7 +89,7 @@ double count = double( largeCount.QuadPart ); double frequency = double( TimerInit_g.mTimerFrequency.QuadPart ); - return real( count / frequency ) - TimerInit_g.mStart; + return real(( count / frequency ) - TimerInit_g.mStart); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-12-10 18:08:58
|
Revision: 1895 http://yake.svn.sourceforge.net/yake/?rev=1895&view=rev Author: psyclonist Date: 2007-12-10 10:09:00 -0800 (Mon, 10 Dec 2007) Log Message: ----------- * updated debug/IDE settings * fixed Vector3/Point3 mismatch in demo CmdrMayhem Modified Paths: -------------- branches/v0-7-0/yake/scripts/msvc80/yake.suo Modified: branches/v0-7-0/yake/scripts/msvc80/yake.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-12-10 18:06:39
|
Revision: 1894 http://yake.svn.sourceforge.net/yake/?rev=1894&view=rev Author: psyclonist Date: 2007-12-10 10:06:44 -0800 (Mon, 10 Dec 2007) Log Message: ----------- * added missing sample .cfg files for release builds Modified Paths: -------------- branches/v0-7-0/yake/samples/bin/release/raf_common.cfg Added Paths: ----------- branches/v0-7-0/yake/samples/bin/release/commclient.cfg branches/v0-7-0/yake/samples/bin/release/commserver.cfg branches/v0-7-0/yake/samples/bin/release/roclient.cfg branches/v0-7-0/yake/samples/bin/release/rodemo.cfg branches/v0-7-0/yake/samples/bin/release/roserver.cfg branches/v0-7-0/yake/samples/bin/release/sampleGuiConsole.cfg branches/v0-7-0/yake/samples/bin/release/sampleRaf1.cfg branches/v0-7-0/yake/samples/bin/release/sampleRafLua1.cfg branches/v0-7-0/yake/samples/bin/release/sampleRafLua2.cfg branches/v0-7-0/yake/samples/bin/release/sampleVehicle.cfg Added: branches/v0-7-0/yake/samples/bin/release/commclient.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/release/commclient.cfg (rev 0) +++ branches/v0-7-0/yake/samples/bin/release/commclient.cfg 2007-12-10 18:06:44 UTC (rev 1894) @@ -0,0 +1,8 @@ +commclient +{ + client + { + ;server 192.168.1.33:40000 + server 127.0.0.1:40000 + } +} Added: branches/v0-7-0/yake/samples/bin/release/commserver.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/release/commserver.cfg (rev 0) +++ branches/v0-7-0/yake/samples/bin/release/commserver.cfg 2007-12-10 18:06:44 UTC (rev 1894) @@ -0,0 +1,7 @@ +commserver +{ + server + { + ;bind 192.168.1.33:40000 + } +} Modified: branches/v0-7-0/yake/samples/bin/release/raf_common.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/release/raf_common.cfg 2007-12-10 17:46:00 UTC (rev 1893) +++ branches/v0-7-0/yake/samples/bin/release/raf_common.cfg 2007-12-10 18:06:44 UTC (rev 1894) @@ -1,13 +1,22 @@ +#----------------------------------- [raf.options] useCEGUI=no +#----------------------------------- [raf.startup.libraries] +# Libraries to be loaded automatically at startup + scriptingLua +#----------------------------------- [raf.startup.systems] +# System to be created & initialized automatically + scripting=lua +#----------------------------------- [raf.startup.scripts] +# Scripts to be run at startup # run = <scripting_system>,<filename> run=lua,raf1_startup.lua Added: branches/v0-7-0/yake/samples/bin/release/roclient.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/release/roclient.cfg (rev 0) +++ branches/v0-7-0/yake/samples/bin/release/roclient.cfg 2007-12-10 18:06:44 UTC (rev 1894) @@ -0,0 +1,12 @@ +rodemo +{ + server + { + start 0 + } + client + { + count 1 + server 192.168.1.33:40000 + } +} Added: branches/v0-7-0/yake/samples/bin/release/rodemo.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/release/rodemo.cfg (rev 0) +++ branches/v0-7-0/yake/samples/bin/release/rodemo.cfg 2007-12-10 18:06:44 UTC (rev 1894) @@ -0,0 +1,13 @@ +rodemo +{ + server + { + start 0 + bind 192.168.1.33:40000 + } + client + { + server 192.168.1.33:40000 + count 1 + } +} Added: branches/v0-7-0/yake/samples/bin/release/roserver.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/release/roserver.cfg (rev 0) +++ branches/v0-7-0/yake/samples/bin/release/roserver.cfg 2007-12-10 18:06:44 UTC (rev 1894) @@ -0,0 +1,12 @@ +rodemo +{ + server + { + start 1 + bind 192.168.1.33:40000 + } + client + { + count 0 + } +} Added: branches/v0-7-0/yake/samples/bin/release/sampleGuiConsole.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/release/sampleGuiConsole.cfg (rev 0) +++ branches/v0-7-0/yake/samples/bin/release/sampleGuiConsole.cfg 2007-12-10 18:06:44 UTC (rev 1894) @@ -0,0 +1,20 @@ +[resource.sources] # <- evaluated by RAF +file=../../../common/media/scripts/ # <- do NOT forget trialing '/' !! +file=../../../common/media/ + +[raf.options] +useCEGUI=yes + +#----------------------------------- +[raf.startup.libraries] +# Libraries to be loaded automatically at startup + +graphicsOgre +inputOgreOIS + +#----------------------------------- +[raf.startup.systems] +# System to be created & initialized automatically + +graphics=ogre3d +input=ois Added: branches/v0-7-0/yake/samples/bin/release/sampleRaf1.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/release/sampleRaf1.cfg (rev 0) +++ branches/v0-7-0/yake/samples/bin/release/sampleRaf1.cfg 2007-12-10 18:06:44 UTC (rev 1894) @@ -0,0 +1,16 @@ +[resource.sources] # <- evaluated by RAF +file=../../../common/media/scripts/ # <- do NOT forget trialing '/' !! + +#----------------------------------- +[raf.startup.libraries] +# Libraries to be loaded automatically at startup + +graphicsOgre +inputOgreOIS + +#----------------------------------- +[raf.startup.systems] +# System to be created & initialized automatically + +graphics=ogre3d +input=ois Added: branches/v0-7-0/yake/samples/bin/release/sampleRafLua1.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/release/sampleRafLua1.cfg (rev 0) +++ branches/v0-7-0/yake/samples/bin/release/sampleRafLua1.cfg 2007-12-10 18:06:44 UTC (rev 1894) @@ -0,0 +1,18 @@ +[resource.sources] # <- evaluated by RAF +file=../../../common/media/scripts/ # <- do NOT forget trialing '/' !! + +#----------------------------------- +[raf.startup.libraries] +# Libraries to be loaded automatically at startup + +graphicsOgre +inputOgreOIS +scriptingLua + +#----------------------------------- +[raf.startup.systems] +# System to be created & initialized automatically + +graphics=ogre3d +input=ois +scripting=lua Added: branches/v0-7-0/yake/samples/bin/release/sampleRafLua2.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/release/sampleRafLua2.cfg (rev 0) +++ branches/v0-7-0/yake/samples/bin/release/sampleRafLua2.cfg 2007-12-10 18:06:44 UTC (rev 1894) @@ -0,0 +1,16 @@ +[resource.sources] # <- evaluated by RAF +file=../../../common/media/scripts/ # <- do NOT forget trialing '/' !! + +#----------------------------------- +[raf.startup.libraries] +# Libraries to be loaded automatically at startup + +graphicsOgre +inputOgreOIS + +#----------------------------------- +[raf.startup.systems] +# System to be created & initialized automatically + +graphics=ogre3d +input=ois Added: branches/v0-7-0/yake/samples/bin/release/sampleVehicle.cfg =================================================================== --- branches/v0-7-0/yake/samples/bin/release/sampleVehicle.cfg (rev 0) +++ branches/v0-7-0/yake/samples/bin/release/sampleVehicle.cfg 2007-12-10 18:06:44 UTC (rev 1894) @@ -0,0 +1,18 @@ +[resource.sources] # <- evaluated by RAF +file=../../../common/media/scripts/ # <- do NOT forget trialing '/' !! + +#----------------------------------- +[raf.startup.libraries] +# Libraries to be loaded automatically at startup + +graphicsOgre +inputOgreOIS +physicsODE + +#----------------------------------- +[raf.startup.systems] +# System to be created & initialized automatically + +graphics=ogre3d +input=ois +physics=ode This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-12-10 17:46:03
|
Revision: 1893 http://yake.svn.sourceforge.net/yake/?rev=1893&view=rev Author: psyclonist Date: 2007-12-10 09:46:00 -0800 (Mon, 10 Dec 2007) Log Message: ----------- * updated debug/IDE settings Modified Paths: -------------- trunk/yake/scripts/msvc80/yake.suo Modified: trunk/yake/scripts/msvc80/yake.suo =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-11-25 23:09:26
|
Revision: 1892 http://yake.svn.sourceforge.net/yake/?rev=1892&view=rev Author: psyclonist Date: 2007-11-25 15:09:31 -0800 (Sun, 25 Nov 2007) Log Message: ----------- * fixed demo dependencies and Vector3/Point3 consistency Modified Paths: -------------- branches/v0-7-0/yake/samples/cmdrmayhem/yakeDemo.cpp branches/v0-7-0/yake/scripts/premake/samples.lua Modified: branches/v0-7-0/yake/samples/cmdrmayhem/yakeDemo.cpp =================================================================== --- branches/v0-7-0/yake/samples/cmdrmayhem/yakeDemo.cpp 2007-11-20 08:02:07 UTC (rev 1891) +++ branches/v0-7-0/yake/samples/cmdrmayhem/yakeDemo.cpp 2007-11-25 23:09:31 UTC (rev 1892) @@ -60,7 +60,7 @@ { sn_.reset(); } - virtual void setPosition( const Vector3& rPosition ) + virtual void setPosition( const Point3& rPosition ) { sn_->setPosition( rPosition ); } @@ -71,7 +71,7 @@ std::cout << "cs.z=" << rOrientation * Vector3::kUnitZ << "\n"; sn_->setOrientation( rOrientation ); } - virtual Vector3 getPosition() const + virtual Point3 getPosition() const { return sn_->getPosition(); } @@ -79,7 +79,7 @@ { return sn_->getOrientation(); } - virtual Vector3 getDerivedPosition() const + virtual Point3 getDerivedPosition() const { return sn_->getDerivedPosition(); } @@ -201,7 +201,7 @@ mPlayerRep = pworld.createAvatar( physics::IAvatar::Desc( Vector3(0.5,2,0), // dimensions - Vector3(0,real(0.1),0) // initial position (relative to stable position) + Point3(0,real(0.1),0) // initial position (relative to stable position) ) ); YAKE_ASSERT( mPlayerRep ); @@ -353,7 +353,7 @@ mCoordSys->setPosition( mPlayerRep->getPosition() ); mCoordSys->setOrientation( mPlayerRep->getOrientation() ); } -Vector3 ControllableCharacter::getPosition() const +Point3 ControllableCharacter::getPosition() const { YAKE_ASSERT( mPlayerRep ); return mPlayerRep->getPosition(); @@ -413,7 +413,7 @@ // position camera and look at the ninja getDefaultCamera()->setNearClipDistance( 1 ); getDefaultCamera()->setFixedYawAxis(Vector3::kUnitY); - getDefaultCamera()->setPosition(Vector3(7,4,-7)); + getDefaultCamera()->setPosition(Point3(7,4,-7)); // create ground mGround = new model::Model(); @@ -427,7 +427,7 @@ pGroundE->setCastsShadow( false ); pGroundSN->attachEntity( pGroundE ); pGroundSN->setScale( Vector3(100,1,100) ); - pGroundSN->setPosition( Vector3(0,-groundHeight,0) ); + pGroundSN->setPosition( Point3(0,-groundHeight,0) ); model::Graphical* pG = new model::Graphical(); pG->addSceneNode( pGroundSN, "ground", true ); Modified: branches/v0-7-0/yake/scripts/premake/samples.lua =================================================================== --- branches/v0-7-0/yake/scripts/premake/samples.lua 2007-11-20 08:02:07 UTC (rev 1891) +++ branches/v0-7-0/yake/scripts/premake/samples.lua 2007-11-25 23:09:31 UTC (rev 1892) @@ -77,6 +77,7 @@ useComponent("ent") useComponent("raf") useComponent("vehicle") + useDep("ode") end -------------------------------------- @@ -150,6 +151,7 @@ useComponent("graphics") useComponent("audio") useComponent("physics") + useComponent("raf") useDep("cegui") useDep("lua") useDep("luabind") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-11-20 08:02:11
|
Revision: 1891 http://yake.svn.sourceforge.net/yake/?rev=1891&view=rev Author: psyclonist Date: 2007-11-20 00:02:07 -0800 (Tue, 20 Nov 2007) Log Message: ----------- * fixed compiler warning due to int<->size_t conversion Modified Paths: -------------- branches/v0-7-0/yake/src/bindings.lua/detail/property.lua.cpp Modified: branches/v0-7-0/yake/src/bindings.lua/detail/property.lua.cpp =================================================================== --- branches/v0-7-0/yake/src/bindings.lua/detail/property.lua.cpp 2007-11-19 20:55:33 UTC (rev 1890) +++ branches/v0-7-0/yake/src/bindings.lua/detail/property.lua.cpp 2007-11-20 08:02:07 UTC (rev 1891) @@ -133,11 +133,11 @@ } NamePropertyPair* getPropertyByIndex(NamedPropertyContainer& ctr, int index) { - index -= 1; // Lua tables usually start with 1 - if (index < 0 || index >= ctr.size() || ctr.size() == 0) + index -= 1; // Lua tables usually start with 1, so convert to 0-based arrays by subtracting 1. :) + if (index < 0 || index >= int(ctr.size()) || ctr.size() == 0) return 0; NamedPropertyContainer::const_iterator it = ctr.begin(); - for (size_t i=0; i<index; ++i, ++it) + for (size_t i=0; i<size_t(index); ++i, ++it) { if (it == ctr.end()) return 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-11-19 20:55:28
|
Revision: 1890 http://yake.svn.sourceforge.net/yake/?rev=1890&view=rev Author: psyclonist Date: 2007-11-19 12:55:33 -0800 (Mon, 19 Nov 2007) Log Message: ----------- Copied remotely Added Paths: ----------- branches/v0-7-0/ Copied: branches/v0-7-0 (from rev 1889, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-11-12 22:26:44
|
Revision: 1889 http://yake.svn.sourceforge.net/yake/?rev=1889&view=rev Author: psyclonist Date: 2007-11-12 14:26:49 -0800 (Mon, 12 Nov 2007) Log Message: ----------- * slight adjustements to the vehicle demo Modified Paths: -------------- trunk/yake/samples/vehicle/yakeDemo.cpp Modified: trunk/yake/samples/vehicle/yakeDemo.cpp =================================================================== --- trunk/yake/samples/vehicle/yakeDemo.cpp 2007-11-12 21:59:44 UTC (rev 1888) +++ trunk/yake/samples/vehicle/yakeDemo.cpp 2007-11-12 22:26:49 UTC (rev 1889) @@ -102,7 +102,9 @@ getPhysicalWorld()->setGlobalGravity(Vector3(0,real(-9.81),0)); getPhysicalWorld()->setCurrentSolverParam("stepsize",real(0.05)); + // create ground + getPhysicalWorld()->createMaterial( physics::IMaterial::Desc( 0.01f, 0.6f, 0.01f ), "ground" ); mGround = new model::Model(); { const real groundHeight = -2; @@ -121,7 +123,8 @@ // physical physics::IActorPtr pGroundPlane = getPhysicalWorld()->createActor( physics::ACTOR_STATIC ); - pGroundPlane->createShape( physics::IShape::PlaneDesc( Vector3(0,1,0), groundHeight ) ); + physics::IShape* groundShape = pGroundPlane->createShape( physics::IShape::PlaneDesc( Vector3(0,1,0), groundHeight ) ); + groundShape->setMaterial( getPhysicalWorld()->getMaterial("ground") ); model::Physical* pP = new model::Physical(); pP->addActor( pGroundPlane, "groundPlane" ); @@ -131,7 +134,7 @@ // materials @todo read from .physics: getPhysicalWorld()->createMaterial( physics::IMaterial::Desc( 0.01f, 0.01f, 0.01f ), "chassis" ); getPhysicalWorld()->createMaterial( physics::IMaterial::Desc( 0.01f, 0.2f, 0.01f ), "chassisTop" ); - getPhysicalWorld()->createMaterial( physics::IMaterial::Desc( 0.01f, 0.5f, 0.01f ), "wheel" ); + getPhysicalWorld()->createMaterial( physics::IMaterial::Desc( 0.01f, 0.7f, 0.01f ), "wheel" ); // vehicle(s) @@ -519,8 +522,9 @@ { using namespace input; - // load key<->action bindings - ActionMap::loadFromFile( actionMap, "../../media/vehicles/demo.actionmap.txt", keyboard, boost::bind(&Jet::addInputConditionConnection,this,_1) ); + // load key<->action bindings //@todo use yake.res to load action map + const bool succ = ActionMap::loadFromFile( actionMap, "../../../common/media/vehicles/demo.actionmap.txt", keyboard, boost::bind(&Jet::addInputConditionConnection,this,_1) ); + YAKE_ASSERT( succ ).debug("failed to load action map"); // front wheel controls This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <psy...@us...> - 2007-11-12 21:59:42
|
Revision: 1888 http://yake.svn.sourceforge.net/yake/?rev=1888&view=rev Author: psyclonist Date: 2007-11-12 13:59:44 -0800 (Mon, 12 Nov 2007) Log Message: ----------- * fixed demos due to API and resource changes * [bindings.lua] fixed dll export issues * various other little fixes Modified Paths: -------------- trunk/yake/common/media/scripts/o_fsm_test.lua trunk/yake/common/media/scripts/raf1.lua trunk/yake/samples/ent/sampleEntFsm/demo.cpp trunk/yake/samples/gui/console/yakeConsoleDemo.cpp trunk/yake/samples/property/demo1/demo.cpp trunk/yake/samples/property/lua1/demo.cpp trunk/yake/samples/raf/demo1/yakeDemo.cpp trunk/yake/samples/raf/lua1/demo.cpp trunk/yake/samples/task/lua1/demo.cpp trunk/yake/scripts/msvc80/yake.suo trunk/yake/src/bindings.lua/detail/base.lua.cpp trunk/yake/src/bindings.lua/detail/ent.listener.lua.cpp trunk/yake/src/bindings.lua/detail/property.lua.cpp trunk/yake/src/bindings.lua/detail/res.lua.cpp trunk/yake/src/bindings.lua/detail/task.lua.cpp trunk/yake/src/raf/yakeApplication.cpp trunk/yake/yake/plugins/ceguiOgreRendererAdapter/pch.h Added Paths: ----------- trunk/yake/common/media/scripts/o_entity_fsm.lua trunk/yake/samples/bin/debug/sampleGuiConsole.cfg trunk/yake/samples/bin/debug/sampleRaf1.cfg trunk/yake/samples/bin/debug/sampleRafLua1.cfg Added: trunk/yake/common/media/scripts/o_entity_fsm.lua =================================================================== --- trunk/yake/common/media/scripts/o_entity_fsm.lua (rev 0) +++ trunk/yake/common/media/scripts/o_entity_fsm.lua 2007-11-12 21:59:44 UTC (rev 1888) @@ -0,0 +1,25 @@ +function onTick() + print("entity.onTick()") +end +function main() + this.events.tick:connect( onTick ) +end + +state = { + alive = { + on_enter = function() + print("entity: state.alive.on_enter()") + end, + on_tick = function() + print("entity: state.alive.on_tick()") + end, + on_exit = function() + print("entity: state.alive.on_exit()") + end, + }, + awakening = { + on_enter = function() + print("entity: state.awakening.on_enter()") + end + }, +} Modified: trunk/yake/common/media/scripts/o_fsm_test.lua =================================================================== --- trunk/yake/common/media/scripts/o_fsm_test.lua 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/common/media/scripts/o_fsm_test.lua 2007-11-12 21:59:44 UTC (rev 1888) @@ -1,10 +1,48 @@ print("> Starting object script..."); +function startup() + --this:fsm("main"):connectTo("alive",fn) -- connects to 'enter', 'tick', 'exit' + --this:fsm("main"):connectToEnter("dead",fn) -- connects to 'enter' only + --this:fsm("main"):connect("alive", fnEnter, fnTick, fnExit) + + this:events("spawn"):connect( + function() + + end + ) +end +properties = {} +properties_mt = {} + +properties_mt.__index = function(t,k) + print("INDEX",t,k) + --for u,v in pairs(t) do print(u,v) end + --return events[k] + return this:properties():get(k):get() +end +properties_mt.__newindex = function(t,k,v) + print("NEWINDEX",t,"'"..tostring(k).."'",v) + --rawset(t,k,v) + --for u,v in pairs(t) do print(u,v) end + local exists = this:properties():get(k) + if exists then + print("EXISTS") + exists:set(v) + return true + end + this:properties():create(k,v) + return true +end + +setmetatable(properties, properties_mt) + +properties.s = 1 +properties["s"] = 2 +print(properties["s"]) + event = { on_spawn = function() print(" script event.on_spawn") - --ent:postCmd("go to","jack's bar") - --OR: ev:postCmd(ent,"go to","jack's bar") - --ent:postCmd("die") + this:properties():create("ticks",0) end, on_tick = function() print(" script event.on_tick") @@ -14,6 +52,10 @@ end, -- various: onArrived = function() --triggered as a result of "go to" + end, + -- Trigger + on_toggle = function() + print("event.on_toggle") end } fsm = { @@ -30,28 +72,47 @@ } } state = { - alive = { + off = { on_enter = function() - print(" script state.alive.on_enter") + print("state.off.enter()") + + this:setCondition(function() return (this:property("ticks"):get() >= 1 and this:property("ticks"):get() <= 3) end) + this:events():get("onTriggered"):connect( function(a) print("TRIGGER:onTriggered:",a) end ) end, on_tick = function() - print(" script state.alive.on_tick") + local ticks = this:property("ticks") + if ticks then + ticks:set( ticks:get() + 1 ) + end + print("state.off.tick()") --,ticks:get() + -- + --if (state.off.ticks == 1) then + -- this:processFsmEvent("trigger") + --end + -- + --this:events():get("onTriggered"):fire(42) end, on_exit = function() - print(" script state.alive.on_exit") + print("state.off.exit()") end - }, - awakening = { + } + , + on = { on_enter = function() - print(" script state.awakening.on_enter") + print("state.on.enter()") end, on_tick = function() - print(" script state.awakening.on_tick") + local ticks = this:property("ticks") + if ticks then + ticks:set( ticks:get() + 1 ) + end + print("state.on.tick()") --,ticks:get() end, on_exit = function() - print(" script state.awakening.on_exit") + print("state.on.exit()") end - }, + } + , dead = { on_enter = function() print(" script state.dead.on_enter") @@ -63,13 +124,10 @@ print(" script state.dead.on_exit") end } - } print("> Object script up."); function main() - print("main() calling charGoTo()") - charGoTo("blah") - print("main() resuming from charGoTo()") + print("main()") end Modified: trunk/yake/common/media/scripts/raf1.lua =================================================================== --- trunk/yake/common/media/scripts/raf1.lua 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/common/media/scripts/raf1.lua 2007-11-12 21:59:44 UTC (rev 1888) @@ -2,7 +2,6 @@ local defaultCam = scene.activeCamera local actionMap = app.actionMap local input = yake.input -local objMgr = sim.objMgr -------------------------------------- -- Configure graphics @@ -37,12 +36,6 @@ cam:lookAt( yake.Point3(0,100,0) ) -- look at our ninja! -------------------------------------- --- Create objects --------------------------------------- - -local ninja = objMgr:makeObject("Entity") - --------------------------------------- -- Configure input -------------------------------------- Added: trunk/yake/samples/bin/debug/sampleGuiConsole.cfg =================================================================== --- trunk/yake/samples/bin/debug/sampleGuiConsole.cfg (rev 0) +++ trunk/yake/samples/bin/debug/sampleGuiConsole.cfg 2007-11-12 21:59:44 UTC (rev 1888) @@ -0,0 +1,20 @@ +[resource.sources] # <- evaluated by RAF +file=../../../common/media/scripts/ # <- do NOT forget trialing '/' !! +file=../../../common/media/ + +[raf.options] +useCEGUI=yes + +#----------------------------------- +[raf.startup.libraries] +# Libraries to be loaded automatically at startup + +graphicsOgre +inputOgreOIS + +#----------------------------------- +[raf.startup.systems] +# System to be created & initialized automatically + +graphics=ogre3d +input=ois Added: trunk/yake/samples/bin/debug/sampleRaf1.cfg =================================================================== --- trunk/yake/samples/bin/debug/sampleRaf1.cfg (rev 0) +++ trunk/yake/samples/bin/debug/sampleRaf1.cfg 2007-11-12 21:59:44 UTC (rev 1888) @@ -0,0 +1,16 @@ +[resource.sources] # <- evaluated by RAF +file=../../../common/media/scripts/ # <- do NOT forget trialing '/' !! + +#----------------------------------- +[raf.startup.libraries] +# Libraries to be loaded automatically at startup + +graphicsOgre +inputOgreOIS + +#----------------------------------- +[raf.startup.systems] +# System to be created & initialized automatically + +graphics=ogre3d +input=ois Added: trunk/yake/samples/bin/debug/sampleRafLua1.cfg =================================================================== --- trunk/yake/samples/bin/debug/sampleRafLua1.cfg (rev 0) +++ trunk/yake/samples/bin/debug/sampleRafLua1.cfg 2007-11-12 21:59:44 UTC (rev 1888) @@ -0,0 +1,18 @@ +[resource.sources] # <- evaluated by RAF +file=../../../common/media/scripts/ # <- do NOT forget trialing '/' !! + +#----------------------------------- +[raf.startup.libraries] +# Libraries to be loaded automatically at startup + +graphicsOgre +inputOgreOIS +scriptingLua + +#----------------------------------- +[raf.startup.systems] +# System to be created & initialized automatically + +graphics=ogre3d +input=ois +scripting=lua Modified: trunk/yake/samples/ent/sampleEntFsm/demo.cpp =================================================================== --- trunk/yake/samples/ent/sampleEntFsm/demo.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/samples/ent/sampleEntFsm/demo.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -6,212 +6,57 @@ #include "yake/plugins/scriptingLua/ScriptingSystemLua.h" #include "yake/bindings.lua/bindings.lua.h" #include "yake/bindings.lua/bindings.lua.ent.h" +#include "yake/bindings.lua/bindings.lua.ent.registry.h" #include "yake/res/res.h" -using namespace yake; +namespace yake { namespace exapp { - // Commonly used states for this application's objects. - const std::string ksAwakening = "awakening"; - const std::string ksAlive = "alive"; - const std::string ksDead = "dead"; - - /** Listens to object manager and initializes newly created objects by adding - a Lua VM, adding default states and transitions to the state machine etc. - */ - struct ExampleAppObjectMgrListener : public ent::ObjectManagerListener - { - ExampleAppObjectMgrListener(scripting::IScriptingSystem& scriptingSys) : scriptingSys_(scriptingSys) - {} - virtual void onObjectCreated(ent::Object* obj) - { - YAKE_LOG( "exappOML", "onObjectCreated: class is '" + obj->isA()->name() + "'" ); - - scripting::VMPtr vm = scriptingSys_.createVM(); - YAKE_ASSERT( vm ); - bind_all( vm.get() ); - - ent::Entity* ent = ent::Entity::cast(obj); - YAKE_ASSERT( ent ); - ent->attachVM(vm,"main"); - - if (ent::Trigger::cast(ent)) - luabind::globals( static_cast<scripting::LuaVM*>(vm.get())->getLuaState() )["this"] = ent::Trigger::cast(ent); - else - luabind::globals( static_cast<scripting::LuaVM*>(vm.get())->getLuaState() )["this"] = ent; - } - virtual void onDestroyObject(ent::Object* obj) - { - ent::Entity* ent = ent::Entity::cast(obj); - YAKE_ASSERT( ent ); - - scripting::VMPtr vm = ent->detachVM("main"); - YAKE_ASSERT( vm ); - // vm will destruct when scope is left. - } - virtual void onObjectInitialized(ent::Object* obj) - { - ent::Entity* ent = ent::Entity::cast(obj); - YAKE_ASSERT( ent ); - - ent->processFsmEvent("spawn"); - } - private: - scripting::IScriptingSystem& scriptingSys_; - }; - - struct SimpleGraphicsCo : public ent::Component - { - DECL_CO(SimpleGraphicsCo,"SimpleGraphicsCo") - }; - IMPL_CO_1(SimpleGraphicsCo,"Component") + const yake::String ksAwakening = "awakening"; + const yake::String ksAlive = "alive"; + const yake::String ksDead = "dead"; } // namespace exapp +} // namespace yake -#ifdef OOSTATE -struct oostate -{ - virtual ~oostate() {} - virtual void onEnter() {} - virtual void onExit() {} -}; -template<typename _state_class_type /*= oostate */, typename _event_type> -struct oomachine -{ - typedef _event_type event_type; - typedef _state_class_type* state_type; - oomachine() : - fnEnter_( boost::bind(&oomachine::onEnter,this,_1,_2) ), - fnExit_( boost::bind(&oomachine::onExit,this,_1,_2) ) - { - } - - void addState(const state_type); - void addTransition(const state_type, const event_type&, const state_type); - void setState(const state_type); - void processEvent(const event_type& evt); - const state_type& getCurrentFsmState() const - { return m_.current(); } -private: - typedef fsm::machine<state_type,event_type> machine_type; - void onEnter(machine_type&,const state_type&); - void onExit(machine_type&,const state_type&); -private: - machine_type machine_; - typedef boost::function<void(machine_type&,const state_type&)> CbFn; - CbFn fnEnter_; - CbFn fnExit_; -}; -template<typename _state_class_type, typename _event_type> -void oomachine<_state_class_type,_event_type>::onEnter(machine_type&,const state_type& state) -{ - YAKE_ASSERT( state ); - state->onEnter(); -} -template<typename _state_class_type, typename _event_type> -void oomachine<_state_class_type,_event_type>::onExit(machine_type&,const state_type& state) -{ - YAKE_ASSERT( state ); - state->onExit(); -} -template<typename _state_class_type, typename _event_type> -void oomachine<_state_class_type,_event_type>::addState(const state_type s) -{ - machine_.addState(s); -} -template<typename _state_class_type, typename _event_type> -void oomachine<_state_class_type,_event_type>::addTransition(const state_type from, const event_type& ev, const state_type to) -{ - machine_.addTransition( from, ev, to ); -} -template<typename _state_class_type, typename _event_type> -void oomachine<_state_class_type,_event_type>::setState(const state_type s) -{ - machine_.setState( s ); -} -template<typename _state_class_type, typename _event_type> -void oomachine<_state_class_type,_event_type>::processEvent(const event_type& evt) -{ - YAKE_ASSERT( !fnEnter_.empty() ); - machine_.processEventCb(evt, fnEnter_, fnExit_); -} -struct test_state_base -{ - virtual ~test_state_base() {} - virtual void onEnter() {} - virtual void onExit() {} -}; -typedef test_state_base* test_state_base_ptr; -namespace fsm { - template<> - inline const test_state_base_ptr& get_null_state() - { - static test_state_base* ms_null = 0; - return ms_null; - } -} -struct test_state : public test_state_base -{ - test_state(const std::string& name) : name_(name) - {} - virtual void onEnter() - { - std::cout << name_ << ".onEnter()\n"; - } - virtual void onExit() - { - std::cout << name_ << ".onExit()\n"; - } -private: - std::string name_; -}; -void test() -{ - typedef oomachine<test_state_base,std::string> machine_t; - test_state_base* first = new test_state("first"); - test_state_base* second = new test_state("second"); - - machine_t machine; - machine.addState( first ); - machine.addState( second ); - machine.setState( first ); - machine.addTransition( first, "go", second ); - machine.processEvent("go"); -} -#endif int main(int argc, char* argv[]) { + using namespace yake; try { // create and attach log listeners typedef SharedPtr<logging::log_listener> log_listener_ptr; - log_listener_ptr toStdErr( new yake::logging::stderr_listener() ); + log_listener_ptr toStdErr( new logging::stderr_listener() ); logging::addListener( toStdErr.get() ); // Setup resources res::SourceFactory::global().reg<res::FileSource>("file"); - res::SourceManager::global().addSource("file","../../common/media/scripts/"); + res::SourceManager::global().addSource("file","../../../common/media/scripts/"); // Create the scripting system we want to use (Lua). SharedPtr<scripting::IScriptingSystem> luaSys = templates::create<scripting::IScriptingSystem>("lua"); YAKE_ASSERT( luaSys.get() ); + typedef void(*FreeBinderFn)(scripting::IVM*); + luaSys->addDefaultBinder( (FreeBinderFn)&bind_all ); // Create an object manager which manages creation, initialization and destruction of objects. ent::ObjectManager objMgr; // Create & attach the listener which handles the connection to the Lua VM and the bindings. - ent::LuaObjectManagerListener luaFmsObjListener(*luaSys); + ent::LuaObjectManagerListener luaFmsObjListener(*luaSys,"main"); objMgr.attachListener( &luaFmsObjListener, "luaFsm", ent::ObjectManager::kKeepOwnership ); - // Example listener which sets the objects up for our example application :) - // The listener adds default states and transitions to the object's state machine, for example. - SharedPtr<exapp::ExampleAppObjectMgrListener> exappObjInitializer( new exapp::ExampleAppObjectMgrListener(*luaSys) ); - objMgr.attachListener( exappObjInitializer.get(), "exapp_listener", ent::ObjectManager::kKeepOwnership ); + // bind 'this binders' for Lua + ent::registerClass<ent::Object>(); + ent::registerClass<ent::Entity>(); + ent::registerClass<ent::Trigger>(); // Register object class(es) - ent::RegistrationResult ret = objMgr.registerClass<ent::Entity>("Entity"); + ent::ObjectCreationParameters params; + params.set("lua.startup",(MakeStringVector() << "o_entity_fsm.lua").get()); + ent::RegistrationResult ret = objMgr.registerClass<ent::Entity>("Entity",params); YAKE_ASSERT( ret.first == object::RC_OK ); - ret = objMgr.registerClass<ent::Trigger>("Trigger"); + ret = objMgr.registerClass<ent::Trigger>("Trigger",params); YAKE_ASSERT( ret.first == object::RC_OK ); // Create trigger @@ -224,7 +69,7 @@ objMgr.tick(); // Let's create an object. - if (false) + if (true) { //ent::Object* o = objMgr.makeObject(ret.second); // create by ClassId ent::Object* o = objMgr.makeObject("Entity"); // create by class name @@ -284,7 +129,6 @@ // clean up objMgr.destroyAllObjects(); // <- may trigger Lua callbacks. - exappObjInitializer.reset(); luaSys.reset(); } catch (yake::Exception& ex) Modified: trunk/yake/samples/gui/console/yakeConsoleDemo.cpp =================================================================== --- trunk/yake/samples/gui/console/yakeConsoleDemo.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/samples/gui/console/yakeConsoleDemo.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -45,7 +45,8 @@ #include <yake/graphics/yakeGraphicsSystem.h> #include <yake/data/yakeData.h> -#include <samples/common/exapp/yakeExampleApplication.h> +#include "yake/raf/yakeRaf.h" + #include <yake/common/yakeCEGUIRendererAdapter.h> #include <yake/common/yakeCEGUIHelpers.h> #include <yake/model/model.h> @@ -85,11 +86,9 @@ /** Application class. * Based on ExampleApplication which is often used in demos here. */ -class TheApp : public yake::exapp::ExampleApplication +class TheMainState : public raf::RtMainState { - YAKE_DECLARE_CLASS( TheApp ); private: - /// Finally declare our console type typedef yake::gui::Console< Msg, yake::gui::CEGUIInputArea, @@ -116,6 +115,8 @@ YAKE_BUILD_PHOENIX_SINGLETON( ConsoleHolder ); }; + raf::Application& mApp; + /// Viewport/Camera pairs Vector< std::pair<IViewport*,ICamera*> > mVPs; /// Graphical world @@ -133,50 +134,18 @@ LuaConsole& mConsole; public: - TheApp( ) : - ExampleApplication( true /*graphics*/, - false /*physics*/, - true /*scripting*/, - true /*input*/, - false /*script bindings*/, - false /*audio*/), + TheMainState(raf::Application& owner) : + raf::RtMainState(owner), + mApp(owner), mGuiRendererAdapter( NULL ), mConsole( ConsoleHolder::instance().getConsole() ), mEditBox( 0 ), mListBox( 0 ) - {} - - /** - * Load CEGUI renderer adapter plugin. - * @param file Plugin library file name - * @return Plugin handle - */ - ceguiadapter::RendererAdapterPlugin* loadPlugin( const String& file ) { - yake::base::Library* pDynLib = new yake::base::Library( file ); - YAKE_ASSERT( pDynLib ).debug( "Out of memory" ); - - YAKE_LOG("demo","Loading plugin " + file ); - - yake::base::YakeDynLibStartPluginFn pfnStartPlugin = (yake::base::YakeDynLibStartPluginFn)pDynLib->getSymbol( "dynlibStartPlugin" ); - YAKE_ASSERT( pfnStartPlugin ).debug( "Cannot find export in dynamic library" ); - - ceguiadapter::RendererAdapterPlugin* pPlugin = static_cast<ceguiadapter::RendererAdapterPlugin*>(pfnStartPlugin()); - YAKE_ASSERT( pPlugin ).debug( "Plugin startup function failed" ); - - // - bool bRet = pPlugin->initialise(); - YAKE_ASSERT( bRet ).debug( "Plugin initialization failed" ); - - if (!bRet) - { - delete pPlugin; - return 0; - } - - return pPlugin; + enableInstantQuitByKey( input::KC_ESCAPE ); } +#if 0 /** * Keyboard key pressed event handler. * Implements console key combinations processing. Feeds events to CEGUI. @@ -263,35 +232,9 @@ CEGUI::System::getSingleton().injectMouseMove( rDelta.x*scale, rDelta.y*scale ); } } +#endif /** - * Create camera and viewport. - * Camera is attached to viewport. Camera/Viewport pair is saved in mVPs map. - * Origin is in top-left corner. - * @param sx Starting x position of viewport in relative units [0..1] - * @param sy Starting y position of viewport in relative units [0..1] - * @param w Viewport width in relative units [0..1] - * @param h Viewport height in relative units [0..1] - * @param z Z-order of viewport - * @return Index of creaed camera/viewport pair in mVPs map - */ - int createCameraViewportPair( real sx, real sy, real w, real h, int z ) - { - ICamera* pC = mGWorld->createCamera(); - YAKE_ASSERT( pC ); - pC->setNearClipDistance( 1. ); - - pC->setFarClipDistance( 2000 ); - - mVPs.push_back( std::pair<IViewport*,ICamera*>(mGWorld->createViewport( pC ), pC) ); - size_t idx = mVPs.size()-1; - YAKE_ASSERT( mVPs[idx].first ); - mVPs[idx].first->setDimensions( sx, sy, w, h ); - mVPs[idx].first->setZ( z ); - return static_cast<int>(idx); - } - - /** * Helper method to add console message. * Used from scripts. * @param msg Message to add. @@ -315,7 +258,7 @@ if (mListBox) mConsole.setOutputWidget( mListBox ); - yake::scripting::VMPtr vm = getScriptingSystem().createVM(); + yake::scripting::VMPtr vm = mApp.getScriptingSystem()->createVM(); YAKE_ASSERT( vm ); mConsole.setScriptingVirtualMachine( vm ); @@ -329,13 +272,13 @@ using namespace luabind; module( pL->getLuaState() ) - [ - class_<TheApp>( "app" ) - .scope - [ - def( "addConsoleMessage", &TheApp::addConsoleMessage ) - ] - ]; + [ + class_<TheMainState>( "app" ) + .scope + [ + def( "addConsoleMessage", &TheMainState::addConsoleMessage ) + ] + ]; } catch (luabind::error& e) { @@ -347,7 +290,7 @@ // executing console initialisation script //pL->execute( "dofile( '../../../media/gui.addons.scripts/console_redirect.lua' );" ); - scripting::ScriptPtr script( getScriptingSystem().createScriptFromFile("../../../common/media/gui.addons.scripts/console_redirect.lua")); + scripting::ScriptPtr script( mApp.getScriptingSystem()->createScriptFromFile("gui.addons.scripts/console_redirect.lua")); pL->execute( script ); } @@ -357,134 +300,83 @@ */ void initGui() { - //mGuiRendererAdapter = loadPlugin( "CEGUIOgreAdapter" ); - mGuiRendererAdapter = loadPlugin( YAKE_DYNLIB_NAME("ceguiOgreRendererAdapter") ); - YAKE_ASSERT( mGuiRendererAdapter ); - - YAKE_LOG("demo", "Starting adapter version " + mGuiRendererAdapter->getName() ); - YAKE_LOG("demo", "Initialising CEGUI..." ); - +#if 1 try { - CEGUI::System* ceguiSys = new CEGUI::System( mGuiRendererAdapter->getRenderer() ); - ceguiSys = 0; // we don't use sys pointer but want to avoid unused variable warning + CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton(); - using namespace CEGUI; - - YAKE_LOG("demo", "Setting CEGUI logging level..." ); - - Logger::getSingleton().setLoggingLevel( Informative ); - - YAKE_LOG("demo", "Loading scheme..." ); - - SchemeManager::getSingleton().loadScheme("VanillaSkin.scheme"); - System::getSingleton().setDefaultMouseCursor("Vanilla-Images","MouseArrow"); - FontManager::getSingleton().createFont("Iconified-12.font"); - WindowManager& winMgr = WindowManager::getSingleton(); - - Window* background = winMgr.createWindow("Vanilla/StaticImage"); + /* + CEGUI::Window* background = winMgr.createWindow("Vanilla/StaticImage"); background->setArea(URect(cegui_reldim(0), cegui_reldim(0), cegui_reldim(1), cegui_reldim(1))); background->setProperty("FrameEnabled", "false"); background->setProperty("BackgroundEnabled", "false"); //@todo background->setProperty("Image", "set:BackgroundImage image:full_image"); - System::getSingleton().setGUISheet(background); - background->addChildWindow(winMgr.loadWindowLayout("VanillaConsole.layout")); + CEGUI::System::getSingleton().setGUISheet(background); + */ + CEGUI::Window* consoleWindow = winMgr.loadWindowLayout("VanillaConsole.layout"); + CEGUI::System::getSingleton().setGUISheet( consoleWindow ); + + /* + background->addChildWindow(consoleWindow); background->activate(); + */ #if 1 - mEditBox = static_cast<CEGUI::Editbox*>(CEGUI::WindowManager::getSingleton().getWindow("/Console/Wnd/Edit")); - mListBox = static_cast<CEGUI::Listbox*>(CEGUI::WindowManager::getSingleton().getWindow("/Console/Wnd/History")); + if (winMgr.isWindowPresent("/Console/Wnd/Edit")) + mEditBox = static_cast<CEGUI::Editbox*>(winMgr.getWindow("/Console/Wnd/Edit")); + if (winMgr.isWindowPresent("/Console/Wnd/History")) + mListBox = static_cast<CEGUI::Listbox*>(winMgr.getWindow("/Console/Wnd/History")); #endif } // catch to prevent exit (errors will be logged). catch( CEGUI::Exception& e) { + YAKE_LOG_ERROR( "demo", yake::String( "CEGUI Exception: " ) + e.getMessage().c_str() ); YAKE_EXCEPT( yake::String( "CEGUI Exception: " ) + e.getMessage().c_str() ); } - +#endif setupConsole(); } - - /** - * Cleanup GUI resources. - * Executed on app shutdown. - */ - void cleanupGui() +private: + virtual void onEnter() { - if ( CEGUI::System::getSingletonPtr() ) - delete CEGUI::System::getSingletonPtr(); - if (mGuiRendererAdapter) - mGuiRendererAdapter->shutdown(); - //YAKE_SAFE_DELETE( mGuiRendererAdapter ); // do NOT delete, the plugin is in the list of plugins ExampleApplication holds and will be destroyed later. - } + mApp.enableInputForCEGUI(); - /** - * Setup input events. - * Subscribe to input subsystem signals. - */ - void setupInputEvents() - { - mKeyboardEventGenerator.subscribeToKeyDown( Bind1( &TheApp::onKeyDown, this ) ); - mKeyboardEventGenerator.subscribeToKeyUp( Bind1( &TheApp::onKeyUp, this ) ); - mMouseEventGenerator.subscribeToMouseButtonDown( Bind1( &TheApp::onMBDown, this ) ); - mMouseEventGenerator.subscribeToMouseButtonUp( Bind1( &TheApp::onMBUp, this ) ); - mMouseEventGenerator.subscribeToMouseMoved( Bind1( &TheApp::onMouseMoved, this ) ); + this->getGraphicalWorld(); + // initialise gui + initGui(); } - - /** - * Setup graphics. - * Sets up graphical world and cameras/viewports. - */ - void setupGraphics() + virtual void onExit() { - mGWorld = getGraphicsSystem().createWorld(); - YAKE_ASSERT( mGWorld ); - - createCameraViewportPair( 0.0, 0.0, 1, 1, 10 ); + // Shutting down + mGWorld.reset(); } /** * Run the application main cycle. * Performs initialisation, then enters main program loop. */ - virtual void run() + virtual void onFrame(const real timeElapsed) { - // setup event input generators - setupInputEvents(); - - // graphics - setupGraphics(); - - // initialise gui - initGui(); - - // main loop - real lastTime = native::getTime(); - while (!shutdownRequested()) - { - // timing - real time = native::getTime(); - real timeElapsed = time - lastTime; - lastTime = time; - - // handle input - getInputSystem().update(); - mMouseEventGenerator.update(); - mKeyboardEventGenerator.update(); - - // render the scene - if (!shutdownRequested()) - mGWorld->render( timeElapsed ); - } - - // Shutting down - cleanupGui(); - mGWorld.reset(); } }; +/** The mighty application itself! */ +class TheApp : public raf::ExampleApplication<> +{ +public: + TheApp() + { + getConfiguration().get().load("sampleGuiConsole.cfg"); + } +private: + virtual raf::MainState* createMainState() + { + return new TheMainState(*this); + } +}; /** * Main program entry point. @@ -496,15 +388,16 @@ { try { - TheApp theApp; - theApp.initialise(); - theApp.run(); + // create and attach log listeners + typedef SharedPtr<logging::log_listener> log_listener_ptr; + log_listener_ptr toStdErr( new yake::logging::stderr_listener() ); + logging::addListener( toStdErr.get() ); + + // Use default executor for convenience. + // It's always possible to manually execute TheApp::initialise() etc. + TheApp app; + return (raf::runApplication( app )) ? 0 : 1; } - catch ( yake::Exception& rException ) - { - YAKE_LOG_ERROR( "demo", rException.what() ); - std::cin.get(); - } catch ( ... ) { YAKE_LOG_ERROR( "demo", "Caught unhandled exception." ); Modified: trunk/yake/samples/property/demo1/demo.cpp =================================================================== --- trunk/yake/samples/property/demo1/demo.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/samples/property/demo1/demo.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -88,9 +88,9 @@ ASSERT_EXCEPTION(props.add("a",makeValueProperty<int>(33)),AlreadyExistsException); ASSERT_EXCEPTION(props.get("noname"),NotFoundException); std::cout << "'a' : " << props.get("a") << "\n"; - try_cast_set<int>(props.get("a"),44); + try_set<int>(props.get("a"),44); try_cast<int>(props.get("a")).set(55); - ASSERT_EXCEPTION( try_cast_set<String>(props.get("a"),"66"), BadCastException ); + ASSERT_EXCEPTION( try_set<String>(props.get("a"),"66"), BadCastException ); std::cout << props << "\n"; } } Modified: trunk/yake/samples/property/lua1/demo.cpp =================================================================== --- trunk/yake/samples/property/lua1/demo.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/samples/property/lua1/demo.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -16,7 +16,7 @@ // Setup resources res::SourceFactory::global().reg<res::FileSource>("file"); - res::SourceManager::global().addSource("file","../../common/media/samples/"); + res::SourceManager::global().addSource("file","../../../common/media/samples/"); // init scripting VM typedef scripting::ScriptingSystemLua scripting_t; Modified: trunk/yake/samples/raf/demo1/yakeDemo.cpp =================================================================== --- trunk/yake/samples/raf/demo1/yakeDemo.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/samples/raf/demo1/yakeDemo.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -5,24 +5,6 @@ using namespace yake; -/** Configuration of the application */ -struct TheConfiguration : public raf::ApplicationConfiguration -{ - // Use "inputOgre" for Ogre 1.2/1.3, "inputOgreOIS" for Ogre 1.4+. - virtual StringVector getLibraries() - { return MakeStringVector() << YAKE_LIB("scriptingLua") << YAKE_LIB("graphicsOgre") << YAKE_LIB("inputOgreOIS"); } - - // Use "ogre" for Ogre 1.2/1.3, "ois" for Ogre 1.4+. - virtual StringVector getInputSystems() - { return MakeStringVector() << "ois"; } - - virtual StringVector getScriptingSystems() - { return MakeStringVector() << "lua"; } - - virtual StringVector getGraphicsSystems() - { return MakeStringVector() << "ogre3d"; } -}; - /** Main application state */ class TheMainState : public raf::RtMainState { @@ -47,8 +29,8 @@ // position camera and look at the ninja getDefaultCamera()->setFixedYawAxis(Vector3::kUnitY); - getDefaultCamera()->setPosition(Vector3(100,20,-400)); - getDefaultCamera()->lookAt(Vector3(0,100,0)); + getDefaultCamera()->setPosition(Point3(100,20,-400)); + getDefaultCamera()->lookAt(Point3(0,100,0)); } virtual void onFrame(const real timeElapsed) { @@ -56,10 +38,13 @@ }; /** The mighty application itself! */ -class TheApp : public raf::ExampleApplication<TheConfiguration> +class TheApp : public raf::ExampleApplication<> { public: - TheApp() {} + TheApp() + { + getConfiguration().get().load("sampleRaf1.cfg"); + } protected: virtual raf::MainState* createMainState() { @@ -71,6 +56,7 @@ { // Use default executor for convenience. // It's always possible to manually execute TheApp::initialise() etc. - return (raf::runApplication( TheApp() )) ? 0 : 1; + TheApp app; + return (raf::runApplication( app )) ? 0 : 1; } Modified: trunk/yake/samples/raf/lua1/demo.cpp =================================================================== --- trunk/yake/samples/raf/lua1/demo.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/samples/raf/lua1/demo.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -60,7 +60,7 @@ } // Create ninja model, position camera and look at the ninja: All done in Lua script: - scripting::ScriptPtr script = sys->createScriptFromFile("../../../common/media/scripts/raf1.lua"); + scripting::ScriptPtr script = sys->createScriptFromFile("raf1.lua"); vm_->execute( script ); } Modified: trunk/yake/samples/task/lua1/demo.cpp =================================================================== --- trunk/yake/samples/task/lua1/demo.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/samples/task/lua1/demo.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -1,6 +1,7 @@ #include <yake/task/task.h> #include <yake/plugins/scriptingLua/ScriptingSystemLua.h> #include <yake/bindings.lua/bindings.lua.h> +#include <yake/res/res.h> #include <luabind/luabind.hpp> @@ -9,6 +10,10 @@ using namespace yake; try { + // Setup resources + res::SourceFactory::global().reg<res::FileSource>("file"); + res::SourceManager::global().addSource("file","../../../common/media/samples/"); + // init scripting VM typedef scripting::ScriptingSystemLua scripting_t; scripting_t scriptingSys; @@ -28,8 +33,8 @@ luabind::globals(L)["sched"] = exec; // run Lua script - scripting::ScriptPtr setupScript( scriptingSys.createScriptFromFile("../../../common/media/samples/task/events.lua") ); - scripting::ScriptPtr demoScript( scriptingSys.createScriptFromFile("../../../common/media/samples/task/demo.lua") ); + scripting::ScriptPtr setupScript( scriptingSys.createScriptFromFile("task/events.lua") ); + scripting::ScriptPtr demoScript( scriptingSys.createScriptFromFile("task/demo.lua") ); vm->execute( setupScript ); vm->execute( demoScript ); Modified: trunk/yake/scripts/msvc80/yake.suo =================================================================== (Binary files differ) Modified: trunk/yake/src/bindings.lua/detail/base.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/detail/base.lua.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/src/bindings.lua/detail/base.lua.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -40,6 +40,8 @@ #include <yake/bindings.lua/common/lua.helpers.h> #include <yake/bindings.lua/common/vminfo.lua.h> +#include <yake/bindings.lua/bindings.lua.h> // for API + #include <luabind/operator.hpp> #include <luabind/adopt_policy.hpp> Modified: trunk/yake/src/bindings.lua/detail/ent.listener.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/detail/ent.listener.lua.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/src/bindings.lua/detail/ent.listener.lua.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -116,27 +116,47 @@ } #endif } + namespace detail { + void executeFsmStateHandler(scripting::VMPtr vm, const object_fsm::state_type& state, const std::string& handlerName) + { + YAKE_ASSERT( vm ); + lua_State* L = static_cast<scripting::LuaVM*>(vm.get())->getLuaState(); + luabind::object stateTbl = luabind::globals(L)["state"]; + if (stateTbl && luabind::type(stateTbl) == LUA_TTABLE) + { + luabind::object currState = stateTbl[state]; + if (currState && luabind::type(currState) == LUA_TTABLE) + { + luabind::object handler = currState[handlerName]; + if (handler && luabind::type(handler) == LUA_TFUNCTION) + { + handler(); + } + } + } + } + } // namespace detail void LuaFsmObjectListener::onFsmEnterState(Object& obj,/*const std::string& fsmName, */const object_fsm&, const object_fsm::state_type& state) { -#if 0 +#if 1 Entity* ent = Entity::cast(&obj); if (ent) { scripting::VMPtr vm = ent->getFsmVM(); YAKE_ASSERT( vm ); - detail::executeOfTable_2(*vm,"state",state,"on_enter"); + detail::executeFsmStateHandler(vm, state, "on_enter"); } #endif } void LuaFsmObjectListener::onFsmExitState(Object& obj,/*const std::string& fsmName, */const object_fsm&, const object_fsm::state_type& state) { -#if 0 +#if 1 Entity* ent = Entity::cast(&obj); if (ent) { scripting::VMPtr vm = ent->getFsmVM(); YAKE_ASSERT( vm ); - detail::executeOfTable_2(*vm,"state",state,"on_exit"); + detail::executeFsmStateHandler(vm, state, "on_exit"); } #endif } Modified: trunk/yake/src/bindings.lua/detail/property.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/detail/property.lua.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/src/bindings.lua/detail/property.lua.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -38,6 +38,7 @@ #include <yake/base/yake.h> #include <yake/property/property.h> +#include <yake/bindings.lua/bindings.lua.h> // for API #include <yake/bindings.lua/detail/private.h> #include <yake/bindings.lua/detail/property.lua.h> Modified: trunk/yake/src/bindings.lua/detail/res.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/detail/res.lua.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/src/bindings.lua/detail/res.lua.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -43,6 +43,8 @@ #include <yake/bindings.lua/detail/private.h> +#include <yake/bindings.lua/bindings.lua.h> // for API + #include <luabind/discard_result_policy.hpp> #include <luabind/iterator_policy.hpp> #include <luabind/operator.hpp> Modified: trunk/yake/src/bindings.lua/detail/task.lua.cpp =================================================================== --- trunk/yake/src/bindings.lua/detail/task.lua.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/src/bindings.lua/detail/task.lua.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -50,6 +50,8 @@ // #include <yake/base/templates/yakeSmartAssert.h> +#include <yake/bindings.lua/bindings.lua.h> // for dll export to work + #include <yake/bindings.lua/detail/private.h> #include <yake/bindings.lua/common/lua.helpers.h> #include <yake/bindings.lua/common/vminfo.lua.h> Modified: trunk/yake/src/raf/yakeApplication.cpp =================================================================== --- trunk/yake/src/raf/yakeApplication.cpp 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/src/raf/yakeApplication.cpp 2007-11-12 21:59:44 UTC (rev 1888) @@ -233,28 +233,22 @@ YAKE_LOG("raf", "Initialising CEGUI..." ); CEGUI::System* ceguiSys = new CEGUI::System( mCeguiRendererAdapter->getRenderer() ); - using namespace CEGUI; YAKE_LOG( "raf", "Setting CEGUI logging level..." ); - Logger::getSingleton().setLoggingLevel( Informative ); + CEGUI::Logger::getSingleton().setLoggingLevel( CEGUI::Informative ); try { YAKE_LOG( "raf", "Loading scheme..." ); // load scheme and set up defaults - SchemeManager::getSingleton().loadScheme((utf8*)"TaharezLook.scheme"); - System::getSingleton().setDefaultMouseCursor((utf8*)"TaharezLook", (utf8*)"MouseArrow"); + CEGUI::SchemeManager::getSingleton().loadScheme("VanillaSkin.scheme"); + CEGUI::System::getSingleton().setDefaultMouseCursor("Vanilla-Images", "MouseArrow"); CEGUI::MouseCursor::getSingleton().setImage(CEGUI::System::getSingleton().getDefaultMouseCursor()); - System::getSingleton().setDefaultFont((utf8*)"Tahoma-12"); + if (!CEGUI::FontManager::getSingleton().isFontPresent("Iconified-12")) + CEGUI::FontManager::getSingleton().createFont("Iconified-12.font"); + CEGUI::System::getSingleton().setDefaultFont("Iconified-12"); - WindowManager& wmgr = WindowManager::getSingleton(); - - //Window* sheet = wmgr.loadWindowLayout( "console.layout" ); - //System::getSingleton().setGUISheet(sheet); - - //CEGUI::Window* pEditBoxWnd = CEGUI::WindowManager::getSingleton().getWindow((CEGUI::utf8*)"/Console/Wnd/Edit"); - //mEditBox = static_cast<CEGUI::Editbox*>(CEGUI::WindowManager::getSingleton().getWindow("/Console/Wnd/Edit")); - //mListBox = static_cast<CEGUI::Listbox*>(CEGUI::WindowManager::getSingleton().getWindow("/Console/Wnd/List")); + //WindowManager& wmgr = WindowManager::getSingleton(); } // catch to prevent exit (errors will be logged). catch( CEGUI::Exception& e) Modified: trunk/yake/yake/plugins/ceguiOgreRendererAdapter/pch.h =================================================================== --- trunk/yake/yake/plugins/ceguiOgreRendererAdapter/pch.h 2007-11-08 18:40:55 UTC (rev 1887) +++ trunk/yake/yake/plugins/ceguiOgreRendererAdapter/pch.h 2007-11-12 21:59:44 UTC (rev 1888) @@ -32,7 +32,5 @@ #include <yake/scripting/yakeScriptingSystem.h> #include <yake/graphics/yakeGraphicsSystem.h> -#include <samples/common/exapp/yakeExampleApplication.h> - #include "Ogre.h" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |