Jump to content
CxL'Mufuku

[RLS]RenderTarget

Recommended Posts

lh0Yaab.png

 

Hi,

I don't think I have to tell much about this.

It'll look like the official one, some code is c&p from the official root files.

Most of the own written code is NOT like the offical one.

I added a new python module ("renderTarget"), so you don't need methods which officials use, like this: "playerm2g2.MyShopDecoShow( True )"

You are able to display more than one render target at the same time.

 

If you want to know more, take a look at the code.

 

If there are any bugs, just message me.

 

Download:

https://mega.nz/#!VCp3RLBb!iu_ZLasFkk8uDVcfEdAHfBx_vqDy9g7WMlMGIM39HCg

Password: Cxl.Services

  • Love 27
  • Sad 1

Share this post


Link to post

I don't tested ingame just looked a little bit to codes probably there is have a memory leak,  doesn't exist any exception handler and a typo issue.

 

Quote

    auto pTex = new CGraphicRenderTargetTexture;
    if (!pTex->Create(width, height, D3DFMT_X8R8G8B8, D3DFMT_D16)) {
        delete pTex;
        TraceError("CRenderTarget::CRenderTarget: Could not create CGraphicRenderTargetTexture %dx%d", width, height);
        throw std::runtime_error("CRenderTarget::CRenderTarget: Could not create CGraphicRenderTargetTexture");
    }

    m_renderTargetTexture = std::unique_ptr<CGraphicRenderTargetTexture>(pTex);

 

you can modify with; (not tested)

Quote

    auto pTex = std::make_shared<CGraphicRenderTargetTexture>();
    if (!pTex->Create(width, height, D3DFMT_X8R8G8B8, D3DFMT_D16)) 
    {
        TraceError("CRenderTarget::CRenderTarget: Could not create CGraphicRenderTargetTexture %u%u", width, height);
        PostQuitMessage(0);
    }

    m_renderTargetTexture = std::unique_ptr<CGraphicRenderTargetTexture>(*pTex);

 

  • Love 2

Share this post


Link to post
vor 1 Stunde schrieb Koray:

I don't tested ingame just looked a little bit to codes probably there is have a memory leak,  doesn't exist any exception handler and a typo issue.

