﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-你的CPP=我的CPP-随笔分类-Game</title><link>http://www.cppblog.com/chenfeng/category/5844.html</link><description>&lt;span style="color:#000000; font:12px;"&gt;唾沫是用来数钞票滴，不是用来讲道理的&lt;/span&gt;</description><language>zh-cn</language><lastBuildDate>Fri, 04 Jul 2008 15:39:03 GMT</lastBuildDate><pubDate>Fri, 04 Jul 2008 15:39:03 GMT</pubDate><ttl>60</ttl><item><title>Lua学习之--util.lua</title><link>http://www.cppblog.com/chenfeng/archive/2008/07/04/55350.html</link><dc:creator>晨风</dc:creator><author>晨风</author><pubDate>Fri, 04 Jul 2008 07:32:00 GMT</pubDate><guid>http://www.cppblog.com/chenfeng/archive/2008/07/04/55350.html</guid><wfw:comment>http://www.cppblog.com/chenfeng/comments/55350.html</wfw:comment><comments>http://www.cppblog.com/chenfeng/archive/2008/07/04/55350.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/chenfeng/comments/commentRss/55350.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/chenfeng/services/trackbacks/55350.html</trackback:ping><description><![CDATA[<p>-- util.lua<br>-- Common Lua Function<br>-- Author: Liu Denghong<br>-- Date: 20080702</p>
<p>require "liu"</p>
<p>liu.util = liu.util or {version = 0.1;};<br>liu.util.Print=function(msg)<br>&nbsp; print(msg);<br>end;</p>
<p>-- Min<br>liu.util.Min = function(a,b)<br>&nbsp; return (a&lt;b and a) or b;<br>end;</p>
<p>-- Max<br>liu.util.Max = function(a,b)<br>&nbsp; return (a&gt;b and a) or b;<br>end;</p>
<p><br>-- IsTrue<br>liu.util.IsTrue = function(a)<br>&nbsp; return (a~=false and a~=nil);<br>end;</p>
<p><br>-- 只适用于表: a={"liu","deng","hong"};<br>-- 不适用于记录型表: b={name="liu", name1="deng", name2="hong"}<br>-- 等价于ipairs(t)<br>liu.util.TableIter = function(t)<br>&nbsp; local i = 0<br>&nbsp; local n = table.getn(t)</p>
<p>&nbsp; return function ()<br>&nbsp;&nbsp;&nbsp; i = i + 1<br>&nbsp;&nbsp;&nbsp; if i &lt;= n then return t[i] end<br>&nbsp; end <br>end</p>
<p>&nbsp;</p>
<img src ="http://www.cppblog.com/chenfeng/aggbug/55350.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/chenfeng/" target="_blank">晨风</a> 2008-07-04 15:32 <a href="http://www.cppblog.com/chenfeng/archive/2008/07/04/55350.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>lua学习之--liu.lua</title><link>http://www.cppblog.com/chenfeng/archive/2008/07/02/55122.html</link><dc:creator>晨风</dc:creator><author>晨风</author><pubDate>Wed, 02 Jul 2008 03:03:00 GMT</pubDate><guid>http://www.cppblog.com/chenfeng/archive/2008/07/02/55122.html</guid><wfw:comment>http://www.cppblog.com/chenfeng/comments/55122.html</wfw:comment><comments>http://www.cppblog.com/chenfeng/archive/2008/07/02/55122.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/chenfeng/comments/commentRss/55122.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/chenfeng/services/trackbacks/55122.html</trackback:ping><description><![CDATA[<p>-- liu.lua<br>-- Common Lua Function<br>-- Author: Liu Denghong<br>-- Date: 20080630</p>
<p>liu = liu or {version='0.1';};</p>
<p>-- Examp: liu.Apply(liu, {a=1,b=2});<br>liu.Apply = function(o, c, defaults)<br>&nbsp; if defaults then<br>&nbsp;&nbsp;&nbsp; liu.Apply(o, defaults);<br>&nbsp; end<br>&nbsp; if (o and c and type(c)=="table") then<br>&nbsp;&nbsp;&nbsp; for p,v in pairs(c) do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; o[p] = v;<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp; end<br>end</p>
<p>liu.Apply(liu, {<br>&nbsp; EmptyFn = function() end;</p>
<p>&nbsp; Num = function(v, defaultValue)<br>&nbsp;&nbsp;&nbsp; if(type(v) ~= "number") then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return defaultValue;<br>&nbsp;&nbsp;&nbsp; end<br>&nbsp;&nbsp;&nbsp; return v;<br>&nbsp; end;</p>
<p>});</p>
<p>&nbsp;</p>
<img src ="http://www.cppblog.com/chenfeng/aggbug/55122.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/chenfeng/" target="_blank">晨风</a> 2008-07-02 11:03 <a href="http://www.cppblog.com/chenfeng/archive/2008/07/02/55122.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于DirectX中的圆形天空顶</title><link>http://www.cppblog.com/chenfeng/archive/2008/03/18/44754.html</link><dc:creator>晨风</dc:creator><author>晨风</author><pubDate>Tue, 18 Mar 2008 05:36:00 GMT</pubDate><guid>http://www.cppblog.com/chenfeng/archive/2008/03/18/44754.html</guid><wfw:comment>http://www.cppblog.com/chenfeng/comments/44754.html</wfw:comment><comments>http://www.cppblog.com/chenfeng/archive/2008/03/18/44754.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/chenfeng/comments/commentRss/44754.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/chenfeng/services/trackbacks/44754.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;藕看到&lt;&lt;3D场景中的圆形天空顶&gt;&gt;一文,照上面写了下面的directX 9 代码， 这里只有一个空的线框模型。&nbsp;// SkyBody.hpp&nbsp;#include &lt;d3dx9.h&gt;&nbsp;#define PI&nbsp; 3.1415926535897f#define DTOR (PI/180.0f...&nbsp;&nbsp;<a href='http://www.cppblog.com/chenfeng/archive/2008/03/18/44754.html'>阅读全文</a><img src ="http://www.cppblog.com/chenfeng/aggbug/44754.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/chenfeng/" target="_blank">晨风</a> 2008-03-18 13:36 <a href="http://www.cppblog.com/chenfeng/archive/2008/03/18/44754.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>