Newcomer with a few patches

Development directions, tasks, and features being actively implemented or pursued by the development team.
Post Reply
vincele
Merchant
Merchant
Posts: 35
Joined: Mon Jul 04, 2011 5:32 pm

Newcomer with a few patches

Post by vincele »

Hello,

I'm trying to get on board with VS code, and got a few patches during my reading.

I've put them in the SF tracker:
https://sourceforge.net/tracker/?func=d ... tid=319507
https://sourceforge.net/tracker/?func=d ... tid=319507
https://sourceforge.net/tracker/?func=d ... tid=319507
https://sourceforge.net/tracker/?func=d ... tid=319507

Can someone review them and tell me if this kind of work is useful for you ?

Thanks a lot for all your work, it's impressive.
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Newcomer with a few patches

Post by loki1950 »

Welcome aboard Vince haven't looked at the patches yet not at home ATM but someone with commit rights will most likely have a look very soon.

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
vincele
Merchant
Merchant
Posts: 35
Joined: Mon Jul 04, 2011 5:32 pm

Re: Newcomer with a few patches

Post by vincele »

Thanks,

there's something strange with SF, some of my patches were submitted
multiple times, and I don't know how that happened, I just used the "back"
browser feature...

Sorry for the dupes...
loki1950
The Shepherd
Posts: 5841
Joined: Fri May 13, 2005 8:37 pm
Location: Ottawa
Contact:

Re: Newcomer with a few patches

Post by loki1950 »

there's something strange with SF,
That's nothing new :twisted: Some features work and others a constant WIP :shock:

Enjoy the Choice :)
my box::HP Envy i5-6400 @2Q70GHzx4 8 Gb ram/1 Tb(Win10 64)/3 Tb Mint 19.2/GTX745 4Gb acer S243HL K222HQL
Q8200/Asus P5QDLX/8 Gb ram/WD 2Tb 2-500 G HD/GF GT640 2Gb Mint 17.3 64 bit Win 10 32 bit acer and Lenovo ideapad 320-15ARB Win 10/Mint 19.2
CLoneWolf
ISO Party Member
ISO Party Member
Posts: 443
Joined: Thu May 01, 2008 5:14 pm

Re: Newcomer with a few patches

Post by CLoneWolf »

vincele wrote:there's something strange with SF, some of my patches were submitted
multiple times, and I don't know how that happened, I just used the "back"
browser feature...
That's because some website submitting processes are actually made of 2 steps with an automatic redirection inbetween; so, if you only back by one you won't go back to where the submit button was, but to the real submitting process, that gets executed again :wink:
You might also notice that on some website logins (seen at least on one of my webmail providers) where going back by one makes you see the authentication step in progress again instead of bringing you back to the login/password screen.
vincele
Merchant
Merchant
Posts: 35
Joined: Mon Jul 04, 2011 5:32 pm

Re: Newcomer with a few patches

Post by vincele »

Hello,

contnuing my walkthrough VS code, i created another batch of patches, and put them in the patch tracker.
I've done fairly finegrained ones so that they can be independently discussed/accepted/rejected.

I'll revisit the min/max cleanup one with the comments in mind...

In the mean time, I'd like to be educated about the QVector class, I couldn't find where it comes from,
maybe I'm blind, but then google was of little help, which is kind of strange...

Thanks folks
log0

Re: Newcomer with a few patches

Post by log0 »

QVector class, I couldn't find where it comes from
From ugly macro stuff in vec.h. Cool that you're doing some cleanup/refactoring.

Btw, I've noticed some extensive use of global variables and extern declarations in vs that are really bad practice imho. I wonder what is the stance of the developers regarding this?
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: Newcomer with a few patches

Post by strook »

There are some globals and externs in vs_globals.h and similar headers.

But why do you earse them? There is np using them.

The real big problem are some defines and classes that have the same name as some very important stuff in ogre and Macosx.