As far as I remember your code will crash, however, there will be no problem if you init the unique pointer with the raw pointer (as long as you won't delete the object via the raw pointer)

But you're right with the TraceError it should be %u, but I am quite sure no one will ever get this error.

Also the exception should work without problems, it will show an error and close the client.- I think it's just a matter of ones own liking.

711ca08e8.jpg

Share this post


Link to post

image.thumb.png.3d1a10972c8134ad5775dfebc29ec38e.pngI have this error:
Compilator intern error in grprendertargettexture.h and i dont know why 😕

And this is the line

RECT	m_renderRect{};

 

Share this post


Link to post
vor 4 Stunden schrieb ѕeмa™:

Great that you got it working by yourself.

I don't have time to test, but you shoud be able to remove the {} After that it should compile without the hotfix. (The bracets are some "magic" of resharper)

vor 1 Minute schrieb jackdagostino:

what exactly does this do? sorry, I'm Italian I do not understand English well

It's the "ingame granny/model viewer" of the officials. It's used there for the shop decoration and monster card system. Ofc you can do much more with it. 

  • Love 1

Share this post


Link to post
hace 1 minuto, CxL'Mufuku dijo:

Great that you got it working by yourself.

I don't have time to test, but you shoud be able to remove the {} After that it should compile without the hotfix. (The bracets are some "magic" of resharper)

 

Yes it works but the animation doesnt work for me idk why, still searching...

Share this post


Link to post

Yep

a1d5d7e13a185028696386affc3b187e.png

hace 1 minuto, CxL'Mufuku dijo:

Seems like its not calling RenderModels, did you add it correctly?

 

3ab49ad7b4e9.jpg

 

Share this post


Link to post
vor 2 Minuten schrieb ѕeмa™:

Yep

a1d5d7e13a185028696386affc3b187e.png

 

hmm. PERF_CHECKER_RENDER_GAME is set to false? You could check it with TraceError("test..."); after RenderModels();

(Idk, if debug mode will change something on this var)

Share this post


Link to post
hace 2 minutos, CxL'Mufuku dijo:

hmm. PERF_CHECKER_RENDER_GAME is set to false? You could check it with TraceError("test..."); after RenderModels();

(Idk, if debug mode will change something on this var)

Yes it is false, and i use distribute mode

bf39cfd6fe7a30fec2bac6710ebc19e9.png

Share this post


Link to post
vor 3 Minuten schrieb ѕeмa™:

Yes it is false, and i use distribute mode

bf39cfd6fe7a30fec2bac6710ebc19e9.png

Well it's difficult without seeing your source.

However, have a look at the "AlwaysRender" part, it could be that too.

Share this post


Link to post
9 hours ago, ѕeмa™ said:

Yes it works but the animation doesnt work for me idk why, still searching...

 

PythonApplication.cpp

find -> void CPythonApplication::UpdateGame()

find -> DWORD t3=ELTimer_GetMSec();

add before -> m_kRenderTargetManager.UpdateModels();

Share this post


Link to post
hace 5 horas, Sumnix dijo:

PythonApplication.cpp

find -> void CPythonApplication::UpdateGame()

find -> DWORD t3=ELTimer_GetMSec();

add before -> m_kRenderTargetManager.UpdateModels();

 

Solved.
The problem was updatemodels after a return in 

    if (!PERF_CHECKER_RENDER_GAME)
    {

 

i didnt saw that .... anyway thanks all of you.

  • Love 1

Share this post


Link to post
1 hour ago, ѕeмa™ said:

 

Solved.
The problem was updatemodels after a return in 

    if (!PERF_CHECKER_RENDER_GAME)
    {

 

i didnt saw that .... anyway thanks all of you.

Can you share with all users here? 

Share this post


Link to post
il y a 1 minute, Kori a dit :

Can you share with all users here? 

 

It's not that hard.

	if (!PERF_CHECKER_RENDER_GAME)
	{
		m_kRenderTargetManager.RenderBackgrounds();
		float fAspect=m_kWndMgr.GetAspect();
		float fFarClip=m_pyBackground.GetFarClip();

		m_pyGraphic.SetPerspective(30.0f, fAspect, 100.0, fFarClip);

		CCullingManager::Instance().Process();

		m_kChrMgr.Deform();
		m_kEftMgr.Update();
		m_kRenderTargetManager.DeformModels();

 

Share this post


Link to post
3 minutes ago, Mário. said:

 

It's not that hard.


	if (!PERF_CHECKER_RENDER_GAME)
	{
		m_kRenderTargetManager.RenderBackgrounds();
		float fAspect=m_kWndMgr.GetAspect();
		float fFarClip=m_pyBackground.GetFarClip();

		m_pyGraphic.SetPerspective(30.0f, fAspect, 100.0, fFarClip);

		CCullingManager::Instance().Process();

		m_kChrMgr.Deform();
		m_kEftMgr.Update();
		m_kRenderTargetManager.DeformModels();

 

Thats right but we know all the new users cant make this and i cant post im online with my phone now xD

Share this post


Link to post

 

hace 1 hora, Kori dijo:

Thats right but we know all the new users cant make this and i cant post im online with my phone now xD

Oh sorry i thought it was easy to understand, anyway its already explained by Mario.

Thanks again to all of you

  • Love 1

Share this post


Link to post
23 minutes ago, ѕeмa™ said:

 

Oh sorry i thought it was easy to understand, anyway its already explained by Mario.

Thanks again to all of you

I have 2 questions

 

The system works really good but:

first can i add here hair or armor ?
https://gyazo.com/a41c28b43e901ea82d95035a1f2c66ca

 

secound can i make this for armors and weapons too not only for mobs ?

  • Love 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.