Skip to content
This repository was archived by the owner on Dec 3, 2020. It is now read-only.

Node Box Editor 0.7 #51

Merged
merged 71 commits into from
Jul 29, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
ac65377
Start texture tool
rubenwardy Jul 8, 2014
863401d
Fix artifacts
rubenwardy Jul 8, 2014
b41f705
Finish texture projection
rubenwardy Jul 8, 2014
226551d
Readd lighting
rubenwardy Jul 8, 2014
0c2415a
Add Minetest style lighting
rubenwardy Jul 8, 2014
9451f42
Remove debug output
rubenwardy Jul 8, 2014
0bfbc23
Coordinate axes
rubenwardy Jul 8, 2014
4a604f6
Add dialog system
rubenwardy Jul 9, 2014
1382d28
Fix perspective view's aspect ratio on start up
rubenwardy Jul 9, 2014
c5511ab
Start dynamic viewports
rubenwardy Jul 9, 2014
1854724
Fix CDRs and move camera creation to single function
rubenwardy Jul 10, 2014
e0e40f4
Position cameras depending on viewport type
rubenwardy Jul 10, 2014
6c2d653
Fix bug with bottom camera being blocked by plane
rubenwardy Jul 10, 2014
687b90f
Further fixes for dynamic viewports
rubenwardy Jul 10, 2014
cb2fe11
Add new settings to editor.conf.example
rubenwardy Jul 10, 2014
7dc5bab
Fine tune shading
rubenwardy Jul 10, 2014
fefd318
Lighting settings
rubenwardy Jul 10, 2014
9493d86
Add user interface to dynamic viewports
rubenwardy Jul 11, 2014
6b2f718
Right align viewport label when context menu is closed
rubenwardy Jul 11, 2014
264df92
Add media manager header: WIP
rubenwardy Jul 11, 2014
bd5125b
Add textures for each face
rubenwardy Jul 12, 2014
e145104
Move media manager code to different file
rubenwardy Jul 12, 2014
4d758f7
Fix build error
rubenwardy Jul 12, 2014
821fa24
Clean enums
rubenwardy Jul 12, 2014
e215c0b
Bugs
rubenwardy Jul 12, 2014
4b6b767
Start texture tool
rubenwardy Jul 12, 2014
c081dde
Add icon for texture tool
rubenwardy Jul 12, 2014
b009d2b
Should blank texture in texture tool when texture is not assigned
rubenwardy Jul 14, 2014
ba9edff
Finish texture tool
rubenwardy Jul 16, 2014
1f80bb8
Refactor NBE file parser, and fix segfaults
rubenwardy Jul 21, 2014
0bfeeb5
Update file format spec
rubenwardy Jul 21, 2014
c1841b0
Add single file archiver and new NBE format
rubenwardy Jul 22, 2014
75a6c7c
Fix segfaults
rubenwardy Jul 22, 2014
75558b7
Parse node position in NBE format
rubenwardy Jul 22, 2014
3806c15
Add textures to NBE file parser
rubenwardy Jul 22, 2014
40b2974
Add support for 0.6 NBE files
rubenwardy Jul 22, 2014
293cb6f
Fileformats give more information when failing
rubenwardy Jul 22, 2014
a4ff7a7
Add image import dialog
rubenwardy Jul 22, 2014
4909553
Remove debug printing
rubenwardy Jul 22, 2014
27cf3c2
Update fileformat documentation
rubenwardy Jul 22, 2014
e56e3a2
Fix markdown formating
rubenwardy Jul 22, 2014
bbfa84a
Delete typo
rubenwardy Jul 22, 2014
4ec1d1a
Add import image to project menu
rubenwardy Jul 22, 2014
019cfb0
Add export texture option
rubenwardy Jul 22, 2014
a72c435
Small changes
rubenwardy Jul 22, 2014
ab7e455
Sanitise texture imports
rubenwardy Jul 23, 2014
b4ae4d5
Fix make install
rubenwardy Jul 23, 2014
a69e21c
View source code for copy and paste
rubenwardy Jul 25, 2014
1e50a13
Small changes
rubenwardy Jul 25, 2014
105dc98
Add merge project
rubenwardy Jul 25, 2014
e0b413c
Correct UV mapping of nodes
rubenwardy Jul 25, 2014
4b5b471
Fix se
rubenwardy Jul 25, 2014
ff320b5
Use hidden tmp directory again
rubenwardy Jul 25, 2014
050b5b9
Readjust lighting
rubenwardy Jul 25, 2014
2c392a3
Bump version to 0.7
rubenwardy Jul 25, 2014
7f6a4a3
Add keyboard shortcut to Texture Tool
rubenwardy Jul 25, 2014
1a63090
Hide other nodes when not in node tool
rubenwardy Jul 25, 2014
b6986d2
Fix texture projection
rubenwardy Jul 26, 2014
33697de
Sanitisation and validation in media manager
rubenwardy Jul 26, 2014
6c7f23a
Fix building
rubenwardy Jul 26, 2014
58735cd
More meaningful error messages in Image Dialog
rubenwardy Jul 26, 2014
4930a40
Add tiles to lua exporter
rubenwardy Jul 26, 2014
a9850d3
Fix save errors
rubenwardy Jul 26, 2014
b5159d1
Format debug printing
rubenwardy Jul 26, 2014
0dfc1d0
Fix file saving in NBE format
rubenwardy Jul 26, 2014
2dc57c3
Add scripts and build notes
rubenwardy Jul 26, 2014
d7ab974
Update readme
rubenwardy Jul 26, 2014
0c6c800
Update documentation
rubenwardy Jul 26, 2014
0114be1
Update windows notes
rubenwardy Jul 26, 2014
73db351
Faster box resizing when there are lots of boxes
rubenwardy Jul 29, 2014
f231f13
Fix compile on Windows
rubenwardy Jul 29, 2014
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: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