The main stuff that should be changed are in my first patch for the Linux version.

The other stuff in order to get it running with Macosx is making namespaces for the gui classes and the collide classes.

Then if you want to get it running with Macosx, you need to create a main.cpp replacement by objective c, which is done in the vegaogre version 184.

If you don't need this at all there is really no reason why changing the globals exept you want programming on vegastrike more complicated. :roll:
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
vincele
Merchant
Merchant
Posts: 35
Joined: Mon Jul 04, 2011 5:32 pm

Re: Newcomer with a few patches

Post by vincele »

I remove the extern / fwd decls that are unused in the source files, they clutter the code and impair
readability for no good. They are probably leftovers from old code that has been chaged / removed.

I tried hard to check that I don't remove used declarations or variables, but I only compile-checked
on a single linux configuration...

I'm only doing small scale cleanups that should be straigtforward and cosmetical, as I'm not quite
confident enough with my understanding of the VS codebase in general to do more now. I hope this
is OK with other devs and not impacting their in-progress work.

I'm still contemplating the (huge) task of removing the boatload of commented out code which is
scattered all over the place. Is this really useful to someone ? I think source control software is here
to help keep that out of sight, but at the same time diggable out of the graveyard...

Any comment on that last idea ?
vincele
Merchant
Merchant
Posts: 35
Joined: Mon Jul 04, 2011 5:32 pm

Re: Newcomer with a few patches

Post by vincele »

Thanks Log0 for the pointer.
I had read those files (vec & xvector) already, without realizing how... "creative" this stuff is.
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: Newcomer with a few patches

Post by strook »

it would be - from my side - better, if you accomplish some tasks that bring something useful up that the user can "see". just because a newcomer to the vs code as you are can't overview all of the code, there is no need to truncate it.

for every vegaogre update to the actual vs trunk i need one day minimum doing nasty boring work.

why don't you make some tasks like the modification i wanted to implement in the killers mod: an modified subunit class, so that units made from multiple subunits can be made in an useful way. cause every subunit has its own python script, and that makes creating many units with those subunits unuseful slow.

you just need to add an parameter for example ..., bool python = true) to the unit creation and remove the python usage then in the units. if it is false.

i'm overwhelmed with the ogre part in the moment and have no time to do it.

look in the killers mod forum for more infos on it.

also there are more requests like leech weapons etc.

discuss your own modification,

or you can help me out with the ogre part if you whish.

also it ain't be boring as removing some unused stuff.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
log0

Re: Newcomer with a few patches

Post by log0 »

Sorry for hijacking the thread vincele.
There are some globals and externs in vs_globals.h and similar headers.
But why do you earse them? There is np using them.
No I don't mean the externs in the headers, although one could also ask why they are actually needed? I mean the 382 extern declarations in 117 source files(.cpp). This is a freaking minefield. You have no idea/overview what state is going to be modified where and why, are forced to scan through the source files looking for side effects. It also has been one of the stoppers for my idea use vs shaders/meshes in ogre(something that is also missing in your branch). There are header files in c/c++ to declare interfaces and absolutely no need to resort to externs.
it would be - from my side - better, if you accomplish some tasks that bring something useful up that the user can "see". just because a newcomer to the vs code as you are can't overview all of the code, there is no need to truncate it.
I think it is a quite natural behavior. He is actually trying to get an overview and fix things that are misleading or broken on the way. This will of course collide with others work and should be reviewed.
vincele
Merchant
Merchant
Posts: 35
Joined: Mon Jul 04, 2011 5:32 pm

Re: Newcomer with a few patches

Post by vincele »

log0 wrote:Sorry for hijacking the thread vincele.
No problem
log0 wrote:I think it is a quite natural behavior. He is actually trying to get an overview and fix things that are misleading or broken on the way. This will of course collide with others work and should be reviewed.
Yeah, exactly, if I could do more involved things right now, I already would be...
And I don't think cleanups are useless, even if it's not visible to users.

