wired pointer

why after delete a pointer , it’s not be null?????//

* 0xABABABAB : Used by Microsoft’s HeapAlloc() to mark “no man’s land" guard bytes after allocated heap memory
* 0xABADCAFE : A startup to this value to initialize all free memory to catch errant pointers
* 0xBAADF00D : Used by Microsoft’s LocalAlloc(LMEM_FIXED) to mark uninitialised allocated heap memory
* 0xBADCAB1E : Error Code returned to the Microsoft eVC debugger when connection is severed to the debugger
* 0xBEEFCACE : Used by Microsoft .NET as a magic number in resource files
* 0xCCCCCCCC : Used by Microsoft’s C++ debugging runtime library to mark uninitialised stack memory
* 0xCDCDCDCD : Used by Microsoft’s C++ debugging runtime library to mark uninitialised heap memory
* 0xDEADDEAD : A Microsoft Windows STOP Error code used when the user manually initiates the crash.
* 0xFDFDFDFD : Used by Microsoft’s C++ debugging heap to mark “no man’s land" guard bytes before and after allocated heap memory
* 0xFEEEFEEE : Used by Microsoft’s HeapFree() to mark freed heap memory

reference: http://www.codeguru.com/forum/archive/index.php/t-325259.html


VS 2010: 修改VC++的繼承的inclde目錄跟Lib目錄



所以他有一個GLOBAL的設定,直接選擇VC++ directories Inherit 就能使用

檔名是這樣的 Microsoft.cpp.[Platform].users.props (會在安裝時產生)



用property manager編輯也是可以

參考: http://blogs.msdn.com/b/vcblog/archive/2010/03/02/visual-studio-2010-c-project-upgrade-guide.aspx



I am currently working on the equipping technique for the characters in our game. Regarding the paint-on-armor(cloth leather chain) it is rather easy by assigning different materials to the desired SubEntities. For the modelled armor pieces like plate armor I am a little bit stuck now, I have searched around on the boards and in the wiki but cannot find the real clue. Attaching to bone doesnt seem to be a good option.

Is it possible to load a different mesh into a submesh and how does it work? Should I load all the gear in one go from the start and set the SubEntities to invisible untill i need them or what would be the best method to change the equipment on a game-character?

Thanks in advance

A:You’re on the right track.

Attaching to bones is not the way to go for clothing. It works well for equipment (guns, swords, etc) and maybe some accesories (hat, holster, etc) but woul dnot work well for armour.

Building your model with all conceivable geometries (leather vs plate vs robe) in seperate subentities and then enabling/disabling as needed is a good way to go. A lot of games go this way.

You could also building your character out of components (leather torso vs plate torso vs robe torso) and attach/assembled limbs and heads as needed. A lot of game go this way (probably more than above).

Each has pros and cons. The first has some more overhead in terms of animation and vert/poly counts — not sure how “smart" OGRE is in ignoring/optimising invisible subentities (but I would guess pretty smart).

The second way can be harder in terms of managing animation (crashing polys, seams, etc), but has some added benefits in terms of being able to easily detach components (i.e. decapitation and dismemberment), plus customizability options may be easier to do.

If you want something fast/eas(ish), go with 1. If you want something a little more robust/extensible, go with two.

You can’t “swap" them but you can set them visible/invisible using


You could do it this way if you have a low number of combinations, but it’s a bad idea if you have hundreds of pieces of clothing. With a few pieces, it’s a decent idea though.

If you have lots of combinations, I think your best bet is to have a base character mesh, with bones and skeleton, animations, etc. Then have additional pieces that you share the skeleton with.

So for example, if a naked character is ok for your base mesh, use it. Let’s say you want your character wearing armor. You’d model your armor in your 3d program and bind it to the same skeleton structure as your base mesh. All bones have to exist with the same names, positions and orientations.

Then in Ogre you can use:


That means as one animates, it animates both at the same time. I got this working through a bit of trial and error. I can’t remember the problems I had but they were minor.

In the end, for a full system, you probably need a combination of the following:

1. Attaching certain pieces to bones
2. Sharing the skeleton between some pieces
3. Attaching equipment to the same scene node as the base mesh and playing the same animation name. For example, let’s say you have a robe that has special animation for the robe cloth, you can’t use #2 because it’ll have different bones and special skeletal animation.

Anyhow, good luck. Also you should look into the Ogre files yourself – you could have found the answer to the SubEntity->setVisible problem in like 2 seconds.

Mac, Subversion

SVN-Server on Macbook

很久以前用微軟的vss做版本控制,後來改用公司的SVN。 自己寫程式要做版本控制只有自己架svn server來用。因為Leopard已經內建了svn 1.4.4跟apache所以使用mac不失為一個好方法。


1. 隨意一個地方建立
# mkdir /users/kevin/repos

2. 建立第一個專案
# svnadmin create /users/kevin/repos/myfirstproject

# mate /users/kevin/repos/myfirstproject/conf/svnserve.conf
# svnserve -d –listen-port=3690  (開啓SVN伺服器服務)
# killall svnserve(刪掉svn server)

# cd /users/kevin/repos
# mkdir myNowWork (目前的工作目錄)
# cd myNowWork
# sudo svn co file:///users/kevin/repos/myfirstproject (從指定的路徑checkout出最新版本)
# cd myfirstproject (剛剛抓下來的專案)
# sudo svn mkdir  trunk (隨便建一個目錄)
# sudo svn ci -m “first commit" 把剛剛建好的目錄commit回去


改天再來做 svn server讓多人使用的

網路上參考到這篇 http://asuralyc.blogspot.com/2009/05/svn-websvn-ssl-trac-on-leopard.html

Mac, Rails

Ruby, Rails and MySQL with Leopard 10.5.2 and XCode 3.0



上一篇似乎解決了安裝gem mysql但是…

上網找了一下 發現原來是XCode裝的Ruby搞的鬼


1. 先打mysql_config可以看到一些參數
lin-kevinde-macbook:music_library Kevin$ mysql_config
Usage: /usr/local/mysql/bin/mysql_config [OPTIONS]
–include [-I/usr/local/mysql/include]
–libs [-L/usr/local/mysql/lib -lmysqlclient -lz -lm -lmygcc]
–libs_r [-L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -lmygcc]
–plugindir [/usr/local/mysql/lib/plugin]
–socket [/tmp/mysql.sock]
–port [0]
–version [5.1.36]
–libmysqld-libs [-L/usr/local/mysql/lib -lmysqld -ldl -lz -lm -lmygcc]

2. 把cflags的都複製起來,放到ARCHFLAGS裡
sudo env ARCHFLAGS="-g -Os -arch i386 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL" gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config

sudo env ARCHFLAGS="-g -Os -arch i386 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL" ruby extconf.rb –with-mysql-include=/usr/local/mysql/include –with-mysql-lib=/usr/local/mysql/lib –with-mysql-dir=/usr/local/mysql –with-mysql-config=/usr/local/mysql/bin/mysql_config

4. 接著就
make install 就成功了

參考 http://cho.hapgoods.com/wordpress/?p=158