Coder Social home page Coder Social logo

terravox's Introduction

Terravox

Build Status

Terravox is a heightmap Editor which can be used to create a Voxlap5 VXL data quickly.

Installation

  1. Make sure following development packages are installed.
  • C++ compiler. GCC 4.8 / Clang 3.2 or later is recommended.
  • Qt 5.4 or later.
  • (Optionally, LuaJIT for scripting support)
  1. qmake Terravox.pro
  2. make

Organization

  • (root) - contains the main source code written in C++/Qt, Qt form design, and translation files.
  • res - mostly image resources.
  • lua - built-in Lua code providing an interface between third-party plugin scripts and the application program.

terravox's People

Contributors

mt-field avatar noway avatar yvt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terravox's Issues

Mention the eye dropper feature

As an eye-dropper is available to capture the color of a block (see #14), it should be mentioned somewhere in the UI of Terravox.

Maybe adding a status bar to the main window will allow to show 2 useful messages:

  • when not in eye dropper mode: "Hold the Alt key to use the eye dropper"
  • when in eye dropper mode: "Select a block to capture its actual color in the color picker"

Missing casts between `__m128` and `__m128i`

Clang is too tolerant about this.

(copied from #2):

g++ -c -pipe -msse4.1 -mssse3 -msse3 -msse2 -msse -Wno-missing-braces -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -std=c++0x -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I/usr/lib/qt/mkspecs/linux-g++ -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtConcurrent -isystem /usr/include/qt/QtCore -I. -I. -o terrainview_p.o terrainview_p.cpp
terrainview_p.cpp: In lambda function:
terrainview_p.cpp:485:23: error: cannot convert ‘__m128i {aka __vector(2) long long int}’ to ‘__vector(4) float’ in assignment
                 coeff = _mm_cvttps_epi32(coeff);                // i32 * 4
                       ^
terrainview_p.cpp:486:53: error: cannot convert ‘__vector(4) float’ to ‘__m128i {aka __vector(2) long long int}’ for argument ‘1’ to ‘__m128i _mm_packs_epi32(__m128i, __m128i)’
                 coeff = _mm_packs_epi32(coeff, coeff);          // i16 * 4 + pad
                                                     ^
terrainview_p.cpp:487:56: error: cannot convert ‘__vector(4) float’ to ‘__m128i {aka __vector(2) long long int}’ for argument ‘1’ to ‘__m128i _mm_unpacklo_epi16(__m128i, __m128i)’
                 coeff = _mm_unpacklo_epi16(coeff, coeff);       // i16 [c1, c1, c2, c2, c3, c3, c4, c4]
                                                        ^
terrainview_p.cpp:492:94: error: cannot convert ‘__vector(4) float’ to ‘__m128i {aka __vector(2) long long int}’ for argument ‘1’ to ‘__m128i _mm_unpacklo_epi16(__m128i, __m128i)’
                 colLo = _mm_srai_epi16(_mm_mullo_epi16(colLo, _mm_unpacklo_epi16(coeff, coeff)), 6);
                                                                                              ^
terrainview_p.cpp:494:94: error: cannot convert ‘__vector(4) float’ to ‘__m128i {aka __vector(2) long long int}’ for argument ‘1’ to ‘__m128i _mm_unpackhi_epi16(__m128i, __m128i)’
                 colHi = _mm_srai_epi16(_mm_mullo_epi16(colHi, _mm_unpackhi_epi16(coeff, coeff)), 6);
                                                                                              ^
terrainview_p.cpp: At global scope:
terrainview_p.cpp:601:49: warning: unused parameter ‘alt’ [-Wunused-parameter]
         renderLandform1([](quint32 color, float alt) { return color; });
                                                 ^
Makefile:824: recipe for target 'terrainview_p.o' failed
make: *** [terrainview_p.o] Error 1

Inserting Models

The ability to quickly insert KV6/VOX models in place and rotate/raise/lower them would be very powerful, and highly useful.

Anyone agree?

Failed to compile. :-(

/usr/lib/x86_64-linux-gnu/qt4/bin/uic erosioneditor.ui -o ui_erosioneditor.h
g++ -c -m64 -pipe -msse4.1 -mssse3 -msse3 -msse2 -msse -Wno-missing-braces -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o main.o main.cpp
main.cpp:69:9: warning: identifier ‘nullptr’ is a keyword in C++11 [-Wc++0x-compat]
QMessageBox::critical(nullptr, a.applicationName(),
^
In file included from main.cpp:1:0:
mainwindow.h:66:36: error: ‘std::function’ has not been declared
bool makeSureEffectIsDone(std::function<void(bool)> callback);
^
mainwindow.h:66:44: error: expected ‘,’ or ‘...’ before ‘<’ token
bool makeSureEffectIsDone(std::function<void(bool)> callback);
^
mainwindow.h:71:28: error: ‘std::function’ has not been declared
bool confirmClose(std::function<void(bool)> callback);
^
mainwindow.h:71:36: error: expected ‘,’ or ‘...’ before ‘<’ token
bool confirmClose(std::function<void(bool)> callback);
^
mainwindow.h:72:31: error: ‘std::function’ has not been declared
bool saveInteractive(std::function<void(bool)> callback);
^
mainwindow.h:72:39: error: expected ‘,’ or ‘...’ before ‘<’ token
bool saveInteractive(std::function<void(bool)> callback);
^
mainwindow.h:73:33: error: ‘std::function’ has not been declared
void saveAsInteractive(std::function<void(bool)> callback);
^
mainwindow.h:73:41: error: expected ‘,’ or ‘...’ before ‘<’ token
void saveAsInteractive(std::function<void(bool)> callback);
^
mainwindow.h:82:34: warning: override controls (override/final) only available with -std=c++11 or -std=gnu++11
void closeEvent(QCloseEvent ) override;
^
In file included from main.cpp:5:0:
cpu.h:8:5: warning: scoped enums only available with -std=c++11 or -std=gnu++11
enum class Feature
^
cpu.h:25:20: warning: variadic templates only available with -std=c++11 or -std=gnu++11
template <class...T>
^
cpu.h:26:40: warning: variadic templates only available with -std=c++11 or -std=gnu++11
bool supports(Feature feature, T...rest)
^
main.cpp: In function ‘int main(int, char
*)’:
main.cpp:68:33: error: ‘CpuId::Feature’ is not a class or namespace
if (!CpuId::supports(CpuId::Feature::Sse, CpuId::Feature::Sse2)) {
^
main.cpp:68:54: error: ‘CpuId::Feature’ is not a class or namespace
if (!CpuId::supports(CpuId::Feature::Sse, CpuId::Feature::Sse2)) {
^
main.cpp:69:31: error: ‘nullptr’ was not declared in this scope
QMessageBox::critical(nullptr, a.applicationName(),
^
Makefile:480: recipe for target 'main.o' failed
make: *** [main.o] Error 1

Crash in `renderLandform`

v0.0.1

OS X diagnostics log:

Thread 3 Crashed:: Thread (pooled)
0   jp.yvt.Terravox                 0x0000000101babc70 QtConcurrent::MapKernel<RangeIterator, void TerrainView::TerrainViewPrivate::renderLandform<TerrainView::TerrainViewPrivate::render(QSize, TerrainView::SceneDefinition const&)::$_2, true>(TerrainView::TerrainViewPrivate::render(QSize, TerrainView::SceneDefinition const&)::$_2&&)::'lambda'(int)>::runIteration(RangeIterator, int, void*) + 4160
1   jp.yvt.Terravox                 0x0000000101baf66f QtConcurrent::IterateKernel<RangeIterator, void>::whileThreadFunction() + 159
2   org.qt-project.QtConcurrent     0x0000000102e1350c QtConcurrent::ThreadEngineBase::run() + 92
3   org.qt-project.QtCore           0x00000001028a7f97 0x102877000 + 200599
4   org.qt-project.QtCore           0x00000001028ab393 0x102877000 + 213907
5   libsystem_pthread.dylib         0x00007fff941b2899 _pthread_body + 138
6   libsystem_pthread.dylib         0x00007fff941b272a _pthread_start + 137
7   libsystem_pthread.dylib         0x00007fff941b6fc9 thread_start + 13

valgrind:

Invalid read of size 4
  in QtConcurrent::MapKernel&lt;RangeIterator, void TerrainView::TerrainViewPrivate::renderLandform&lt;TerrainView::TerrainViewPrivate::render(QSize, TerrainView::SceneDefinition const&amp;)::$_2, true&gt;(TerrainView::TerrainViewPrivate::render(QSize, TerrainView::SceneDefinition const&amp;)::$_2&amp;&amp;)::{lambda(int)#1}&gt;::runIteration(RangeIterator, int, void*) in /Users/tcpp/Programs/MacPrograms3/build-Terravox-Desktop_Qt_5_4_0_clang_64bit-Release/Terravox.app/Contents/MacOS/Terravox
Address 0x115a47d84 is 30,660 bytes inside an unallocated block of size 31,264 in arena "client"  1: QtConcurrent::MapKernel&lt;RangeIterator, void TerrainView::TerrainViewPrivate::renderLandform&lt;TerrainView::TerrainViewPrivate::render(QSize, TerrainView::SceneDefinition const&amp;)::$_2, true&gt;(TerrainView::TerrainViewPrivate::render(QSize, TerrainView::SceneDefinition const&amp;)::$_2&amp;&amp;)::{lambda(int)#1}&gt;::runIteration(RangeIterator, int, void*) in /Users/tcpp/Programs/MacPrograms3/build-Terravox-Desktop_Qt_5_4_0_clang_64bit-Release/Terravox.app/Contents/MacOS/Terravox
  2: QtConcurrent::IterateKernel&lt;RangeIterator, void&gt;::whileThreadFunction() in /Users/tcpp/Programs/MacPrograms3/build-Terravox-Desktop_Qt_5_4_0_clang_64bit-Release/Terravox.app/Contents/MacOS/Terravox
  3: QtConcurrent::ThreadEngineBase::startBlocking() in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtConcurrent.framework/Versions/5/QtConcurrent
  4: TerrainView::TerrainViewPrivate::render(QSize, TerrainView::SceneDefinition const&amp;) in /Users/tcpp/Programs/MacPrograms3/build-Terravox-Desktop_Qt_5_4_0_clang_64bit-Release/Terravox.app/Contents/MacOS/Terravox
  5: TerrainView::paintEvent(QPaintEvent*) in /Users/tcpp/Programs/MacPrograms3/build-Terravox-Desktop_Qt_5_4_0_clang_64bit-Release/Terravox.app/Contents/MacOS/Terravox
  6: QWidget::event(QEvent*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  7: QApplicationPrivate::notify_helper(QObject*, QEvent*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  8: QApplication::notify(QObject*, QEvent*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  9: QCoreApplication::notifyInternal(QObject*, QEvent*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtCore.framework/Versions/5/QtCore
  10: QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&amp;, QPoint const&amp;, int, QPainter*, QWidgetBackingStore*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  11: QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList&lt;QObject*&gt; const&amp;, int, QRegion const&amp;, QPoint const&amp;, int, QPainter*, QWidgetBackingStore*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  12: QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&amp;, QPoint const&amp;, int, QPainter*, QWidgetBackingStore*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  13: QWidgetPrivate::paintSiblingsRecursive(QPaintDevice*, QList&lt;QObject*&gt; const&amp;, int, QRegion const&amp;, QPoint const&amp;, int, QPainter*, QWidgetBackingStore*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  14: QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&amp;, QPoint const&amp;, int, QPainter*, QWidgetBackingStore*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  15: QWidgetBackingStore::doSync() in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  16: QWidgetBackingStore::sync() in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  17: QWidgetPrivate::syncBackingStore() in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  18: QWidget::event(QEvent*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  19: QMainWindow::event(QEvent*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  20: QApplicationPrivate::notify_helper(QObject*, QEvent*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  21: QApplication::notify(QObject*, QEvent*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
  22: QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/lib/QtCore.framework/Versions/5/QtCore
  23: QCocoaEventDispatcherPrivate::processPostedEvents() in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/plugins/platforms/libqcocoa.dylib
  24: QCocoaEventDispatcherPrivate::postedEventsSourceCallback(void*) in /Users/tcpp/Software/Qt5.4.0/5.4/clang_64/plugins/platforms/libqcocoa.dylib
  25: __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ in /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation

Can't open Tools->Preferences

When i click on it, there is no any response. It just not opening.
No any error/warning given and stdin/stderr is clear.

Impossible to show too high blocks with a too large angle of view

Actually, the map dragging behavior does not allow the center of the viewport to be outside of the lowest map blocks area.

So, if I want to work on the red area visible on the screenshot below:

terravox_snap_1

And if I need to use some angle of view to be able to distinguish the height of the different blocks:

terravox_snap_2

Zooming in does not allow me to drag the map lower (in relation to the viewport). So, that's what I see (the blue cross is visible in the first screenshot):

terravox_snap_3

By dragging the map to the bottom/left corner of the viewport, we can more easily understand the dragging behavior. The top/right corner of the lowest blocks area is in the center of the viewport:

terravox_snap_4

The solution might be to turn the map by 180 degrees. But it does not allow to work on the blocks located on the other side:

terravox_snap_5

P.S: The map shown on those screenshots is not a good example of a scenario where this behavior is really annoying. Think of a mountain with all blocks having similar colors.

Windows release missing platform plugin

Using release 0.2, I get this error on start up:

---------------------------
Terravox
---------------------------
This application failed to start because it could not find or load the Qt platform plugin "windows".

Reinstalling the application may fix this problem.
---------------------------
OK   
---------------------------

I think it needs platforms/qwindows.dll:

Cannot open the plugins folder

When i go to Tools->Open scripts folder terravox gives me following error:
scrot
Meanwhile, no errors given by stdin/stderr, so this is all information i have.
This is linux system.
How to fix this?

Terravox as a Battlebuilder-like map editor for .75 and Openspades

I believe that one of the strong point of AoS lies in user-made content, and easy map-buliding can contribute to making AoS' community more active.

It would be nice to have those functions in Terravox :

  • Ability to edit non-heightmap maps
  • Editing individual voxels by dragging (like MagicaVoxel)
  • Inserting models(kvx, kv6)
  • Editing map metadata(spawning area, Intels, extensions) easily with GUI

We already have a great client(OpenSpades), so now it would be content-creating tools' turn.

Can't run terravox on linux on AMD processor

Didn't tested Intel processor, so can't say if this is general issue for linux or not.

On my processor, terravox gives following error:

[1] 18295 illegal hardware instruction (core dumped) ./Terravox

Here is cat /proc/cpuinfo

Also, if i'm trying to compile it with gcc, i'm getting following error:

g++ -c -pipe -msse4.1 -mssse3 -msse3 -msse2 -msse -Wno-missing-braces -O2 -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4 -std=c++0x -Wall -W -D_REENTRANT -fPIE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I/usr/lib/qt/mkspecs/linux-g++ -I. -isystem /usr/include/qt -isystem /usr/include/qt/QtWidgets -isystem /usr/include/qt/QtGui -isystem /usr/include/qt/QtConcurrent -isystem /usr/include/qt/QtCore -I. -I. -o terrainview_p.o terrainview_p.cpp
terrainview_p.cpp: In lambda function:
terrainview_p.cpp:485:23: error: cannot convert ‘__m128i {aka __vector(2) long long int}’ to ‘__vector(4) float’ in assignment
                 coeff = _mm_cvttps_epi32(coeff);                // i32 * 4
                       ^
terrainview_p.cpp:486:53: error: cannot convert ‘__vector(4) float’ to ‘__m128i {aka __vector(2) long long int}’ for argument ‘1’ to ‘__m128i _mm_packs_epi32(__m128i, __m128i)’
                 coeff = _mm_packs_epi32(coeff, coeff);          // i16 * 4 + pad
                                                     ^
terrainview_p.cpp:487:56: error: cannot convert ‘__vector(4) float’ to ‘__m128i {aka __vector(2) long long int}’ for argument ‘1’ to ‘__m128i _mm_unpacklo_epi16(__m128i, __m128i)’
                 coeff = _mm_unpacklo_epi16(coeff, coeff);       // i16 [c1, c1, c2, c2, c3, c3, c4, c4]
                                                        ^
terrainview_p.cpp:492:94: error: cannot convert ‘__vector(4) float’ to ‘__m128i {aka __vector(2) long long int}’ for argument ‘1’ to ‘__m128i _mm_unpacklo_epi16(__m128i, __m128i)’
                 colLo = _mm_srai_epi16(_mm_mullo_epi16(colLo, _mm_unpacklo_epi16(coeff, coeff)), 6);
                                                                                              ^
terrainview_p.cpp:494:94: error: cannot convert ‘__vector(4) float’ to ‘__m128i {aka __vector(2) long long int}’ for argument ‘1’ to ‘__m128i _mm_unpackhi_epi16(__m128i, __m128i)’
                 colHi = _mm_srai_epi16(_mm_mullo_epi16(colHi, _mm_unpackhi_epi16(coeff, coeff)), 6);
                                                                                              ^
terrainview_p.cpp: At global scope:
terrainview_p.cpp:601:49: warning: unused parameter ‘alt’ [-Wunused-parameter]
         renderLandform1([](quint32 color, float alt) { return color; });
                                                 ^
Makefile:824: recipe for target 'terrainview_p.o' failed
make: *** [terrainview_p.o] Error 1

Which is probably somehow related to that.

Is there any hope to get it working?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.