I think I discovered/fixed bugs in the process, maybe not the most visible ones, but still...
I try to split in small/easily mergeable / reviewable pieces so as to not bother too much the ones doing bigger stuff.

I'm now going though the python code in data/module and OMG, there's a lot of potential things to be fixed here too. I'm wondering how much coverage this gets, there's obviously buggy code in there,
like unused variable usage that'll lead to exceptions being raised, etc...

Should I bother splitting what I've already done in small digestible pieces or not ?
I've got that: 45 files changed, 148 insertions(+), 268 deletions(-) for data/modules/*.py
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: Newcomer with a few patches

Post by strook »

Log0: well I expect variables to be used as they are named - meaning if I declare a variable extern "isOgreApp" I expect that it won't e changed furthermore after initialization and declares wether the ogre extension is used.

Well I wasn't long time to 100% familiar with externs and now, too, but I know that they can be used to reuse stuff that is declared in other .cpp files.

The main advantage is that you can quasi initialize header variables to be used global.
Also you have the advantage if you have more than one lib defined in your project, that you can declare and initialize variables over library boundaries without linker errors. Forth and back.

Also the reason why I found unrecoverable errors in vegaogre Mac version was : I moved to another computer and updated Macosx. Maybe the error was in updating, I checked everything I couldn't reveal it and there were no other installation reports from other users.
Also if you mean why I didn't develop integrating vs Into ogre anymore, because I had to reinvent the vs wheel anew.
So I went to integrating ogre in vs.

Actually I'm thinking about an ogre overlay modus like a 3d cockpit. I successfully rendered render-to-texture images in ogre. Soley the conversion to a vs image makes probs yet cause I need to make it more thhread save and use direct draw images.

I'll texturize a planet with it in order to see if it works.

After that maybe I can inject rendered vegaogre images into the vs rendering pipeline, thus using the z-buffer. And making it quasi 3d. I need to synchronize the viewports first.

But this doesn't happen tomowwow 8)
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: Newcomer with a few patches

Post by strook »

Vincele, ok if you are removing bugs let your fixes roll on. Why don't you work on my ogre branch, then ? Removing bugs? :D

I don't know wether all the moderators are silent in the moment, but they said to me when I have a working seamless flight , my mod will be added.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
log0

Re: Newcomer with a few patches

Post by log0 »

Why don't you work on my ogre branch, then ? Removing bugs?
Hey, good idea. The vs trunk activity has been rather low since release.
they can be used to reuse stuff that is declared in other .cpp files.
Extern has it use cases. You insist on having global variables, well:

Code: Select all

// foo.h
extern int bar;  // declaration
// foo.c
#include "foo.h"
int bar;  // definition
I know I am maybe alone with this opinion. But I still insist that global variables are bad and should be avoided if possible.

For instance VS is accessing global state in functions by means of extern(in cpp files). If you need to modify external state in a function, pass it as a parameter. This is additionally self documenting as it is obvious from the header files what state is modified by the function. It is all about writing code not only for yourself but also for others. But I digress.
vincele
Merchant
Merchant
Posts: 35
Joined: Mon Jul 04, 2011 5:32 pm

Re: Newcomer with a few patches

Post by vincele »

log0 wrote:I know I am maybe alone with this opinion. But I still insist that global variables are bad and should be avoided if possible
I'm kinda with you on this but there may be exceptions, for example a _theUniverse or _theConfig pointer that you won't want to pass as parameter all over your codebase...
log0

Re: Newcomer with a few patches

Post by log0 »

for example a _theUniverse or _theConfig pointer that you won't want to pass as parameter all over your codebase...
Then I would ask why the codebase is dependent on passing this pointers? I would at least wrap them with proper getter/setter functions. What about wrapping the whole global state this way, creating appropriate headers, removing extern decls?
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: Newcomer with a few patches

Post by strook »

