Открыть боковую панель
6yntar05
BebraCraft
Коммиты
bd1b86c2
Не подтверждена
Коммит
bd1b86c2
создал
Фев 19, 2023
по автору
6yntar05
Просмотр файлов
Fixed Static-Functors; Returned -O3
владелец
a51d184a
Изменения
2
Скрыть пробелы
Построчно
Рядом
CMakeLists.txt
Просмотр файла @
bd1b86c2
...
...
@@ -9,7 +9,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set
(
OpenGL_GL_PREFERENCE GLVND
)
add_compile_options
(
-Wall -Wextra -Wpedantic -Wno-unused-parameter -fdiagnostics-color=always -O
0
)
# -fsanitize=undefined -fsanitize=address)
add_compile_options
(
-Wall -Wextra -Wpedantic -Wno-unused-parameter -fdiagnostics-color=always -O
3
)
# -fsanitize=undefined -fsanitize=address)
# add_link_options(-fsanitize=undefined -fsanitize=address)
project
(
${
PROJECT_NAME
}
LANGUAGES
${
PROG_LANG
}
)
...
...
src/game/game.cpp
Просмотр файла @
bd1b86c2
#include
<iostream>
#include
<type_traits>
#include
<vector>
#include
<unistd.h>
#include
<cstdint>
#include
<cassert>
#include
<cmath>
#include
<functional>
#include
<GL/glew.h>
#include
<GL/gl.h>
...
...
@@ -116,15 +118,15 @@ int main() {
/// Render chunk
// Functor: Render single layer of chunk
static
auto
layerFunctor
=
[
&
](
bebra
::
objects
::
chunk
&
shittedChunk
,
int
iLayer
)
{
static
std
::
function
layerFunctor
=
[
&
](
bebra
::
objects
::
chunk
&
shittedChunk
,
int
iLayer
)
{
bebra
::
objects
::
chunkLayer
&
layer
=
shittedChunk
[
iLayer
];
// Functor: Render single row of chunk
static
auto
rowFunctor
=
[
&
](
bebra
::
objects
::
chunkLayer
&
layer
,
int
iRow
)
{
static
std
::
function
rowFunctor
=
[
&
](
bebra
::
objects
::
chunkLayer
&
layer
,
int
iRow
)
{
bebra
::
objects
::
chunkRow
&
row
=
layer
[
iRow
];
// Functor: Render single block of chunk
static
auto
blockFunctor
=
[
&
](
bebra
::
objects
::
chunkRow
&
row
,
int
iBlock
)
{
static
std
::
function
blockFunctor
=
[
&
](
bebra
::
objects
::
chunkRow
&
row
,
int
iBlock
)
{
bebra
::
objects
::
block
*
block
=
row
[
iBlock
];
if
(
block
->
air
)
return
;
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать