mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-11-03 23:56:47 +00:00 
			
		
		
		
	ESSImport: convert global map markers
This commit is contained in:
		
							parent
							
								
									c354f48a07
								
							
						
					
					
						commit
						e484a91708
					
				
					 3 changed files with 20 additions and 2 deletions
				
			
		| 
						 | 
					@ -76,6 +76,12 @@ namespace ESSImport
 | 
				
			||||||
        cell.mName = id;
 | 
					        cell.mName = id;
 | 
				
			||||||
        cell.load(esm, false);
 | 
					        cell.load(esm, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // I wonder what 0x40 does?
 | 
				
			||||||
 | 
					        if (cell.isExterior() && cell.mData.mFlags & 0x20)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            mContext->mGlobalMapState.mMarkers.insert(std::make_pair(cell.mData.mX, cell.mData.mY));
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // note if the player is in a nameless exterior cell, we will assign the cellId later based on player position
 | 
					        // note if the player is in a nameless exterior cell, we will assign the cellId later based on player position
 | 
				
			||||||
        if (id == mContext->mPlayerCellName)
 | 
					        if (id == mContext->mPlayerCellName)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					@ -304,6 +310,10 @@ namespace ESSImport
 | 
				
			||||||
            it->save(esm);
 | 
					            it->save(esm);
 | 
				
			||||||
            esm.endRecord(ESM::REC_MARK);
 | 
					            esm.endRecord(ESM::REC_MARK);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        esm.startRecord(ESM::REC_GMAP);
 | 
				
			||||||
 | 
					        mContext->mGlobalMapState.save(esm);
 | 
				
			||||||
 | 
					        esm.endRecord(ESM::REC_GMAP);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -123,7 +123,7 @@ namespace ESSImport
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (i >= file2.mRecords.size())
 | 
					            if (i >= file2.mRecords.size())
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                std::cout << "Record in file1 not present in file2: (1) 0x" << std::hex << rec.mFileOffset;
 | 
					                std::cout << "Record in file1 not present in file2: (1) 0x" << std::hex << rec.mFileOffset << std::endl;
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -142,7 +142,7 @@ namespace ESSImport
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (j >= rec2.mSubrecords.size())
 | 
					                if (j >= rec2.mSubrecords.size())
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    std::cout << "Subrecord in file1 not present in file2: (1) 0x" << std::hex << sub.mFileOffset;
 | 
					                    std::cout << "Subrecord in file1 not present in file2: (1) 0x" << std::hex << sub.mFileOffset << std::endl;
 | 
				
			||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,6 +6,7 @@
 | 
				
			||||||
#include <components/esm/loadnpc.hpp>
 | 
					#include <components/esm/loadnpc.hpp>
 | 
				
			||||||
#include <components/esm/player.hpp>
 | 
					#include <components/esm/player.hpp>
 | 
				
			||||||
#include <components/esm/dialoguestate.hpp>
 | 
					#include <components/esm/dialoguestate.hpp>
 | 
				
			||||||
 | 
					#include <components/esm/globalmap.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "importnpcc.hpp"
 | 
					#include "importnpcc.hpp"
 | 
				
			||||||
#include "importcrec.hpp"
 | 
					#include "importcrec.hpp"
 | 
				
			||||||
| 
						 | 
					@ -28,6 +29,8 @@ namespace ESSImport
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        ESM::DialogueState mDialogueState;
 | 
					        ESM::DialogueState mDialogueState;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        ESM::GlobalMap mGlobalMapState;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        int mDay, mMonth, mYear;
 | 
					        int mDay, mMonth, mYear;
 | 
				
			||||||
        float mHour;
 | 
					        float mHour;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,6 +51,11 @@ namespace ESSImport
 | 
				
			||||||
            mPlayer.mCurrentCrimeId = 0; // TODO
 | 
					            mPlayer.mCurrentCrimeId = 0; // TODO
 | 
				
			||||||
            mPlayer.mObject.blank();
 | 
					            mPlayer.mObject.blank();
 | 
				
			||||||
            mPlayer.mObject.mRef.mRefID = "player"; // REFR.mRefID would be PlayerSaveGame
 | 
					            mPlayer.mObject.mRef.mRefID = "player"; // REFR.mRefID would be PlayerSaveGame
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            mGlobalMapState.mBounds.mMinX = 0;
 | 
				
			||||||
 | 
					            mGlobalMapState.mBounds.mMaxX = 0;
 | 
				
			||||||
 | 
					            mGlobalMapState.mBounds.mMinY = 0;
 | 
				
			||||||
 | 
					            mGlobalMapState.mBounds.mMaxY = 0;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue