Merge branch 'main' of https://github.com/MihailRis/VoxelEngine-Cpp
This commit is contained in:
commit
941d3bcf8e
145
CHANGELOG.md
145
CHANGELOG.md
@ -1,6 +1,6 @@
|
||||
# 0.27 - 2025.03.25
|
||||
# 0.28 - 2025.07.18
|
||||
|
||||
[Documentation](https://github.com/MihailRis/VoxelEngine-Cpp/tree/release-0.27/doc/en/main-page.md) for 0.27
|
||||
[Documentation](https://github.com/MihailRis/VoxelEngine-Cpp/tree/release-0.28/doc/en/main-page.md) for 0.28
|
||||
|
||||
Table of contents:
|
||||
|
||||
@ -11,101 +11,64 @@ Table of contents:
|
||||
|
||||
## Added
|
||||
|
||||
- items data
|
||||
- weather
|
||||
- work with ZIP-files
|
||||
- splitbox ui element
|
||||
- history in textbox
|
||||
- reloading content scripts within the editor
|
||||
- libraries:
|
||||
- gfx.weather
|
||||
- [add side mouse buttons](https://github.com/MihailRis/VoxelEngine-Cpp/pull/461)
|
||||
- item properties:
|
||||
- uses
|
||||
- uses-display
|
||||
- textbox attributes:
|
||||
- oncontrolkey
|
||||
- container attributes:
|
||||
- scroll
|
||||
- multiline tooltips suppoirt
|
||||
- ['@' prefix support in tooltips](https://github.com/MihailRis/VoxelEngine-Cpp/commit/fa990e393986aad07e9fb9a570338b08fd4f9a0c)
|
||||
- advanced graphics mode
|
||||
- state bits based models
|
||||
- post-effects
|
||||
- ui elements:
|
||||
- iframe
|
||||
- select
|
||||
- modelviewer
|
||||
- vcm models format
|
||||
- bit.compile
|
||||
- yaml encoder/decoder
|
||||
- error handler argument in http.get, http.post
|
||||
- ui properties:
|
||||
- image.region
|
||||
- rotation profiles:
|
||||
- stairs
|
||||
- libraries
|
||||
- gfx.posteffects
|
||||
- yaml
|
||||
- stairs rotation profile
|
||||
- models editing in console
|
||||
- syntax highlighting: xml, glsl, vcm
|
||||
- beginning of projects system
|
||||
|
||||
### Changes
|
||||
|
||||
- file subsystem upgrade
|
||||
- code editor upgrade
|
||||
- block materials update
|
||||
- actual file path now may be specified in audio.play_stream/play_stream_2d call.
|
||||
- reserved 'project', 'pack', 'packid', 'root' entry points
|
||||
- Bytearray optimized with FFI
|
||||
- chunks non-unloading zone limited with circle
|
||||
|
||||
### Functions
|
||||
|
||||
- file.create_zip
|
||||
- file.mount
|
||||
- file.unmount
|
||||
- file.path
|
||||
- file.parent
|
||||
- file.join
|
||||
- pack.request_writeable
|
||||
- crc32
|
||||
- table.merge
|
||||
- table.map
|
||||
- table.filter
|
||||
- table.set_default
|
||||
- table.flat
|
||||
- table.deep_flat
|
||||
- table.sub
|
||||
- math.sum
|
||||
- string.pad
|
||||
- string.left_pad
|
||||
- string.right_pad
|
||||
- block.reload_script
|
||||
- world.reload_script
|
||||
- entities.reload_component
|
||||
- hud.reload_script
|
||||
- item.reload_script
|
||||
- gfx.weather.change
|
||||
- gfx.weather.get_current
|
||||
- gfx.weather.get_current_data
|
||||
- gfx.weather.get_fall_intensity
|
||||
- gfx.weather.is_transition
|
||||
- inventory.decrement
|
||||
- inventory.use
|
||||
- inventory.set_count
|
||||
- inventory.get_data
|
||||
- inventory.set_data
|
||||
- inventory.get_all_data
|
||||
- inventory.has_data
|
||||
- item.uses
|
||||
- core.capture_output
|
||||
|
||||
Methods:
|
||||
|
||||
- canvas:set_data
|
||||
- canvas:line
|
||||
- canvas:blit
|
||||
- canvas:clear
|
||||
- canvas:create_texture
|
||||
- yaml.tostring
|
||||
- yaml.parse
|
||||
- gfx.posteffects.index
|
||||
- gfx.posteffects.set_effect
|
||||
- gfx.posteffects.get_intensity
|
||||
- gfx.posteffects.set_intensity
|
||||
- gfx.posteffects.is_active
|
||||
- gfx.posteffects.set_params
|
||||
- gfx.posteffects.set_array
|
||||
- block.get_variant
|
||||
- block.set_variant
|
||||
- bit.compile
|
||||
- Bytearray_as_string
|
||||
|
||||
## Fixes
|
||||
|
||||
- [fix incorrect entity transform scale & rotation combination](https://github.com/MihailRis/VoxelEngine-Cpp/commit/b832b9850f709053b43714bb0e3481560711e872)
|
||||
- [fix syntax highlighting not refreshing on selected text removal](https://github.com/MihailRis/VoxelEngine-Cpp/commit/33795f06f710de569a24b2d1937310b16dd040f5)
|
||||
- [fix TextBox behavior with markup used](https://github.com/MihailRis/VoxelEngine-Cpp/commit/31d5cb68800d965a668a67fd60bb4d3365181242)
|
||||
- [fix: console/chat open still available when menu is open & cleanup](https://github.com/MihailRis/VoxelEngine-Cpp/commit/c7061c70cb3b6382197c93d9442bfbb4c9fc1def)
|
||||
- [fix: Label.cpp: uinode size](https://github.com/MihailRis/VoxelEngine-Cpp/commit/6e8a4bacff77b7eba39393bcc8a5fb417a288884)
|
||||
- [fix: camera rotation not updating when menu is open](https://github.com/MihailRis/VoxelEngine-Cpp/commit/801354c15d96343b00963183f6f08219bd375ee8)
|
||||
- [fix stack split (right click) with item data](https://github.com/MihailRis/VoxelEngine-Cpp/commit/6ef82982bdc813bfc5c0ed2437a1a3fa9a2242d1)
|
||||
- [fix stack increment (right click) with item data](https://github.com/MihailRis/VoxelEngine-Cpp/commit/449b0ebca464f913f63913ad7af91811c717c349)
|
||||
- [fix caves generation](https://github.com/MihailRis/VoxelEngine-Cpp/commit/4c8b0824181f05aa5611a1e077f999788f575c42)
|
||||
- [fix: incorrect UV on custom model blocks](https://github.com/MihailRis/VoxelEngine-Cpp/commit/12105c29335481de429c8e6acc953e8cbcdc6ecf)
|
||||
- [bug fix content_menu.xml.lua](https://github.com/MihailRis/VoxelEngine-Cpp/commit/15e143afb0364f816a1033868b2501c9a9e69fda)
|
||||
- [fix: disabled bodies not skipping in entities raycast](https://github.com/MihailRis/VoxelEngine-Cpp/commit/5e10afc9b5d6582617fe34ec37abdb682e46197a)
|
||||
- [table.filter bug fix](https://github.com/MihailRis/VoxelEngine-Cpp/pull/481)
|
||||
- [fix: incorrect canvas Y direction](https://github.com/MihailRis/VoxelEngine-Cpp/commit/ee3fbc68314865384d2a7d78a22221b5987979a4)
|
||||
- [fix fatal error on audio.play_sound in headless-mode](https://github.com/MihailRis/VoxelEngine-Cpp/commit/a74a4fcf5366c8f78625f7087f42a8150f6896e0)
|
||||
- [fix BasicParser '\v' and '\x' escapes](https://github.com/MihailRis/VoxelEngine-Cpp/commit/8b0935d2b745acb11cba9c8bc647b4186d1817a3)
|
||||
- [fix: entity:despawn in on_save not preventing entity save](https://github.com/MihailRis/VoxelEngine-Cpp/pull/480)
|
||||
- [fix syntax highlighting unicode support](https://github.com/MihailRis/VoxelEngine-Cpp/pull/475)
|
||||
- [fix reading binary file as string](https://github.com/MihailRis/VoxelEngine-Cpp/commit/104cc116456aba6e569892521ecae92d8bf6b9ff)
|
||||
- [fix inventory.move_range](https://github.com/MihailRis/VoxelEngine-Cpp/commit/f5a4b5ca79806418b0736d3f84e9efa8d9992a34)
|
||||
- [fix: multiline text draw is not limited to the render area](https://github.com/MihailRis/VoxelEngine-Cpp/commit/a8067ad9d634cb3fc4632378277d62b32e4afb15)
|
||||
- [fix: "unknown argument --memcheck" in vctest](https://github.com/MihailRis/voxelcore/commit/281d5e09e6f1c016646af6000f6b111695c994b3)
|
||||
- [fix "upgrade square is not fully inside of area" error](https://github.com/MihailRis/voxelcore/commit/bf79f6bc75a7686d59fdd0dba8b9018d6191e980 )
|
||||
- [fix generator area centering](https://github.com/MihailRis/voxelcore/commit/98813472a8c25b1de93dd5d843af38c5aec9b1d8 "fix generator area centering")
|
||||
- [fix incomplete content reset](https://github.com/MihailRis/voxelcore/commit/61af8ba943a24f6544c6482def2e244cf0af4d18)
|
||||
- [fix stack traces](https://github.com/MihailRis/voxelcore/commit/05ddffb5c9902e237c73cdea55d4ac1e303c6a8e)
|
||||
- [fix containers refreshing](https://github.com/MihailRis/voxelcore/commit/34295faca276b55c6e3c0ddd98b867a0aab3eb2a)
|
||||
- [fix toml encoder](https://github.com/MihailRis/voxelcore/commit/9cd95bb0eb73521bef07f6f0d5e8b78f3e309ebf)
|
||||
- [fix InputBindBox](https://github.com/MihailRis/voxelcore/commit/7c976a573b01e3fb6f43bacaab22e34037b55b73 "fix InputBindBox")
|
||||
- [fix inventory.* functions error messages](https://github.com/MihailRis/voxelcore/commit/af3c315c04959eea6c11f5ae2854a6f253e3450f)
|
||||
- [fix: validator not called after backspace](https://github.com/MihailRis/voxelcore/commit/df3640978d279b85653d647facb26ef15c509848)
|
||||
- [fix: missing pack.has_indices if content is not loaded](https://github.com/MihailRis/voxelcore/commit/b02b45457322e1ce8f6b9735caeb5b58b1e2ffb4)
|
||||
- [fix: entities despawn on F5](https://github.com/MihailRis/voxelcore/commit/6ab48fda935f3f1d97d76a833c8511522857ba6a)
|
||||
- [bug fix [#549]](https://github.com/MihailRis/voxelcore/commit/49727ec02647e48323266fbf814c15f6d5632ee9)
|
||||
- [fix player camera zoom with fov-effects disabled](https://github.com/MihailRis/voxelcore/commit/014ffab183687ed9acbb93ab90e43d8f82ed826a)
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
## Latest release
|
||||
|
||||
- [Download](https://github.com/MihailRis/VoxelCore/releases/latest) | [Скачать](https://github.com/MihailRis/VoxelCore/releases/latest)
|
||||
- [Documentation](https://github.com/MihailRis/VoxelCore/blob/release-0.27/doc/en/main-page.md) | [Документация](https://github.com/MihailRis/VoxelCore/blob/release-0.27/doc/ru/main-page.md)
|
||||
- [Documentation](https://github.com/MihailRis/VoxelCore/blob/release-0.28/doc/en/main-page.md) | [Документация](https://github.com/MihailRis/VoxelCore/blob/release-0.28/doc/ru/main-page.md)
|
||||
|
||||
## Build project in Linux
|
||||
|
||||
|
||||
@ -75,6 +75,7 @@ Common methods:
|
||||
| ------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||
| clear() | clears content |
|
||||
| add(xml) | adds an element, creating it using xml code. Example: `container:add("<image src='test'/>")` |
|
||||
| add(xml, data) | overload with table, which in events declared in xml will be available as DATA |
|
||||
| setInterval(interval, callback) | assigns a function to be executed repeatedly at an interval specified in milliseconds |
|
||||
|
||||
## Textbox
|
||||
|
||||
@ -20,3 +20,4 @@
|
||||
- [Скриптинг](scripting.md)
|
||||
- [Стили текста](text-styles.md)
|
||||
- [Частицы](particles.md)
|
||||
- [Формат моделей VCM](vcm.md)
|
||||
|
||||
@ -71,11 +71,12 @@ document["worlds-panel"]:clear()
|
||||
|
||||
Методы:
|
||||
|
||||
| Метод | Описание |
|
||||
| ------------------------------- | ------------------------------------------------------------------------------------------- |
|
||||
| clear() | очищает контент |
|
||||
| add(xml) | добавляет элемент, создавая его по xml коду. Пример: `container:add("<image src='test'/>")` |
|
||||
| setInterval(interval, callback) | назначает функцию на повторяющееся выполнение с заданным в миллисекундах интервалом |
|
||||
| Метод | Описание |
|
||||
| ------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||
| clear() | очищает контент |
|
||||
| add(xml) | добавляет элемент, создавая его по xml коду. Пример: `container:add("<image src='test'/>")` |
|
||||
| add(xml, data) | перегрузка с передачей таблицы, которая в событиях, объявленных в xml будет доступна как DATA |
|
||||
| setInterval(interval, callback) | назначает функцию на повторяющееся выполнение с заданным в миллисекундах интервалом |
|
||||
|
||||
## Текстовое поле (textbox)
|
||||
|
||||
|
||||
49
doc/ru/vcm.md
Normal file
49
doc/ru/vcm.md
Normal file
@ -0,0 +1,49 @@
|
||||
## VCM
|
||||
|
||||
Текстовый формат описания 3D моделей, являющийся заменой устаревшего свойства `model-primitives`.
|
||||
|
||||
Синтаксис:
|
||||
|
||||
```
|
||||
@примитив атрибут (значение1,значение2,...) атрибут2 "значение3" {
|
||||
@внутренний_примитив ...
|
||||
}
|
||||
```
|
||||
|
||||
Аналогичная структура в XML:
|
||||
|
||||
```xml
|
||||
<примитив атрибут="значение1,значение2,..." атрибут2="значение3">
|
||||
<внутренний_примитив .../>
|
||||
</примитив>
|
||||
```
|
||||
|
||||
В отличие от XML в корне может находиться несколько элементов.
|
||||
|
||||
На данный момент существует два вида примитивов: box и rect, а также, part (описывает часть примитива, такую как, например, сторона куба).
|
||||
|
||||
### Свойства `rect`
|
||||
|
||||
- `from` - точка начала примитива. Пример: `from (0,0.5,0.125)`
|
||||
- `right` - вектор X, также определяющий ширину примитива. Пример: `right (1,0,0)`
|
||||
- `up` - вектор Y, также определяющий высоту примитива. Пример: `up (0,1,0)`
|
||||
- `texture` - отображаемая текстура. По-умолчанию: `$0`. Пример: `texture "blocks:sand"`
|
||||
- `region` - UV регион в границах выбранной текстуры, определяется позициями противоположных углов. Пример: `region (0,0,1,1)`
|
||||
- `region-scale` вектор-множитель для автоматически выбранного UV региона. Пример: `region-scale (0.5,1)`
|
||||
- `shading` определяет возможность затенения на примитиве. Пример: `shading off`
|
||||
- `flip` отражает UV регион по горизонтали или вертикали. Пример: `flip v`
|
||||
|
||||
### Свойства `box`
|
||||
|
||||
- `from` - точка начала примитива. Пример: `from (0,0,0)`
|
||||
- `to` - противоположная от начала точка. Пример: `to (1,1,1)`
|
||||
- `texture` - отображаемая текстура для всех сторон по-умолчанию.
|
||||
- `shading` определяет возможность затенения на примитиве. Пример: `shading off`
|
||||
- `delete` удаляет стороны по именам (top, bottom, east, west, north, south)
|
||||
|
||||
### Свойства `part` (в `box`)
|
||||
|
||||
- `tags` - определяет то, на какаие из сторон будут применены свойства. Пример: `tags (top,bottom)`
|
||||
- `texture` - отображаемая текстура. По-умолчанию: `$индекс_стороны`.
|
||||
- `region` - UV регион в границах выбранной текстуры, определяется позициями противоположных углов. Пример: `region (0,0,1,1)`
|
||||
- `region-scale` вектор-множитель для автоматически выбранного UV региона. Пример: `region-scale (0.5,1)`
|
||||
@ -1,6 +1,6 @@
|
||||
language = "VCM"
|
||||
extensions = ["vcm"]
|
||||
line-comment-start = "#"
|
||||
line-comment = "#"
|
||||
keywords = [
|
||||
"on", "off"
|
||||
]
|
||||
|
||||
@ -51,7 +51,9 @@ void main() {
|
||||
|
||||
mat4 viewmodel = u_view * u_model;
|
||||
a_distance = length(viewmodel * vec4(pos3d, 0.0));
|
||||
#ifndef ADVANCED_RENDER
|
||||
a_fog = calc_fog(length(viewmodel * vec4(pos3d * FOG_POS_SCALE, 0.0)) / 256.0);
|
||||
#endif
|
||||
a_emission = v_normal.w;
|
||||
|
||||
vec4 viewmodelpos = u_view * a_modelpos;
|
||||
|
||||
@ -151,6 +151,12 @@ public:
|
||||
return std::wstring(source.substr(start, pos - start));
|
||||
}
|
||||
|
||||
void emitLineComment(devtools::Location start) {
|
||||
auto string = readUntilEOL();
|
||||
emitToken(TokenTag::COMMENT, std::wstring(string), start);
|
||||
skipLine();
|
||||
}
|
||||
|
||||
std::vector<Token> tokenize() {
|
||||
skipWhitespace();
|
||||
while (hasNext()) {
|
||||
@ -229,16 +235,18 @@ public:
|
||||
}
|
||||
if (is_lua_operator_start(c)) {
|
||||
auto text = parseOperator();
|
||||
if (text == L"--") {
|
||||
auto string = readUntilEOL();
|
||||
emitToken(TokenTag::COMMENT, std::wstring(string), start);
|
||||
skipLine();
|
||||
if (text == syntax.lineComment) {
|
||||
emitLineComment(start);
|
||||
continue;
|
||||
}
|
||||
emitToken(TokenTag::OPERATOR, std::move(text), start);
|
||||
continue;
|
||||
}
|
||||
auto text = readUntilWhitespace();
|
||||
if (text.find(syntax.lineComment) == 0) {
|
||||
emitLineComment(start);
|
||||
continue;
|
||||
}
|
||||
emitToken(TokenTag::UNEXPECTED, std::wstring(text), start);
|
||||
}
|
||||
return std::move(tokens);
|
||||
|
||||
@ -67,7 +67,7 @@ void ContentGfxCache::refresh(const Block& def, const Atlas& atlas) {
|
||||
if (def.variants) {
|
||||
const auto& variants = def.variants->variants;
|
||||
for (int i = 1; i < variants.size() - 1; i++) {
|
||||
refresh_variant(assets, def, variants[i], i + 1, sideregions, atlas, settings, models);
|
||||
refresh_variant(assets, def, variants[i], i, sideregions, atlas, settings, models);
|
||||
}
|
||||
def.variants->variants.at(0) = def.defaults;
|
||||
}
|
||||
|
||||
@ -164,14 +164,14 @@ void WorldRenderer::setupWorldShader(
|
||||
auto inventory = player.getInventory();
|
||||
ItemStack& stack = inventory->getSlot(player.getChosenSlot());
|
||||
auto& item = indices->items.require(stack.getItemId());
|
||||
float multiplier = 0.5f;
|
||||
float multiplier = 0.75f;
|
||||
shader.uniform3f(
|
||||
"u_torchlightColor",
|
||||
item.emission[0] / 15.0f * multiplier,
|
||||
item.emission[1] / 15.0f * multiplier,
|
||||
item.emission[2] / 15.0f * multiplier
|
||||
);
|
||||
shader.uniform1f("u_torchlightDistance", 6.0f);
|
||||
shader.uniform1f("u_torchlightDistance", 8.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -220,6 +220,7 @@ void EnginePaths::cleanup() {
|
||||
io::remove_device(entryPoint);
|
||||
}
|
||||
entryPoints.clear();
|
||||
writeables.clear();
|
||||
}
|
||||
|
||||
void EnginePaths::setEntryPoints(std::vector<PathsRoot> entryPoints) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user