22 mesaje
  • Mesaje: 48
  • Reacții: 445
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Shinsoo
  • [ID Discord]
  • Contact:

    Medalii

    NU ESTE OBLIGATORIU SA FACETI UPDATE,ESTE DOAR PENTRU CINE DORESTE!
    IN CAZ CA VRETI SA MODIFICATI MAI PUTIN FOLOSITI TUTORIALUL POSTAT PE FORUM + ARE SI FIX
    directx9-metin2-full-testat-t98.html


    Acum sa revenim la postare...
    https://postimg.cc/S2dQh1bR

    ordinea tutorialului este facut in functie de numarul folderului (1.,2.,3.)

    o sa fac update-uri la post, daca o sa faceti tutorialul si aveti probleme lasati in comentarii si o sa fixez sau postati cu fix in caz ca rezolvati

    toate resursele vor fii distruse cu o functie ce o sa fie apelata o singura data in cod(nu vor mai fii functii destroy in toate clasele)
    functie recreateResource (recreaza toate resursele cu o functie apelata o singura data)

    o sa arate ceva de genul :
    https://postimg.cc/gallery/Sp8YDdc

    UPDATE1:
    https://postimg.cc/dZZ8ZF03/b]

    O poza cu 2 cliente si cat consuma din procesor!
    https://postimg.cc/WDfFGyCs

    UPDATE2
    https://postimg.cc/gallery/FcxStNT


    UPDATE STATEMANAGER (o schimbare mica dar pentru viitoarele tutoriale o sa folosesc/elimin functii din clasa asta)
    in Citeste.txt aveti toate functiile ce trebuiesc modificate si cum trebuiesc modificate! aveti mai jos poza cu tot ce trebuie sa faceti (nu trebuie sa cautati nimic manual ,doar replace all)
    https://postimg.cc/gallery/RJhg9Dy

    UPDATE CLASA TEXTURE : MUTATA PE GPU
    In link aveti minumul ce trebuie modificat pentru a putea sa folositi noua clasa, este in lucru sa mut tot ce tine de texturi pe gpu(font,dib,sub,etc)

    Fix texturi pixelate: Din greseala am folosit mipmap ceea ce in metin nu prea e folosit...
    Fix:
    GrpTextureN.cpp -> cauta si inlocuie x2 m_desc.Levels ? m_desc.Levels : D3DX_DEFAULT
    inlocuie cu 0

    fisiere pentru comparare cod (pana la tutorialul numarul 8)
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.


    Link tutoriale:
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.


    Adaugat TextureN.cpp si .h(in ultimul tutorial avea niste lipsuri),finalizare tutorial texturi gpu
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.



    UPDATE 09.01.2026 , fix vertexbuffer dungeon(nu mai puteai intra in dungeon pentru ca nu suporta meshul cu size TPNT2) multumesc @devlimit pentru gasirea bugului
    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.




    ESTE UN MARE BUG LA TEXTURI,DECI RECOMAND MOMENTAN SA SE FACA TUTORIALELE FARA TEXTURI!
    FIXUL LA VERTEXBUFFER TREBUIE FACUT NEAPARAT!
    EXEMPLU CUM PUTETI FACE CACHE PENTRU GRANNY (ideea lui @Nermin)
    EterGrnLib/Thing.cpp
    Code:
     #include "StdAfx.h"
    #include "../eterbase/Debug.h"
    #include "Thing.h"
    #include "ThingInstance.h"
    
    struct SThingModelCache
    {
    	CGrannyModel* models;
    	int modelCount;
    	int refCount;
    	bool deviceObjectsCreated;
    };
    
    static std::unordered_map<std::string, SThingModelCache> g_ThingModelCache;
    
    bool LoadThingModelsCached(const std::string& fileName, granny_file_info* pInfo, CGrannyModel*& outModels)
    {
    	auto it = g_ThingModelCache.find(fileName);
    
    	if (it != g_ThingModelCache.end())
    	{
    		it->second.refCount++;
    		outModels = it->second.models;
    		return true;
    	}
    
    	int modelCount = pInfo->ModelCount;
    	CGrannyModel* models = new CGrannyModel[modelCount];
    
    	for (int m = 0; m < modelCount; ++m)
    	{
    		if (!models[m].CreateFromGrannyModelPointer(pInfo->Models[m]))
    		{
    			delete[] models;
    			return false;
    		}
    	}
    
    	g_ThingModelCache[fileName] = { models, modelCount, 1, false };
    	outModels = models;
    	return true;
    }
    
    void ReleaseThingModelsCached(const std::string& fileName)
    {
    	auto it = g_ThingModelCache.find(fileName);
    	if (it == g_ThingModelCache.end())
    		return;
    
    	it->second.refCount--;
    
    	if (it->second.refCount <= 0)
    	{
    		if (it->second.deviceObjectsCreated)
    		{
    			for (int m = 0; m < it->second.modelCount; ++m)
    				it->second.models[m].DestroyDeviceObjects();
    		}
    
    		delete[] it->second.models;
    		g_ThingModelCache.erase(it);
    	}
    }
    
    
    struct SThingMotionCache
    {
    	CGrannyMotion* motions;
    	int motionCount;
    	int refCount;
    };
    static std::unordered_map<std::string, SThingMotionCache> g_ThingMotionCache;
    
    bool LoadThingMotionsCached(const std::string& fileName, granny_file_info* pInfo, CGrannyMotion*& outMotions)
    {
    	auto it = g_ThingMotionCache.find(fileName);
    
    	if (it != g_ThingMotionCache.end())
    	{
    		it->second.refCount++;
    		outMotions = it->second.motions;
    		return true;
    	}
    
    	int motionCount = pInfo->AnimationCount;
    	CGrannyMotion* motions = new CGrannyMotion[motionCount];
    
    	for (int m = 0; m < motionCount; ++m)
    	{
    		if (!motions[m].BindGrannyAnimation(pInfo->Animations[m]))
    		{
    			delete[] motions;
    			return false;
    		}
    	}
    
    	g_ThingMotionCache[fileName] = { motions, motionCount, 1 };
    	outMotions = motions;
    	return true;
    }
    void ReleaseThingMotionsCached(const std::string& fileName)
    {
    	auto it = g_ThingMotionCache.find(fileName);
    	if (it == g_ThingMotionCache.end())
    		return;
    
    	it->second.refCount--;
    
    	if (it->second.refCount <= 0)
    	{
    		delete[] it->second.motions;
    		g_ThingMotionCache.erase(it);
    	}
    }
    
    
    CGraphicThing::CGraphicThing(const char* c_szFileName) : CResource(c_szFileName)
    {
    	Initialize();
    }
    
    CGraphicThing::~CGraphicThing()
    {
    	Clear();
    }
    
    void CGraphicThing::Initialize()
    {
    	m_pgrnFile = NULL;
    	m_pgrnFileInfo = NULL;
    	m_pgrnAni = NULL;
    
    	m_models = NULL;
    	m_motions = NULL;
    }
    
    void CGraphicThing::OnClear()
    {
    	if (m_motions)
    	{
    		ReleaseThingMotionsCached(GetFileNameString());
    		m_motions = nullptr;
    	}
    
    	if (m_models)
    	{
    		ReleaseThingModelsCached(GetFileNameString());
    		m_models = nullptr;
    	}
    
    	if (m_pgrnFile)
    	{
    		GrannyFreeFile(m_pgrnFile);
    		m_pgrnFile = nullptr;
    	}
    
    	m_pgrnFileInfo = nullptr;
    	m_pgrnAni = nullptr;
    }
    
    CGraphicThing::TType CGraphicThing::Type()
    {
    	static TType s_type = StringToType("CGraphicThing");
    	return s_type;
    }
    
    bool CGraphicThing::OnIsEmpty() const
    {
    	return m_pgrnFile ? false : true;
    }
    
    bool CGraphicThing::OnIsType(TType type)
    {
    	if (CGraphicThing::Type() == type)
    		return true;
    
    	return CResource::OnIsType(type);
    }
    
    bool CGraphicThing::CreateDeviceObjects()
    {
    	if (!m_pgrnFileInfo || !m_models)
    		return true;
    
    	auto it = g_ThingModelCache.find(GetFileNameString());
    	if (it == g_ThingModelCache.end())
    		return true;
    
    	if (it->second.deviceObjectsCreated)
    		return true;
    
    	for (int m = 0; m < it->second.modelCount; ++m)
    		it->second.models[m].CreateDeviceObjects();
    
    	it->second.deviceObjectsCreated = true;
    	return true;
    }
    
    void CGraphicThing::DestroyDeviceObjects()
    {
    	//if (!m_pgrnFileInfo)
    	//	return;
    
    	//for (int m = 0; m < m_pgrnFileInfo->ModelCount; ++m)
    	//{
    	//	CGrannyModel& rModel = m_models[m];
    	//	rModel.DestroyDeviceObjects();
    	//}
    }
    
    bool CGraphicThing::CheckModelIndex(int iModel) const
    {
    	if (!m_pgrnFileInfo)
    	{
    		Tracef("m_pgrnFileInfo == NULL: %s\n", GetFileName());
    		return false;
    	}
    
    	assert(m_pgrnFileInfo != NULL);
    
    	if (iModel < 0)
    		return false;
    
    	if (iModel >= m_pgrnFileInfo->ModelCount)
    		return false;
    
    	return true;
    }
    
    bool CGraphicThing::CheckMotionIndex(int iMotion) const
    {
    	// Temporary
    	if (!m_pgrnFileInfo)
    		return false;
    	// Temporary
    
    	assert(m_pgrnFileInfo != NULL);
    
    	if (iMotion < 0)
    		return false;
    
    	if (iMotion >= m_pgrnFileInfo->AnimationCount)
    		return false;
    
    	return true;
    }
    
    CGrannyModel* CGraphicThing::GetModelPointer(int iModel)
    {
    	assert(CheckModelIndex(iModel));
    	assert(m_models != NULL);
    	return m_models + iModel;
    }
    
    CGrannyMotion* CGraphicThing::GetMotionPointer(int iMotion)
    {
    	assert(CheckMotionIndex(iMotion));
    
    	if (iMotion >= m_pgrnFileInfo->AnimationCount)
    		return NULL;
    
    	assert(m_motions != NULL);
    	return (m_motions + iMotion);
    }
    
    int CGraphicThing::GetModelCount() const
    {
    	if (!m_pgrnFileInfo)
    		return 0;
    
    	return (m_pgrnFileInfo->ModelCount);
    }
    
    int CGraphicThing::GetMotionCount() const
    {
    	if (!m_pgrnFileInfo)
    		return 0;
    
    	return (m_pgrnFileInfo->AnimationCount);
    }
    
    bool CGraphicThing::OnLoad(int iSize, const void* c_pvBuf)
    {
    	if (!c_pvBuf)
    		return false;
    
    	m_pgrnFile = GrannyReadEntireFileFromMemory(iSize, (void*)c_pvBuf);
    
    	if (!m_pgrnFile)
    		return false;
    
    	m_pgrnFileInfo = GrannyGetFileInfo(m_pgrnFile);
    
    	if (!m_pgrnFileInfo)
    		return false;
    
    	LoadModels();
    	LoadMotions();
    	return true;
    }
    
    // SUPPORT_LOCAL_TEXTURE
    static std::string gs_modelLocalPath;
    
    const std::string& GetModelLocalPath()
    {
    	return gs_modelLocalPath;
    }
    // END_OF_SUPPORT_LOCAL_TEXTURE
    
    bool CGraphicThing::LoadModels()
    {
    	assert(m_pgrnFile != NULL);
    	assert(m_models == NULL);
    
    	if (m_pgrnFileInfo->ModelCount <= 0)
    		return false;
    
    	const std::string& fileName = GetFileNameString();
    
    	if (!LoadThingModelsCached(fileName, m_pgrnFileInfo, m_models))
    		return false;
    
    	GrannyFreeFileSection(m_pgrnFile, GrannyStandardRigidVertexSection);
    	GrannyFreeFileSection(m_pgrnFile, GrannyStandardRigidIndexSection);
    	GrannyFreeFileSection(m_pgrnFile, GrannyStandardDeformableIndexSection);
    	GrannyFreeFileSection(m_pgrnFile, GrannyStandardTextureSection);
    	return true;
    }
    
    bool CGraphicThing::LoadMotions()
    {
    	assert(m_pgrnFile != NULL);
    	assert(m_motions == NULL);
    
    	if (m_pgrnFileInfo->AnimationCount <= 0)
    		return false;
    
    	const std::string& fileName = GetFileNameString();
    
    	if (!LoadThingMotionsCached(fileName, m_pgrnFileInfo, m_motions))
    		return false;
    
    	return true;
    }
    

    Conținut: Ascuns
    Reacționează ❤️ la acest mesaj și conținutul se va afișa automat.
    asemanari de vertex/indexbuffer directx9(clasele create in tutorial)/directx11( in exemplul acesta), este doar o referinta pentru cine are nevoie
    [C++]update directx - Mesaj 1 - Imagine 1
    [C++]update directx - Mesaj 1 - Imagine 2

    Nou Cum descarc de pe TeraBox?

    Afișează detalii Ascunde detalii
    • Este asemănător cu Mega.nz
    • Instalați-vă clientul lor de Download de aici
    • Faceți-vă un cont (vă puteți loga cu Facebook / Google / etc)
    • Nou Dacă nu vreți să descărcați clientul de Download, folosiți acest site
    • Gata! Acum puteți descărca resursele rapid & simplu.

    De ce folosim TeraBox?

    • Este gratuit
    • Primești 1TB de spațiu gratuit la orice cont creat!
    • Este ușor de folosit și varianta premium este foarte ieftină
    • Fișierele nu sunt șterse niciodată
    TeraBox logo

    🔥 Hai pe Discord! - Chat activ și support direct

    Te așteptăm și pe serverul de Discord - aici ne-am strâns toată comunitatea de Metin2 din România.

    Alătură-te acum!
    Suntem aproape: 
    Robot Discord
    Roboțelu'
    Anunț
  • Mesaje: 15
  • Reacții: 139
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Server: Prodomo
  • Regat: Shinsoo
  • [ID Discord]
  • Contact:

    Medalii

    Mesaj de essex »

    doamne cat de tare esti nu te intereseaza un job in it?
  • Mesaje: 48
  • Reacții: 445
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Shinsoo
  • [ID Discord]
  • Contact:

    Medalii

    essex scrie: doamne cat de tare esti nu te intereseaza un job in it?
    Imi place munca ce o fac (cosmetice) .... it este doar de plictiseala,imi omor timpul
  • Mesaje: 48
  • Reacții: 445
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Shinsoo
  • [ID Discord]
  • Contact:

    Medalii

    Am adaugat Update1 (poza cu ce s-a facut)
  • Mesaje: 48
  • Reacții: 445
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Shinsoo
  • [ID Discord]
  • Contact:

    Medalii

    Update2 adaugat : VertexBuffer mutat pe gpu
  • Mesaje: 48
  • Reacții: 445
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Shinsoo
  • [ID Discord]
  • Contact:

    Medalii

    Un mic update la clasa CStateManager adaugat.
  • Mesaje: 48
  • Reacții: 445
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Shinsoo
  • [ID Discord]
  • Contact:

    Medalii

    Update: noua clasa Texture mutata pe gpu: Nu stiu de ce nu pot face editare la post,nu mai apare butonul de editare postare.
    O sa urmeze update la partea de cod pentru texturi,aceasta este inceputul(minimul de modificari ce trebuiesc facute pentru a functiona cu noua clasa).

    Poate o sa faca un moderator update la postare
    Moderator Moderator
  • Mesaje: 697
  • Reacții: 9865
  • Mesaje utile: 27
  • Status: 🚀 I'm gonna change the future!
  • Server: Nethis / Thoth
  • Regat: Chunjo
  • [ID Discord]
  • Contact:

    Medalii

    Avatar utilizator
    Moderator
    Moderator

    Mesaj de Andi »

    qPastarnac scrie: Update: noua clasa Texture mutata pe gpu: Nu stiu de ce nu pot face editare la post,nu mai apare butonul de editare postare.
    O sa urmeze update la partea de cod pentru texturi,aceasta este inceputul(minimul de modificari ce trebuiesc facute pentru a functiona cu noua clasa).

    Poate o sa faca un moderator update la postare
    Reseteaza cookies si cache din browser :x

    Trebuie sa muti imaginile pe: postimages.org
  • Mesaje: 48
  • Reacții: 445
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Shinsoo
  • [ID Discord]
  • Contact:

    Medalii

    Andi scrie:
    qPastarnac scrie: Update: noua clasa Texture mutata pe gpu: Nu stiu de ce nu pot face editare la post,nu mai apare butonul de editare postare.
    O sa urmeze update la partea de cod pentru texturi,aceasta este inceputul(minimul de modificari ce trebuiesc facute pentru a functiona cu noua clasa).

    Poate o sa faca un moderator update la postare
    Reseteaza cookies si cache din browser :x

    Trebuie sa muti imaginile pe: postimages.org
    nu am cum sa le mut ca nu le mai am si daca nu pot sa dau editare la postare degeaba, am sters acum cookies si cache si tot degeaba...
    cred ca e mai usor sa fac alta postare
  • Mesaje: 48
  • Reacții: 445
  • Mesaje utile: 0
  • Status: Pierd vremea ^.^
  • Regat: Shinsoo
  • [ID Discord]
  • Contact:

    Medalii

    In caz ca aveti probleme,as aprecia sa scrieti in comentarii problema/problemele pentru a fii rezolvate! Asta daca se poate,daca nu avem voie,mesaj in privat cu problema gasita si o sa postez si rezolvarile!

    Urmeaza:
    1.completare mutare toate texturile pe gpu
    2.RAII pentru state manager (RAII = Resource Acquisition Is Initialization,adica o sa eliminam toate functiile save si restore,se vor face automat)
    3.Un exemplu toggle fullscreen(fara fix,pe viitor o sa mut tot ce tine de config.exe direct in joc si nu o sa fie nevoie sa mai inchideti clientul pentru a schimba rezolutia,windowed sau fullscreen etc) in joc pentru a testa ca toate resursele sunt eliberate si recreate complet. Va multumesc pentru reactiile de la post!

    🔥 Hai pe Discord! - Chat activ și support direct

    Te așteptăm și pe serverul de Discord - aici ne-am strâns toată comunitatea de Metin2 din România.

    Alătură-te acum!
    Suntem aproape: 
    Robot Discord
    Roboțelu'
    Anunț
    Scrie răspuns

    Creează-ți un cont sau autentifică-te pentru a participa la discuție

    Trebuie să fii membru pentru a răspunde

    Creează-ți un cont

    Membrii pot crea subiecte noi și pot descărca resurse Metin2 Gratuit!


    Te poți înregistra sau conecta rapid utilizând contul tău de Discord, Github sau Google.

    Înregistrare

    Autentifică-te

    Înapoi la “Tutoriale”

    Informații

    Utilizatori ce navighează pe acest forum: Niciun utilizator înregistrat și 2 vizitatori

    Discord ID copiat: