861 Commits

Author SHA1 Message Date
David Vierra
5a8bc5dc8d Declare RelightCtx as final to omit Cython vtables 2015-06-30 07:16:41 -10:00
David Vierra
2a883ad114 Avoid doing extra map lookups
In getSection, return the pointer from the find() iterator if found
In cacheSection, do some flips to get the pointer from the operator[] that finally caches the section
2015-06-30 06:45:51 -10:00
David Vierra
41b6db001d Extract cacheSection() from getSection()
Skips some initializers used only by cacheSection for a good speedup.
2015-06-30 06:02:55 -10:00
David Vierra
c99cde9219 findFadedCells in with_cython.pyx now uses STL containers instead of Python ones 2015-06-29 20:56:42 -10:00
David Vierra
7e18deb438 Add option to output statistics for RelightCtx 2015-06-29 16:16:12 -10:00
David Vierra
5ebfa1c39e Ignore with_cython outputs 2015-06-29 16:14:11 -10:00
David Vierra
ba83a68fc7 time_relight now relights as many sections as it can in 10 seconds. 2015-06-29 16:13:58 -10:00
David Vierra
eea61a72cb ObjGraphWidget.showGraph doesn't crash on a failed eval. 2015-06-29 16:06:59 -10:00
David Vierra
6fe415561d Add cython implementation of lighting update.
Relies on direct access to the section arrays provided by chunk sections through the WorldEditor class. Caches section arrays to avoid repeated calls through the Python WorldEditor's getChunk/getSection

Currently does not create new sections.
2015-06-29 03:01:07 -10:00
David Vierra
0f7378ec7f In time_relight, block coords are signed (duh) 2015-06-29 02:31:17 -10:00
David Vierra
c003ffc666 Add updateLightsInSelection to pure_python.py 2015-06-26 15:14:29 -10:00
David Vierra
ad505ce2e2 Remove unused variable from FillBlocksOperation 2015-06-23 14:13:46 -10:00
David Vierra
9da7b289b2 Begin testing multiple implementations of relight algorithm.
Change relight API to have updateLightsByCoord, updateLightsInSelection, updateLightsInSection (incomplete)
Move time_xxx.py files from test/ into bench/
Split time_relight into manmade and natural.
Get time_relight_xxx working again.
Add get/set BlockLight/SkyLight to WorldEditor for pure python relight.
Implement pure python relight. Seems to work right.
2015-06-23 14:13:33 -10:00
David Vierra
987aa3e7c5 Brush shapes are now able to provide options widgets.
BrushShape inherits from QObject so it can have signals
BrushShape provides an optionsChanged signal

ShapeWidget for some reason forwards the optionsChanged signal to its client.
Probably because it "owns" the BrushShape instances, which is kind of dumb?

No shapes implement useful options widgets yet
2015-06-18 12:48:51 -10:00
David Vierra
0ae5213f40 Add wrapper for glActiveTexture
Use the `alternate` function from OpenGL.extensions to choose the first one from (glActiveTexture, glActiveTextureARB) that is available.
2015-06-18 12:37:10 -10:00
David Vierra
0d9d5626cc Update heightmap even when lighting is disabled. 2015-06-14 17:09:22 -10:00
David Vierra
cc4d4f5799 Add rendering layer for chunk section edges.
Reveals that far too many chunk sections are being created.
Edges have odd diagonals but I'll leave it for now.
2015-06-14 17:09:11 -10:00
David Vierra
ffa4c0a19a Actually skip over erroring worlds in WorldListModel, for real this time.
Fixes #118
2015-06-13 04:15:28 -10:00
David Vierra
60c4026151 Check minor and major versions from GL_VERSION
GL_MAJOR_VERSION is only supported on OpenGL 3.0+

Fixes #116
2015-06-12 23:10:40 -10:00
David Vierra
c9076b2c53 Check minor and major versions returned by glGet instead of QGLFormat
QGLFormat's values are wrong with Qt 4.8.6 on OS X (QTBUG-40415)

Fixes #115
2015-06-12 04:05:10 -10:00
David Vierra
b1dad4bb63 Log editor commands as they are pushed 2015-06-12 04:02:52 -10:00
David Vierra
33acbaf9be worldinfo.ui: "Commands" -> "Allow Commands" 2015-06-12 04:02:38 -10:00
David Vierra
33a01de511 Fix edits being added when world info panel is reloaded.
Yes, this is what editsDisabled is for.
2015-06-12 04:02:25 -10:00
David Vierra
9db66f1f58 Fix crash with non-standard world generator names, allow custom generator names to be entered.
Rename generationTypeCombo  to generatorTypeCombo
Change generatorTypeCombo into an editable combo box.
Add generator tag values to combo box items as itemData. Remove GENERATOR_TYPES.
Get generator tag value first as itemData and then as entered text if no itemData is found.
Add unknown generator types from the NBT data to the combo box.
Connect to the combo box's line edit's editingFinished to respond to user-entered generator types.

