State of the Code

Re: State of the Code

Postby StefanP.MUC » 12 Apr 2011, 11:54

Yes, forget it... It's up now. ;)
StefanP.MUC
 

Re: State of the Code

Postby svenskmand » 13 Apr 2011, 14:17

Where did the VERSION number variable go in the Defines.h file? The file is gone :S I need it in my tarball scripts :S
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: State of the Code

Postby StefanP.MUC » 13 Apr 2011, 14:28

It's now a static const std::string ODApplcation::VERSION. This was part of the globals removal.
StefanP.MUC
 

Re: State of the Code

Postby oln » 13 Apr 2011, 15:00

Ideally, it should be generated by cmake.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby svenskmand » 13 Apr 2011, 15:37

I just need some place to greb it from when making the tarball. But if you can make cmake put it somewhere convenient that would be nice :)
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: State of the Code

Postby oln » 13 Apr 2011, 23:43

I noticed that the goal window and the resource windows get redrawn (as in the text get's reset) each frame, which is unnecessary and steals a lot of cpu power. Will try to fix this.
EDIT: The stats display as well. Don't really need to update them more than a few times per second at most.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby oln » 18 Apr 2011, 16:52

Pushed a commit adding some shutdown functionality. Most things are now deleted and cleaned up properly when exiting, and the segfault on exit issue seems to be mostly gone.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby StefanP.MUC » 18 Apr 2011, 17:18

Nice. But couldn't this directly go into the destructor?
StefanP.MUC
 

Re: State of the Code

Postby oln » 18 Apr 2011, 17:27

I'm not sure. Some of the threads rely on checking the frame listener object to see if they should stop, which might not work if it's called from the destructor.
It also allows stopping the game without deleting the object, which will be useful when we want to be able to exit a game and start a new one.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby oln » 27 Apr 2011, 16:12

Pushed a commit with a log manager/wrapper class for the ogre log manager. So we should print all output there instead of to stdout directly. This way we can control the output level. (e.g most people don't need all the debug info.)
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby StefanP.MUC » 29 Apr 2011, 15:01

What stuff should be logged generally and what not?

I see a lot of cout and cerr with stuff like this (both commented out an not commented out):
"now variable X is this and that"
"now loading this and that"
"loading file 1", "loading file 2", ... "loading file N"
"finished loading"
"not loaded anything"

A lot of them seem not really needed to me.
StefanP.MUC
 

Re: State of the Code

Postby oln » 29 Apr 2011, 15:24

Yeah, that was some of the reason for this. Stuff like that can be set to the lowest log level, so we can turn it on if we want to see it, but not print it per default.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby oln » 30 Apr 2011, 13:18

Pushed a commit implementing the home path in windows, and that fixes compilation in visual studio again. Also fixed a bunch of warnings.
Included the dirent.h file for VC++. Make sure to allways include dirent with angle brackets "<>" so that it will get the system one if it exists.
EDIT: okay, that didn't work properly apparently. Trying to fix.
EDIT: Fixed.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby StefanP.MUC » 30 Apr 2011, 13:56

With the latest code I get now a bunch of errors (I only copied a single error if there were more than of it):

{l Code}: {l Select All Code}
'LPWSTR' does not name a type   opendungeons_src      line 25, external location: c:\mingw\include\Userenv.h   C/C++ Problem
'LPSTR' does not name a type   opendungeons_src      line 19, external location: c:\mingw\include\Userenv.h   C/C++ Problem
'HANDLE' does not name a type   opendungeons_src      line 30, external location: c:\mingw\include\Userenv.h   C/C++ Problem
'DWORD' does not name a type   opendungeons_src      line 24, external location: c:\mingw\include\Userenv.h   C/C++ Problem
'BOOL' does not name a type   opendungeons_src      line 40, external location: c:\mingw\include\Userenv.h   C/C++ Problem
'::GetUserProfileDirectoryW' has not been declared   ResourceManager.cpp   /opendungeons_src/src   line 148   C/C++ Problem
'::_get_errno' has not been declared   ResourceManager.cpp   /opendungeons_src/src   line 190   C/C++ Problem
StefanP.MUC
 

Re: State of the Code

Postby oln » 30 Apr 2011, 14:48

Okay, may have to include an extra file or two for mingw. I will have a look at this.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby oln » 30 Apr 2011, 15:58

Should be fixed now.
EDIT: Or not, my bad
EDIT2: Now it's fixed.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby StefanP.MUC » 30 Apr 2011, 16:45

One minor thing is left: It creates the folder correctly, but the files are named ".OpenDungeonsopendungeons.log" and ".OpenDungeonsogre.cfg" (NEXT TO the folder) instead of ".OpenDungeons/opendungeons.log" (IN the folder).

just pushed the commit with the changes to tinygettext. Now it shares every logging and resource managment with the OD core and only provides the actual translation part.
StefanP.MUC
 

Re: State of the Code

Postby oln » 30 Apr 2011, 17:28

Ah, right. That should be a quick fix. Just add the slashes after the folder name when it's generated.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby svenskmand » 01 May 2011, 21:01

Oln@ you mentioned that you added a log wrapper. Is it not possible to get all the stuff printed in the terminal from where you run the program put into a log file? In which case which options should I call OD with to enable this?
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: State of the Code

Postby oln » 01 May 2011, 23:56

I have added it, but most of the code doesn't use it yet. The stuff that is printed to it will be sent to the terminal as well as a log file. Should probably have some option to control this behaviour.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby svenskmand » 02 May 2011, 01:32

Now that optimization has come up lately (which is probably also the right time) I think wrapping the cout statements in ifdef DEBUG would be the right way to go, then we can compile with the DEBUG flag on and avoid all the branching code that surrounds the cout statements.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: State of the Code

Postby oln » 02 May 2011, 15:22

Yeah, that's some of the idea with the log wrapper. I don't know if we should just use the log-level settings for all messages (e.g checking at runtime), or if we should have a debug-print version that only runs the code in debug-mode.
Critical error messages should generally allways be printed out. Thinking about making a "printCriticalError()" function or similar that will pop up a dialog box on windows. (Shouldn't be too hard to implement.) All this will make it easier to find errors for people running windows, as it's a bit tricky to get the stdout output there.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby svenskmand » 28 Jul 2011, 00:26

I have now added support for the My Documents\Open Dungeons folder to save userconfig files, screenshots, replays, etc. in. The path to the place to put these files is now stored in a single line in user_files.cfg in the root OD directory. The same file is also used on Linux, here I make it point to ~/.opendungeons in the deb-package and finally in the tarball releases user_files.cfg should just contain "." to indicate that files will be save in the root OD directory. If people compiling from source wants them stored somewhere else they can edit the file themself.

So now you just need to take this file user_files.cfg into account in the game.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Re: State of the Code

Postby oln » 04 Aug 2011, 13:14

Just pushed a commit to git and svn, adding support for using the ogre rtshader system. (And removing some files that were not needed.) I can then start to make a shader extension based on what MyEmail suggested that will colour tiles for the right team.

I have also done some changes to the lights, reducing intensities of most lights, reducing flicker radius (the flickering lights were jumping all over the place), and temporarily removed the lights that pop up when tiles are claimed.
I think it might be an idea to change the flickering lights to vary intensity instead of position.
Anyhow, the lighting looks rather crappy at the moment, as some materials have material values set, and some don't. I think we will have to do some experimenting here to see what looks best.
Also, I haven't finished changing all materials to use RTSS per-pixel lighting or RTSS normal mapping yet.

I added a function in the resource manager for doing folder creation as we now also need a folder for cached shaders. I didn't add much, just moved some code into a function, but I haven't tested the change on windows, so someone will have to test this.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: State of the Code

Postby svenskmand » 04 Aug 2011, 14:27

Nice :)

svenskmand {l Wrote}:I have now added support for the My Documents\Open Dungeons folder to save userconfig files, screenshots, replays, etc. in. The path to the place to put these files is now stored in a single line in user_files.cfg in the root OD directory. The same file is also used on Linux, here I make it point to ~/.opendungeons in the deb-package and finally in the tarball releases user_files.cfg should just contain "." to indicate that files will be save in the root OD directory. If people compiling from source wants them stored somewhere else they can edit the file themself.

So now you just need to take this file user_files.cfg into account in the game.

I just made a new bug for this on the bugtracker.
Jamendo.com - The best music store on the net, uses CC licenses.
User avatar
svenskmand
OD Moderator
 
Posts: 1850
Joined: 09 Dec 2009, 00:07
Location: Denmark

Who is online

Users browsing this forum: No registered users and 0 guests

cron