Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "Did not find 'name' and/or 'val' tags in a chunk palette!" error… #92

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ option(MCPE_VIZ_PROFILE "Build profile version" OFF)
# old flags: -fno-builtin-memcmp -pthread

# cflags useful for all builds
add_definitions(-Wall -Wextra -Wshadow -Wpointer-arith -Wdisabled-optimization -std=c++11 -DDLLX=)
add_definitions(-DDLLX=)

if(MCPE_VIZ_WIN32)

Expand Down Expand Up @@ -79,7 +79,7 @@ else()
endif()
endif()

add_executable(mcpe_viz mcpe_viz.cc mcpe_viz.xml.cc mcpe_viz.nbt.cc mcpe_viz.util.cc)
add_executable(mcpe_viz mcpe_viz.cc mcpe_viz.xml.cc mcpe_viz.nbt.cc mcpe_viz.util.cc getopt.c)

find_package(PNG REQUIRED)
find_package(ZLIB REQUIRED)
Expand All @@ -91,20 +91,18 @@ include_directories(${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR
# setup include dirs and lib dirs for each build type
# set win32/win64 builds to use static libs when possible
if(MCPE_VIZ_WIN32)
include_directories(libnbtplusplus/wbuild .)
target_link_libraries(mcpe_viz
${PROJECT_SOURCE_DIR}/leveldb-mcpe/wbuild/libleveldb.a
${PROJECT_SOURCE_DIR}/libnbtplusplus/wbuild/libnbt++.a
${PROJECT_SOURCE_DIR}/leveldb-mcpe/Win32/Release/leveldb.lib
${PROJECT_SOURCE_DIR}/libnbtplusplus/build32/Release/nbt++.lib
${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${LIBXML2_LIBRARIES})
# 2016.01.30 - disabled
#set_target_properties(mcpe_viz PROPERTIES LINK_SEARCH_START_STATIC 1)
#set_target_properties(mcpe_viz PROPERTIES LINK_SEARCH_END_STATIC 1)
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
elseif(MCPE_VIZ_WIN64)
include_directories(libnbtplusplus/wbuild64 .)
target_link_libraries(mcpe_viz
${PROJECT_SOURCE_DIR}/leveldb-mcpe/wbuild64/libleveldb.a
${PROJECT_SOURCE_DIR}/libnbtplusplus/wbuild64/libnbt++.a
${PROJECT_SOURCE_DIR}/leveldb-mcpe/x64/Release/leveldb.lib
${PROJECT_SOURCE_DIR}/libnbtplusplus/build64/Release/nbt++.lib
${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${LIBXML2_LIBRARIES})
# 2016.01.30 - disabled
#set_target_properties(mcpe_viz PROPERTIES LINK_SEARCH_START_STATIC 1)
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
# MCPE Viz for Visual Studio
by Marzipan42

Fork of Plethora777's MCPE Viz with mods to compile using Microsoft Visual Studio 2019

If you just want to run the compiled program:
* grab mcpe_viz_helper.win32.zip if you have 32-bit Windows or mcpe_viz_helper.win64.zip if you have 64-bit Windows
* expand the zip file and run mcpe_viz_helper.exe
* program requires the latest version of the Microsoft Visual C 2019 Runtime installed on your machine. 32-bit installer is at https://aka.ms/vs/16/release/vc_redist.x86.exe,
64-bit installer is at https://aka.ms/vs/16/release/vc_redist.x64.exe
* program will not run on Windows XP - sorry!

If you want to compile yourself, read on.

Compilation tested on: Windows 10 64-bit v1909, Visual Studio 2019 Professional 16.4.0

To build, do the following from a cmd.exe window:
* git clone https://github.com/marzipan42/mcpe_viz.git
* cd mcpe_viz
* powershell .\\_01_mygetdeps.ps1
* downloads leveldb-mcpe, libnbtplusplus, libxml2, libpng, zlib
* _02_mybuild.bat > mybuildlog.txt 2>&1
* builds dependencies and mcpe_viz, final output goes in mcpe_viz_helper.win32 and mcpe_viz_helper.win64 directories
* note that mcpe_viz_helper is not being built fresh - the compiled exe and required dll's have simply been copied from Plethora777's mcpe_viz_helper.winXX.zip files
* _03_myclean.bat
* this removes all intermediate build files but leaves the mcpe_viz_helper.winXX directories

Note that compilation on any other platform (Mingw, Linux, Mac, VS before 2019) is probably broken in this fork.

Original MCPE Viz README follows...
---
# MCPE Viz
by Plethora777 -- Twitter: [@Plethora777](https://twitter.com/Plethora777) -- Reddit: [/u/Plethora777](https://www.reddit.com/user/Plethora777/)

Expand Down
11 changes: 11 additions & 0 deletions _01_mygetdeps.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
git clone https://github.com/marzipan42/leveldb-mcpe.git
git clone https://github.com/marzipan42/libnbtplusplus.git

curl "http://xmlsoft.org/sources/libxml2-2.9.10.tar.gz" -OutFile libxml2-2.9.10.tar.gz
curl "https://managedway.dl.sourceforge.net/project/libpng/libpng16/1.6.37/lpng1637.zip" -OutFile lpng1637.zip
curl "https://www.zlib.net/zlib1211.zip" -OutFile zlib1211.zip

# native tar added to powershell in windows 10 1803
tar zxvf libxml2-2.9.10.tar.gz
expand-archive lpng1637.zip .
expand-archive zlib1211.zip .
165 changes: 165 additions & 0 deletions _02_mybuild.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\VsDevCmd.bat"

mkdir zlib
mkdir zlib\Win32
mkdir zlib\x64
mkdir zlib\include
cd zlib-1.2.11

mkdir build32
cd build32
cmake -A Win32 -DCMAKE_INSTALL_PREFIX=install ..
move ..\zconf.h.included ..\zconf.h
msbuild INSTALL.vcxproj -m -t:Rebuild -p:Configuration=Release -p:Platform=Win32
copy install\include\* ..\..\zlib\include
copy install\bin\* ..\..\zlib\Win32
copy install\lib\* ..\..\zlib\Win32
cd ..

mkdir build64
cd build64
cmake -A x64 -DCMAKE_INSTALL_PREFIX=install ..
move ..\zconf.h.included ..\zconf.h
msbuild INSTALL.vcxproj -m -t:Rebuild -p:Configuration=Release -p:Platform=x64
copy install\bin\* ..\..\zlib\x64
copy install\lib\* ..\..\zlib\x64
cd ..

cd ..

mkdir libpng
mkdir libpng\Win32
mkdir libpng\x64
mkdir libpng\include
cd lpng1637

mkdir build32
cd build32
cmake -A Win32 -DZLIB_LIBRARY=..\..\zlib\Win32\zlib.lib -DZLIB_INCLUDE_DIR=..\..\zlib\include -DCMAKE_INSTALL_PREFIX=install ..
msbuild INSTALL.vcxproj -m -t:Rebuild -p:Configuration=Release -p:Platform=Win32
copy install\include\* ..\..\libpng\include
copy install\bin\* ..\..\libpng\Win32
copy install\lib\* ..\..\libpng\Win32
cd ..

mkdir build64
cd build64
cmake -A x64 -DZLIB_LIBRARY=..\..\zlib\x64\zlib.lib -DZLIB_INCLUDE_DIR=..\..\zlib\include -DCMAKE_INSTALL_PREFIX=install ..
msbuild INSTALL.vcxproj -m -t:Rebuild -p:Configuration=Release -p:Platform=x64
copy install\bin\* ..\..\libpng\x64
copy install\lib\* ..\..\libpng\x64
cd ..

cd ..

mkdir libxml2
mkdir libxml2\Win32
mkdir libxml2\x64
mkdir libxml2\include
cd libxml2-2.9.10
copy include\libxml\xmlversion.h xmlversion.h.orig

cd win32
cscript configure.js compiler=msvc prefix=install iconv=no

setlocal
call "c:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars32.bat"
nmake -f Makefile install
move install\include\libxml2\libxml ..\..\libxml2\include
copy install\bin\libxml2.dll ..\..\libxml2\Win32
copy install\lib\libxml2.lib ..\..\libxml2\Win32
rmdir /s /q install
nmake -f Makefile clean
endlocal

setlocal
call "c:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Auxiliary\Build\vcvars64.bat"
nmake -f Makefile install
copy install\bin\libxml2.dll ..\..\libxml2\x64
copy install\lib\libxml2.lib ..\..\libxml2\x64
rmdir /s /q install
nmake -f Makefile distclean
endlocal

cd ..\..

cd libnbtplusplus

mkdir build32
cd build32
cmake -A Win32 -DZLIB_LIBRARY=..\..\zlib\Win32\zlib.lib -DZLIB_INCLUDE_DIR=..\..\zlib\include -DCMAKE_INSTALL_PREFIX=install -DNBT_BUILD_TESTS=OFF ..
msbuild libnbt++.sln -m -t:Rebuild -p:Configuration=Release -p:Platform=Win32
cd ..

mkdir build64
cd build64
cmake -A x64 -DZLIB_LIBRARY=..\..\zlib\x64\zlib.lib -DZLIB_INCLUDE_DIR=..\..\zlib\include -DCMAKE_INSTALL_PREFIX=install -DNBT_BUILD_TESTS=OFF ..
msbuild libnbt++.sln -m -t:Rebuild -p:Configuration=Release -p:Platform=x64
copy nbt_export.h ..\include
cd ..

cd ..

cd leveldb-mcpe

msbuild leveldb.sln -m -t:Rebuild -p:Configuration=Release -p:Platform=x86
mkdir Win32
move Release Win32

msbuild leveldb.sln -m -t:Rebuild -p:Configuration=Release -p:Platform=x64

cd ..

mkdir build32
cd build32
cmake -A Win32 -DMCPE_VIZ_WIN32=ON -DZLIB_LIBRARY=..\zlib\Win32\zlib.lib -DZLIB_INCLUDE_DIR=..\zlib\include -DPNG_LIBRARY=..\libpng\Win32\libpng16.lib -DPNG_PNG_INCLUDE_DIR=..\libpng\include -DLIBXML2_LIBRARY=..\libxml2\Win32\libxml2.lib -DLIBXML2_INCLUDE_DIR=..\libxml2\include ..
msbuild mcpe_viz.sln -m -t:Rebuild -p:Configuration=Release -p:Platform=Win32
copy ..\zlib\Win32\zlib.dll Release
copy ..\libpng\Win32\libpng16.dll Release
copy ..\libxml2\Win32\libxml2.dll Release
copy ..\leveldb-mcpe\Win32\Release\leveldb.dll Release
cd ..

mkdir build64
cd build64
cmake -A x64 -DMCPE_VIZ_WIN64=ON -DZLIB_LIBRARY=..\zlib\x64\zlib.lib -DZLIB_INCLUDE_DIR=..\zlib\include -DPNG_LIBRARY=..\libpng\x64\libpng16.lib -DPNG_PNG_INCLUDE_DIR=..\libpng\include -DLIBXML2_LIBRARY=..\libxml2\x64\libxml2.lib -DLIBXML2_INCLUDE_DIR=..\libxml2\include ..
msbuild mcpe_viz.sln -m -t:Rebuild -p:Configuration=Release -p:Platform=x64
copy ..\zlib\x64\zlib.dll Release
copy ..\libpng\x64\libpng16.dll Release
copy ..\libxml2\x64\libxml2.dll Release
copy ..\leveldb-mcpe\x64\Release\leveldb.dll Release
cd ..

mkdir mcpe_viz_helper.win32
copy mcpe_viz_helper_win_builds\Win32\* mcpe_viz_helper.win32
copy build32\Release\leveldb.dll mcpe_viz_helper.win32
copy build32\Release\libpng16.dll mcpe_viz_helper.win32
copy build32\Release\libxml2.dll mcpe_viz_helper.win32
copy build32\Release\mcpe_viz.exe mcpe_viz_helper.win32
copy build32\Release\zlib.dll mcpe_viz_helper.win32
xcopy /i images mcpe_viz_helper.win32\images
xcopy /i js mcpe_viz_helper.win32\js
copy mcpe_viz.cfg mcpe_viz_helper.win32
copy mcpe_viz.css mcpe_viz_helper.win32
copy mcpe_viz.js mcpe_viz_helper.win32
copy mcpe_viz.xml mcpe_viz_helper.win32
copy mcpe_viz.html.template mcpe_viz_helper.win32
copy LICENSE mcpe_viz_helper.win32\LICENSE.txt
copy README.md mcpe_viz_helper.win32\README.txt

mkdir mcpe_viz_helper.win64
copy mcpe_viz_helper_win_builds\x64\* mcpe_viz_helper.win64
copy build64\Release\leveldb.dll mcpe_viz_helper.win64
copy build64\Release\libpng16.dll mcpe_viz_helper.win64
copy build64\Release\libxml2.dll mcpe_viz_helper.win64
copy build64\Release\mcpe_viz.exe mcpe_viz_helper.win64
copy build64\Release\zlib.dll mcpe_viz_helper.win64
xcopy /i images mcpe_viz_helper.win64\images
xcopy /i js mcpe_viz_helper.win64\js
copy mcpe_viz.cfg mcpe_viz_helper.win64
copy mcpe_viz.css mcpe_viz_helper.win64
copy mcpe_viz.js mcpe_viz_helper.win64
copy mcpe_viz.xml mcpe_viz_helper.win64
copy mcpe_viz.html.template mcpe_viz_helper.win64
copy LICENSE mcpe_viz_helper.win64\LICENSE.txt
copy README.md mcpe_viz_helper.win64\README.txt
34 changes: 34 additions & 0 deletions _03_myclean.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
cd zlib-1.2.11
rmdir /s /q build32
rmdir /s /q build64
cd ..
rmdir /s /q zlib

cd lpng1637
rmdir /s /q build32
rmdir /s /q build64
cd ..
rmdir /s /q libpng

cd libxml2-2.9.10
del config.h
del win32\rcVersion.h
move xmlversion.h.orig include\libxml\xmlversion.h
cd ..
rmdir /s /q libxml2

cd libnbtplusplus
rmdir /s /q build32
rmdir /s /q build64
del include\nbt_export.h
cd ..

cd leveldb-mcpe
rmdir /s /q Win32
rmdir /s /q x64
cd ..

rmdir /s /q build32
rmdir /s /q build64

del mybuildlog.txt
Loading