Homesource Forums

Homeworld Source Editing Talk
It is currently Sun Mar 26, 2017 10:01 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Jan 28, 2007 3:35 pm 
Offline

Joined: Fri Jan 19, 2007 11:17 pm
Posts: 1
So yeah...
peotoobj.cpp
geospec.h

I used Bloodshed Dev C++. I don't have much expertise, but I got it to the point where it works. But there were a few things I would like some help on. :?:

- it generates a gmon.out file when run. I don't know what its for, and I don't know how to surpress it.
- I'd like to optimize a bit. Currently its 600KB.
- I don't know how to apply the transform matrix. Its a 4x4 array that I understand defines where sub-models (ie. turrets) are positioned relative to parent, but that's all I know.
- It generates numerous redundant textures; AFAIK, one for each closed UV set (by that I mean, each group of UVs that are connected only to other points in the group)

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 28, 2007 4:47 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
Hello Arcane, nice to see another face here.

1) gmon.out is the default output file for the GNU profiling tool gprof. The g c c compiler adds profiling code when run with the option: -pg. I can't find any documentation on Bloodshed related to profiling, so I'm afraid you will have to hunt that down where that option is set yourself. See also: gprof manual.

2) I suspect the 600KB size will dramatically decrease once the profiling code discussed in (1) is removed.

3) Applying matrices is easy but you have to be careful that you get the order right. When you multiply two matrices together you multiply the row elements from the first by the column elements of the other and add. So multiplying a normal vector by a transformation matrix (which is likely what you are dealing with) is:

Code:
A[3x3] * B[3x1] = |A11, A12, A13| * |B1|
                  |A21, A22, A23|   |B2|
                  |A31, A32, A33|   |B3|

                = |A11*B1 + A12*B2 + A13*B3|
                  |A21*B1 + A22*B2 + A23*B3|
                  |A31*B1 + A32*B2 + A33*B3|

Fortunately, you don't have to work out how to write the code to do this properly as the Homeworld source code has its own routines for doing this: src/Game/Matrix.*. "All" you have to do is work out which vectors/matrices get multiplied together.

4) On this point I will have to cite ignorance - my knowledge of PEOs, textures et al is rather limited. Hopefully someone else here can help you out with this.

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 28, 2007 5:25 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
I finally got this to compile on Mac OS X (g + + is not the same as g c c...) and my compile sizes with/without profiling aren't that much different from each other:

35220 peo2obj.profiling
35100 peo2obj

Only 120 bytes in it. Also note that the binary size is ~35kB, not the 600kB you're seeing. But then I'm on an operating system with an underlying command line environment so IO requirements are reduced. Under Windows, do you get a nice window displayed for your program to handle user input/output? If so, that's what the rest of the binary size is likely to be.

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group