This commit is contained in:
Ian Brown 2020-09-15 22:58:56 +01:00
parent 18a06af6f7
commit 296a493159
3 changed files with 42 additions and 1 deletions

View file

@ -76,10 +76,17 @@ set(TESTAPP_SRC_FILES
TestApp/ModelWindow.cpp
)
set(CUTTOWN_SRC_FILES
CuttownTest/Main.cpp
)
add_library(snowlib STATIC ${SNOWLIB_SRC_FILES})
add_executable(testApp ${TESTAPP_SRC_FILES})
target_link_libraries(testApp snowlib ${Boost_LIBRARIES} ${GLEW_LIBRARIES} SDL2::SDL2 SDL2::SDL2main opengl32.lib)
add_executable(cuttownTest ${CUTTOWN_SRC_FILES})
target_link_libraries(cuttownTest snowlib ${Boost_LIBRARIES} ${GLEW_LIBRARIES} SDL2::SDL2 SDL2::SDL2main opengl32.lib)
#include(BoostTestHelpers.cmake)

33
CuttownTest/Main.cpp Normal file
View file

@ -0,0 +1,33 @@
#pragma once
#include "SDL.h"
#include "windows.h"
#include "LmpRepository.h"
#include "GobFile.h"
#include "VifDecoder.h"
#include "TexDecoder.h"
#include "AnimDecoder.h"
#include "Model.h"
#include "Texture.h"
#include "AnimData.h"
#include "WorldReader.h"
#include "World.h"
LmpRepository* lmpRepository;
int main(int argc, char **argv) {
string dataPath = "D:\\emu\\bgda\\BG\\DATA\\";
if (argc == 2){
dataPath = argv[1];
}
lmpRepository = new LmpRepositoryImpl(dataPath, GameType::DARK_ALLIANCE);
GobFile cuttownGob = GobFile(dataPath + "CUTTOWN.GOB", GameType::DARK_ALLIANCE);
World* world = WorldReader().readWorld(&cuttownGob, "cuttown");
return 0;
}

View file

@ -48,7 +48,8 @@ void WorldReader::decodeWorldFile(World* world, const unsigned char* data, int d
int offset60 = DataUtil::getLEInt(data, 0x60);
int textureArrayOffset = DataUtil::getLEInt(data, 0x64);
int offset68 = DataUtil::getLEInt(data, 0x68);
int offsetTex6C = DataUtil::getLEInt(data, 0x6C);
int worldTexOffsetsOffset = DataUtil::getLEInt(data, 0x6C);
}
void WorldReader::decodeTopography(World* world, const unsigned char* data, int dataLength)