Fixes #113
2015-06-12 03:51:48 -10:00
David Vierra
474b0f499f Only import win32api on Windows. 2015-06-11 09:03:02 -10:00
David Vierra
a00a17a224 Remove some noisy loggers 2015-06-09 22:17:02 -10:00
David Vierra
3c56b0f7fd Add chunkNotPresent to ChunkLoader, WorldView, WorldScene 2015-06-08 01:13:34 -10:00
David Vierra
891bb6db2f Remove recentDirtyChunks. Change ChunkLoader to respond to revisionChanged instead. 2015-06-08 01:12:59 -10:00
David Vierra
bc50b9c039 Fix undoBackward returning the wrong RevisionChanges 2015-06-08 00:42:22 -10:00
David Vierra
0f7488f88a Add chunk-shaped selection box 2015-06-08 00:42:21 -10:00
David Vierra
29b7406c93 Dirty hack to force chunk rescan after revision change
Should inspect changes and update instead of rescanning
2015-06-08 00:42:21 -10:00
David Vierra
278966a256 RevisionHistory: fix various functions not respecting deadChunks/deadFiles
chunkPositions now removes dead chunks from the returned chunks
readChunkBytes raises ChunkNotPresent for dead chunks
readFile raises IOError for dead files
2015-06-08 00:42:20 -10:00
David Vierra
cca35e3d0d Quit app when main window is closed 2015-06-08 00:42:20 -10:00
David Vierra
ce7c652581 Add chunk menu and implement chunk delete command 2015-06-08 00:42:19 -10:00
David Vierra
5a5d09c532 createShapedSelection now has the current dimension as an argument 2015-06-07 23:33:06 -10:00
David Vierra
8812e4140a Always log info about obtained GL context
The more info, the better.
2015-06-07 16:57:13 -10:00
David Vierra
b10de6f592 Update readme - install pyzmq using pip 2015-06-07 06:56:06 -10:00
David Vierra
9e383d4031 Log selection in FillBlocksOperation 2015-06-07 06:53:59 -10:00
David Vierra
aeb874487f Add deleted chunks to recentDirtyChunks 2015-06-07 06:53:40 -10:00
David Vierra
5f941735c2 Replace Blocks now respects the "In Selection" checkbox 2015-06-07 00:23:01 -10:00
David Vierra
d3187b2d73 Selection highlight now updates after the world is edited.
No more selection hanging around after blocks are deleted.
2015-06-07 00:19:52 -10:00
David Vierra
1d9c2c65de EditorSession.revisionChanged is now emitted with a RevisionChanges object instead of the revision ID 2015-06-07 00:19:05 -10:00
David Vierra
ef520d7d9d Fix crash when changing selection shape 2015-06-06 23:43:10 -10:00
David Vierra
c79c851e4d Catch errors while calling generator's getPreviewNode
TODO: better error dialog!
2015-06-06 21:23:47 -10:00
David Vierra
2ce9faadd0 WorkplaneNode can now be oriented to any axis 2015-06-06 19:58:14 -10:00
David Vierra
ac495f1d87 Fix selection boxes occasionally being super hard to resize.
Box was using the wrong plane as the drag reference plane
2015-06-06 19:57:45 -10:00
David Vierra
5de661cab9 Fix selection renderer rendering anything when selection is zero sized.
IntersectionBox had the wrong logic for one of its components returning None from box_mask

All CombinationBoxes have been adjusted.
2015-06-06 18:02:36 -10:00
David Vierra
7ae713ebb2 Allow bresenham to be reloaded 2015-06-06 17:23:45 -10:00
David Vierra
8789408a22 Change sys.executable to GetModuleFileNameW
Currently does nothing, but when PyInstaller is patched to use unicode filenames, GMFNW won't return an SFN any more.
2015-06-05 23:26:35 -10:00
David Vierra
97d6aeabf4 validateGLContext doesn't need to return anything
Was getting a weird error like "PySide.QGLContext has no attribute setData" in some logging call...
2015-06-05 23:03:47 -10:00