RenderRequests refactoring

RenderRequests refactoring

Postby paul424 » 22 Jun 2012, 13:59

I am at the beggining of RR refactoring. The idea is to make each RR as a separate class and put it into source/RenderRequests each one as separate *.cpp file. The RR::type would disapear, cause the RR "type " would depend on called ctor. That would make 38 new classes. Also I would rewrite the ctors , not to take the pointers , but a concrete values , either int , char or string etc. as needed. I would have been already doing that , but at OD's one must consult the council of Elders first :cool:
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Re: RenderRequests refactoring

Postby oln » 22 Jun 2012, 14:23

I fully agree that this needs to be split up in classes. If they are small it might be easier to put them in one file (atleast make a separate folder). Maybe we could use functor objects (EDIT: That probably won't work). I think most of the destroy/create functions in there could be merged.

Though, maybe we should rethink the whole model instead.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: RenderRequests refactoring

Postby oln » 23 Jun 2012, 13:15

I think we should at least move the creation of "render request" into one class, so when a creature is moved we just do something like:
{l Code}: {l Select All Code}
renderer.moveCreature(nodeName, newPos)

And then that function will actually create the request object and put it on the queue to be run in the main thread.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Re: RenderRequests refactoring

Postby paul424 » 24 Jun 2012, 14:33

Well actually that just put yet another function layer , making it like rendermanager.move -> new RenderRequest , queue.push_back(rr) , dispatcher_method in RenderManager I don't remember -> the actuall render method...
Doesn't that make it too long ?
Why we cannot we just call new RenderRequestOfDesiredType ?
User avatar
paul424
OD Moderator
 
Posts: 660
Joined: 24 Jan 2012, 13:54

Re: RenderRequests refactoring

Postby oln » 24 Jun 2012, 15:11

To keep request creation out of the classes that call the function.
User avatar
oln
 
Posts: 1020
Joined: 26 Oct 2010, 22:16
Location: Norway

Who is online

Users browsing this forum: No registered users and 1 guest