im not shure if you can manage such a big code conversion, cause it can have many side effects.

for example i'm using boost::thread and ogre and so i need to use static classes i think this is the best way to manage it:

Code: Select all

header:

class MyClass
{
    static getSingletonPtr() { return m_pSingleton; }
    constructors etc...
private:
    static MyClass *m_pSingleton;
};
source:

MyClass* MyClass::m_pSingleton = 0;

MyClass::MyClass() 
{
    if(m_pSingleton)
        throw error;
    m_pSingleton = this;
   ....
}
this creates a static func to get a pointer to the only one object.

in oger, there is a Singleton class, but i'm not shure wether we should mix up vs and ogre code.

actually it runs in a different thread, but ogre is included in a precompiled header, so such things could also be done with the Singleton class from ogre.

but there is also one problem i'm facing in the moment when using statics.

you get problems with boost::thread.

cause the mutex must be also static, if you want to access static vars, vou need to review a large ammount of code (well me :mrgreen: )
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: Newcomer with a few patches

Post by strook »

log0 wrote:
Why don't you work on my ogre branch, then ? Removing bugs?
Hey, good idea. The vs trunk activity has been rather low since release.

great :mrgreen: i'll create an account on my site for you. are you familiar with svn?
you need to create your own branch.
how about access to the trunk? do you think we could manage it creating a trunk on which we work both together?
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: Newcomer with a few patches

Post by strook »

i made an account for you, log0, on my site. vincele, you need first create an sourceforge account or give me your sourceforge account name.

ask me if you have questions with svn releasing.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
strook
ISO Party Member
ISO Party Member
Posts: 461
Joined: Fri Sep 03, 2010 12:10 pm

Re: Newcomer with a few patches

Post by strook »

made a trunk of vegastrike_patched. it is now thread-save, in order to make it thread-save i had to modify the getSingletonPtr() func and install a mutex there.

unfortunately , there is still an error in the render-to-texture mechanism: the rendered image won't be copied into the buffer in ogre. i'll have to google about it. the error is common.
plz visit my vegastrike project branch here

plz support VegaOgre by donating to it!

My systems: Mac mini 1, 4gig RAM;
i5 Quad Core 2400, 300mbit WLAN, 1,3Tbyte HD, 60 GB SSD,
nvidia geforce 8400gs 512MB, 6gig RAM with Ubuntu 11.4,
win7 and hackintosh installed
charlieg
Elite Mercenary
Elite Mercenary
Posts: 1329
Joined: Thu Mar 27, 2003 11:51 pm
Location: Manchester, UK
Contact:

Re: Newcomer with a few patches

Post by charlieg »

Hi vincele.

Probably a bit late but I think the patch tracker is a bit disused and these days patches are posted to CodeStriker:
https://sourceforge.net/apps/codestrike ... striker.pl
Free Gamer - free software games compendium and commentary!
FreeGameDev forum - open source game development community
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Re: Newcomer with a few patches

Post by klauss »

Fxxxck...

I was supposed to get notifications of patches posted to the patch tracker.

I did get a few, but certainly not all. Weird.

Anyway, I prefer it if people use the trackers. Forum posts are difficult to keep track of, yet the tracker, whose not misleading name implies, is easier to track, is a much better fit for patches and bug reports.

I really don't have time to read all forum posts, but bug reports are easier to sort out in limited time.

I'll start reading those patches, even if trivial, there's no reason not to apply them if they don't break anything.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
vincele
Merchant
Merchant
Posts: 35
Joined: Mon Jul 04, 2011 5:32 pm

Re: Newcomer with a few patches

Post by vincele »

Reviving this old thread since some patche still looks relevant to trunk branch.

Any up to date info on which branch dev should be done ?
I'll port the patches to the relevant branch, but isn't trunk going to be stale if everything is done elsewhere ?

Have I missed an up to date dev wiki page that explains that kind of things ? As I got a bit lost in there...
Post Reply