Skip to content

Instantly share code, notes, and snippets.

View m0r13's full-sized avatar

Moritz Hilscher m0r13

View GitHub Profile
@m0r13
m0r13 / utf8.cpp
Last active August 29, 2015 14:06
#include <cctype>
#include <iostream>
#include <sstream>
std::string convertUnicodeLiteral(std::string literal) {
// if (!util::startswith(escape, "\\u") ...
literal = literal.substr(2);
std::stringstream ss;
ss << std::hex << literal/*.substr(0, 4)*/;
unsigned int ord;
@m0r13
m0r13 / forum_thread
Created September 12, 2014 13:54
Mapcrafter forum thread page
[center][b][size=18px]Mapcrafter - High Performance Minecraft Map Renderer[/size][/b][/center]
[center][url=http://mapcrafter.org]Website[/url] | [url=http://docs.mapcrafter.org]Documentation[/url] | [url=https://github.com/m0r13/mapcrafter/wiki/Example-maps]Example Maps[/url] | [url=https://github.com/mapcrafter/mapcrafter]GitHub[/url][/center]
I want to present you my Minecraft map renderer written in C++.
The renderer provides you with an isometric 3D view and renders Minecraft worlds to images which are viewable in any webbrowser using Leaflet.js (similar to the Google Maps API).
[b]Features:[/b]
moritz@moritz-desktop  ~  mapcrafter --help
Allowed options:
General options:
-h [ --help ] shows this help message
-v [ --version ] shows the version of Mapcrafter
Logging/output options:
--logging-config path the path to the global logging configuration file to
use (automatically determined if not specified)
May 19 11:45:47 moritz-desktop mapcrafter: Scanning worlds...
May 19 11:45:47 moritz-desktop mapcrafter: [1/6] Rendering map exmaple_day ("ExMaple - Daylight"):
May 19 11:45:47 moritz-desktop mapcrafter: You changed the lighting intensity from 0.8 to 0.9.
May 19 11:45:47 moritz-desktop mapcrafter: Force-render the whole map in order for the new configuration to come into effect.
May 19 11:45:47 moritz-desktop mapcrafter: [1.1/1.4] Rendering rotation top-left:
May 19 11:45:47 moritz-desktop mapcrafter: Single thread will render 143 render tiles.
May 19 11:45:52 moritz-desktop mapcrafter: [1.1/1.4] Rendering rotation top-left took 5 seconds.
May 19 11:45:52 moritz-desktop mapcrafter: Rendering all worlds took 5 seconds.
May 19 11:45:52 moritz-desktop mapcrafter: Finished.....aaand it's gone!
[log:output]
type = output
verbosity = INFO
date_format = %F %T
format = %(date) [%(level)] [%(logger)] %(message)
log_progress = false
[log:file]
type = file
verbosity = INFO
/home/moritz/dev/minecraft/pigmap/blocks-6.png not found (or failed to read as PNG); will try to build from provided textures
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
15/05/2014 12:00:46,582 INFO [default] Scanning worlds...
15/05/2014 12:00:46,596 INFO [default] [1/6] Rendering map exmaple_day ("ExMaple - Daylight"):
15/05/2014 12:00:46,596 INFO [default] [1.1/1.4] Rendering rotation top-left:
15/05/2014 12:00:46,730 INFO [default] 2 threads will render 143 render tiles.
[=====================================] 100.00% 143/143 47.67/s
15/05/2014 12:00:49,133 INFO [default] [1.1/1.4] Rendering rotation top-left took 3 seconds.
15/05/2014 12:00:49,137 INFO [default] [1.2/1.4] Rendering rotation top-right:
15/05/2014 12:00:49,264 INFO [default] 2 threads will render 148 render tiles.
[=====================================] 100.00% 148/148 74.00/s
15/05/2014 12:00:51,722 INFO [default] [1.2/1.4] Rendering rotation top-right took 2 seconds.
Linking CXX executable testconfig
Linking CXX executable nbtdump
[ 79%] Built target testconfig
[ 81%] Building CXX object src/tools/CMakeFiles/testtextures.dir/testtextures.cpp.o
[ 81%] Built target nbtdump
[ 83%] Building CXX object src/test/CMakeFiles/test_all.dir/test_all.cpp.o
[ 85%] Building CXX object src/test/CMakeFiles/test_all.dir/test_config.cpp.o
Linking CXX executable mapcrafter_markers
[ 85%] Built target mapcrafter_markers
[ 87%] Building CXX object src/test/CMakeFiles/test_all.dir/test_image.cpp.o
[~/dev/minecraft/mapcrafter_old/src]
20:37-moritz@moritz-desktop$ git checkout v.0.1
HEAD ist jetzt bei a882092... - initial import
[~/dev/minecraft/mapcrafter_old/src]
20:38-moritz@moritz-desktop$ make -j 4
g++ -std=c++0x -Werror -O3 -I. -c util.cpp -o util.o
g++ -std=c++0x -Werror -O3 -I. -c mc/cache.cpp -o mc/cache.o
g++ -std=c++0x -Werror -O3 -I. -c mc/chunk.cpp -o mc/chunk.o
g++ -std=c++0x -Werror -O3 -I. -c mc/nbt.cpp -o mc/nbt.o
g++ -std=c++0x -Werror -O3 -I. -c mc/pos.cpp -o mc/pos.o

1.3.2

Scanning worlds...
(1/5) Rendering map world1.7_day ("World 1.7 - Day"):
(1.1/1.2) Rendering rotation top-left:
2 threads will render 27481 render tiles.
[====================================================================================================================================================================================================] 100.00% 27481/27481 32.52/s             
(1.1/1.2) Rendering rotation top-left took 845 seconds.