# Configuration
set(NBE_MAJOR_VERSION 0)
set(NBE_MINOR_VERSION 6)
set(NBE_PATCH_VERSION 5)
set(NBE_DESCR_VERSION "\"0.6.5 - Stone\"")
set(NBE_MINOR_VERSION 7)
set(NBE_PATCH_VERSION 0)
set(NBE_DESCR_VERSION "\"0.7 - Iron\"")
configure_file (
src/conf_cmake.hpp.in
src/conf_cmake.hpp
Expand All @@ -30,18 +30,24 @@ set(NBGEN_SRC
src/Editor.cpp
src/EditorState.cpp
src/MenuState.cpp
src/FileDialog.cpp
src/TextureDialog.cpp
src/ImageDialog.cpp
src/GUIHelpers.cpp
src/NBEditor.cpp
src/NodeEditor.cpp
src/TextureEditor.cpp
src/FileFormat/FileFormat.cpp
src/FileFormat/NBE.cpp
src/FileFormat/Lua.cpp
src/FileFormat/MTC.cpp
src/Node.cpp
src/NodeBox.cpp
src/Project.cpp
src/MediaManager.cpp
src/util/string.cpp
src/util/filesys.cpp
src/util/SimpleFileCombiner.cpp
)

# Include Directories
Expand Down Expand Up @@ -82,8 +88,10 @@ set_target_properties(${PROJECT_NAME}
# Install DLLs
install (FILES media/fontlucida.png DESTINATION share/nodeboxeditor/media)
install (FILES media/gui_scale.png DESTINATION share/nodeboxeditor/media)
install (FILES media/coordinates.png DESTINATION share/nodeboxeditor/media)
install (FILES media/icon_mode_node.png DESTINATION share/nodeboxeditor/media)
install (FILES media/icon_mode_nodebox.png DESTINATION share/nodeboxeditor/media)
install (FILES media/icon_mode_texture.png DESTINATION share/nodeboxeditor/media)
install (FILES media/sky.jpg DESTINATION share/nodeboxeditor/media)
install (FILES media/texture_box.png DESTINATION share/nodeboxeditor/media)
install (FILES media/texture_terrain.png DESTINATION share/nodeboxeditor/media)
Expand Down
36 changes: 16 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Node Box Editor

Use this editor to make nodeboxes for nodes in Minetest.

Version: 0.6.5
Version: 0.7

To do list and bug tracker is here: https://github.com/rubenwardy/NodeBoxEditor/issues?state=open

Expand All @@ -26,25 +26,7 @@ Contributors:
Building
--------

You can build on Linux systems using the following shell commands.
Non-debian systems will use a different first command.
To compile on other systems, see docs/developers.md
If you get stuck, tell me about the problem in the NBE forum topic, IRC or GitHub issues.

# download source and go to the root folder
$ sudo apt-get install build-essential libirrlicht-dev cmake libpng12-dev libbz2-dev libjpeg8-dev libgl1-mesa-dev
$ cmake .
# replace 2 with the number of cores you have + 1
$ make -j2

# to run
$ ./bin/nodeboxeditor
# or double click the executable in bin/

# To install
$ sudo make install
$ nodeboxeditor
# Please read docs/make_install.md for stuff you need to know.
For notes on compiling the editor, see docs/developers.md

Using the editor
================
Expand All @@ -61,6 +43,7 @@ Editor
* Click an icon to select the corresponding mode.
* Press N to enter the node tool.
* Press B to enter the node box tool.
* Press T to enter the texture tool.

Menu
----
Expand Down Expand Up @@ -104,6 +87,19 @@ Icon: A yellow cube.
* Click an item in the listbox to select a node. (or press up/down)
* Click - on the sidebar to remove the selected node. (or press delete)

Texture Tool
------------

In this mode / tool, you can edit the textures of a node.
Icon: Red, green and blue cube.

* Click a face in the side bar to open up the texture dialog.
* Click import to import an texture.
* Type the location relative to the NBE root if a portable build, or relative to the home directory if installed.
* Click export to export the currently selected texture to the nbe root folder if portable, or the home directory if installed.
* Click an texture in the list box to select it.
* Click apply to apply the selected texture to the side of the node.

Saving and Exporting
--------------------

Expand Down
19 changes: 11 additions & 8 deletions docs/developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ Linux

**Install Dependencies**

I recommend that you use the **misc/install_irrlicht.sh** script to install Irrlicht,
as some features in NBE require Irrlicht 1.8 or later, which is not in apt-get

Alternative method (Installs Irrlicht 1.7.2):

# download source and go to the root folder
$ sudo apt-get install build-essential libirrlicht-dev cmake libpng12-dev libbz2-dev libjpeg8-dev libgl1-mesa-dev

Expand Down Expand Up @@ -62,18 +67,15 @@ Express edition makes no difference to the process.

**Prerequisites**

* Download Irrlicht. 1.8 is prefered, but 1.7.x will also work.
* Download Irrlicht. Some features in NBE require Irrlicht 1.8 or later in order to be enabled.
* Download the source code for NBE
* You will need to download Visual Studio, of course.

**Step One: Set up a project**

* Copy the common.hpp.in to common.hpp file where you downloaded the source
* Open up common.hpp, and edit the defines where there is @NBE_A_SETTING@
* @NBE_DESCR_VERSION@: "0.6.4 - Stone" for example
* @NBE_MAJOR_VERSION@: 0
* @NBE_MINOR_VERSION@: 6
* @NBE_PATCH_VERSION@: 4
* Copy the conf_cmake.hpp.in to conf_cmake.hpp where you downloaded the source
* Open up conf_cmake.hpp, and edit the defines where there is @NBE_A_SETTING@
* @NBE_DESCR_VERSION@: "0.7 - Iron" for example
* Create a C++ project in Visual Studio
* Add the source code using right click > Add > Existing file. Make sure to include src/FileFormat and src/util as well.

Expand All @@ -94,7 +96,8 @@ The project should now build correctly. You will need to copy the media folder a
Code
====

* **common**.hpp.in - general compile settings, includes and defines. Used in every other file.
* **common**.hpp - general compile settings, includes and defines. Used in every other file.
* **conf_cmake**.hpp.in - defines from cmake.
* **main**.cpp - contains the main() function, starts irrlicht and the editor.
* **Editor**.cpp/hpp - contains the Editor class which contains the update loop.
* **EditorState**.cpp/hpp - contains the EditorState class, which is used to share common variables. Also contains main class for mode FSM.
Expand Down
17 changes: 17 additions & 0 deletions docs/fileformat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
NBE File Format
===============

The first five bytes tell the parser that it is an NBE file.
"NBEFP"

The next byte is a number between 1 and 255 which indicates how many files there are.

Next up is the file table. It is in this format:

| Length | Description |
|----------|-----------------------------------------|
| 50 bytes | Name of the file |
| 4 bytes | Start position of file data, x bytes in |
| 4 bytes | Size of the file data, x bytes |

Then comes the file data, one after another.
4 changes: 3 additions & 1 deletion docs/make_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ Using Installed Builds

To run, use <code>$ nodeboxeditor</code>

* Project and exports will be saved to <code>/home/</code>. You can change this with the save_directory setting in editor.conf
* Project, imports and exports will be saved to and read from <code>/home/</code>.
You can change this with the save_directory setting in editor.conf
* Configuration will be read from <code>/home/.config/nodeboxeditor.conf</code> first,
and then </code>/usr/local/share/nodeboxeditor/editor.conf</code> if that fails.
* Resources are saved in <code>/usr/local/share/nodeboxeditor</code>
* The executable is in <code>/usr/local/bin</code>
* Textures will be imported and exported to <code>/home/</code>.

15 changes: 8 additions & 7 deletions docs/fileformat.txt → docs/projectfileformat.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# ------------------------------------------------ #
# FILE FORMAT FOR NBE FILES USING PARSER VERSION 1 #
# This is the file format for .nbe files #
# Comments ARE NOT allowed in real format #
# Axis Y is height #
# ------------------------------------------------ #
# --------------------------------------------------------- #
# FILE FORMAT FOR NBE PROJECT FILES USING PARSER VERSION 1 #
# This is the file format for project.txt in .nbe files #
# Comments ARE NOT allowed in real format #
# Axis Y is height #
# --------------------------------------------------------- #

MINETEST NODEBOX EDITOR # Tells the parser that this is a .nbe file
PARSER 1 # What version the parser uses. Versions may not be backwards compatible.
PARSER 2 # What version the parser uses. Versions may not be backwards compatible.
NAME my_mod_namespace # The folder the mod should be in


Expand All @@ -21,6 +21,7 @@ POSITION 0 0 0 # position in editor grid
# <name> <x1> <y1> <z1> <x2> <y2> <z2>
NODEBOX name -0.5 -0.5 -0.5 0.5 0.5 0.5 # A single box called name.
NODEBOX name -0.5 -0.5 -0.5 0.5 0.5 0.5 # a single box called name
TEXTURE top mod_top_texture.png # uses textures/mod_top_texture.png for top face
END NODE


Expand Down
21 changes: 21 additions & 0 deletions editor.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ snapping = true
# limiting stops node boxes going out of node bounds
limiting = true

# Directory to save projects and export to.
# Should be absolute path.
save_directory =

# The view of each viewport
# can be: pers, front, back, top, bottom, left, right
viewport_top_left = pers
viewport_top_right = top
viewport_bottom_left = front
viewport_bottom_right = right

# Lighting
# 0: no lighting / shadows
# 1: Depth lighting (things further away from camera are darker)
# 2: Normal lighting (like in Minetest)
lighting = 2

# If true, nodes that are not selected will be hidden
# when not in the node tool
hide_other_nodes = true

# Driver used to render
driver = opengl

Expand Down
Binary file added media/coordinates.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/icon_mode_texture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified media/texture_terrain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed media/texture_terrain_plain.png
Binary file not shown.
20 changes: 20 additions & 0 deletions misc/install_irrlicht.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /bin/bash

echo "Sudo is required for installing dependancies and uninstalling old versions of Irrlicht"

# Dependancies
sudo apt-get install -y subversion build-essential xserver-xorg-dev x11proto-xf86vidmode-dev libxxf86vm-dev
sudo apt-get install -y mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libxext-dev libxcursor-dev
sudo apt-get remove -y libirrlicht-dev

# Download Irrlicht
svn checkout svn://svn.code.sf.net/p/irrlicht/code/trunk irrlicht-trunk

# Build Irrlicht
cd irrlicht-trunk/source/Irrlicht
make

# Install Irrlicht
cd ../..
sudo cp -r include/* /usr/local/include/
sudo cp lib/Linux/libIrrlicht.a /usr/local/lib
7 changes: 7 additions & 0 deletions misc/install_nbe.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash

cd ../
cmake .
make -j3
sudo make install

23 changes: 23 additions & 0 deletions src/Dialog.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef DIALOG_HPP_INCLUDED
#define DIALOG_HPP_INCLUDED
#include "common.hpp"
#include "EditorState.hpp"

class EditorState;
class Dialog : public IEventReceiver
{
public:
Dialog(EditorState *mstate):
state(mstate)
{}

virtual bool canClose() = 0;
virtual bool close() = 0;
virtual bool OnEvent(const SEvent &event) = 0;
virtual void draw(IVideoDriver *driver) {}
protected:
EditorState *state;
};

#endif

Loading