Не подтверждена Коммит bd1b86c2 создал по автору 6yntar05's avatar 6yntar05
Просмотр файлов

Fixed Static-Functors; Returned -O3

владелец a51d184a
......@@ -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 -O0) # -fsanitize=undefined -fsanitize=address)
add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-parameter -fdiagnostics-color=always -O3) # -fsanitize=undefined -fsanitize=address)
# add_link_options(-fsanitize=undefined -fsanitize=address)
project(${PROJECT_NAME} LANGUAGES ${PROG_LANG})
......
#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.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать