Skip to content

Commit

Permalink
codeStyleCheck.php of recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zebastian committed Jul 1, 2017
1 parent 370cf17 commit aa0d0ff
Show file tree
Hide file tree
Showing 19 changed files with 336 additions and 65 deletions.
2 changes: 1 addition & 1 deletion mandelbulber2/opencl/engines/limited_engine.cl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ kernel void fractal3D(
step = (distance - 0.5f * distThresh) * consts->params.DEFactor;
scan += step / length(viewVector);
}

point = start + viewVector * scan;

// final binary searching
Expand Down
33 changes: 33 additions & 0 deletions mandelbulber2/opencl/engines/normal_vector.cl
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
/**
* Mandelbulber v2, a 3D fractal generator ,=#MKNmMMKmmßMNWy,
* ,B" ]L,,p%%%,,,§;, "K
* Copyright (C) 2017 Mandelbulber Team §R-==%w["'~5]m%=L.=~5N
* ,=mm=§M ]=4 yJKA"/-Nsaj "Bw,==,,
* This file is part of Mandelbulber. §R.r= jw",M Km .mM FW ",§=ß., ,TN
* ,4R =%["w[N=7]J '"5=],""]]M,w,-; T=]M
* Mandelbulber is free software: §R.ß~-Q/M=,=5"v"]=Qf,'§"M= =,M.§ Rz]M"Kw
* you can redistribute it and/or §w "xDY.J ' -"m=====WeC=\ ""%""y=%"]"" §
* modify it under the terms of the "§M=M =D=4"N #"%==A%p M§ M6 R' #"=~.4M
* GNU General Public License as §W =, ][T"]C § § '§ e===~ U !§[Z ]N
* published by the 4M",,Jm=,"=e~ § § j]]""N BmM"py=ßM
* Free Software Foundation, ]§ T,M=& 'YmMMpM9MMM%=w=,,=MT]M m§;'§,
* either version 3 of the License, TWw [.j"5=~N[=§%=%W,T ]R,"=="Y[LFT ]N
* or (at your option) TW=,-#"%=;[ =Q:["V"" ],,M.m == ]N
* any later version. J§"mr"] ,=,," =="""J]= M"M"]==ß"
* §= "=C=4 §"eM "=B:m|4"]#F,§~
* Mandelbulber is distributed in "9w=,,]w em%wJ '"~" ,=,,ß"
* the hope that it will be useful, . "K= ,=RMMMßM"""
* but WITHOUT ANY WARRANTY; .'''
* without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Mandelbulber. If not, see <http://www.gnu.org/licenses/>.
*
* ###########################################################################
*
* Authors: Krzysztof Marczak ([email protected])
*
* Normal vector calculation for opencl
*/

float3 NormalVector(__constant sClInConstants *consts, float3 point, float mainDistance,
float distThresh, sClCalcParams *calcParam)
Expand Down
36 changes: 35 additions & 1 deletion mandelbulber2/opencl/engines/shaders.cl
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
/**
* Mandelbulber v2, a 3D fractal generator ,=#MKNmMMKmmßMNWy,
* ,B" ]L,,p%%%,,,§;, "K
* Copyright (C) 2017 Mandelbulber Team §R-==%w["'~5]m%=L.=~5N
* ,=mm=§M ]=4 yJKA"/-Nsaj "Bw,==,,
* This file is part of Mandelbulber. §R.r= jw",M Km .mM FW ",§=ß., ,TN
* ,4R =%["w[N=7]J '"5=],""]]M,w,-; T=]M
* Mandelbulber is free software: §R.ß~-Q/M=,=5"v"]=Qf,'§"M= =,M.§ Rz]M"Kw
* you can redistribute it and/or §w "xDY.J ' -"m=====WeC=\ ""%""y=%"]"" §
* modify it under the terms of the "§M=M =D=4"N #"%==A%p M§ M6 R' #"=~.4M
* GNU General Public License as §W =, ][T"]C § § '§ e===~ U !§[Z ]N
* published by the 4M",,Jm=,"=e~ § § j]]""N BmM"py=ßM
* Free Software Foundation, ]§ T,M=& 'YmMMpM9MMM%=w=,,=MT]M m§;'§,
* either version 3 of the License, TWw [.j"5=~N[=§%=%W,T ]R,"=="Y[LFT ]N
* or (at your option) TW=,-#"%=;[ =Q:["V"" ],,M.m == ]N
* any later version. J§"mr"] ,=,," =="""J]= M"M"]==ß"
* §= "=C=4 §"eM "=B:m|4"]#F,§~
* Mandelbulber is distributed in "9w=,,]w em%wJ '"~" ,=,,ß"
* the hope that it will be useful, . "K= ,=RMMMßM"""
* but WITHOUT ANY WARRANTY; .'''
* without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Mandelbulber. If not, see <http://www.gnu.org/licenses/>.
*
* ###########################################################################
*
* Authors: Krzysztof Marczak ([email protected])
*
* misc shader function optimized for opencl
*/

typedef struct
{
float3 point;
Expand Down Expand Up @@ -800,4 +834,4 @@ float4 VolumetricShader(__constant sClInConstants *consts, sShaderInputDataCl *i

out4.xyz = output;
return out4;
}
}
36 changes: 35 additions & 1 deletion mandelbulber2/opencl/engines/ssao.cl
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
/**
* Mandelbulber v2, a 3D fractal generator ,=#MKNmMMKmmßMNWy,
* ,B" ]L,,p%%%,,,§;, "K
* Copyright (C) 2017 Mandelbulber Team §R-==%w["'~5]m%=L.=~5N
* ,=mm=§M ]=4 yJKA"/-Nsaj "Bw,==,,
* This file is part of Mandelbulber. §R.r= jw",M Km .mM FW ",§=ß., ,TN
* ,4R =%["w[N=7]J '"5=],""]]M,w,-; T=]M
* Mandelbulber is free software: §R.ß~-Q/M=,=5"v"]=Qf,'§"M= =,M.§ Rz]M"Kw
* you can redistribute it and/or §w "xDY.J ' -"m=====WeC=\ ""%""y=%"]"" §
* modify it under the terms of the "§M=M =D=4"N #"%==A%p M§ M6 R' #"=~.4M
* GNU General Public License as §W =, ][T"]C § § '§ e===~ U !§[Z ]N
* published by the 4M",,Jm=,"=e~ § § j]]""N BmM"py=ßM
* Free Software Foundation, ]§ T,M=& 'YmMMpM9MMM%=w=,,=MT]M m§;'§,
* either version 3 of the License, TWw [.j"5=~N[=§%=%W,T ]R,"=="Y[LFT ]N
* or (at your option) TW=,-#"%=;[ =Q:["V"" ],,M.m == ]N
* any later version. J§"mr"] ,=,," =="""J]= M"M"]==ß"
* §= "=C=4 §"eM "=B:m|4"]#F,§~
* Mandelbulber is distributed in "9w=,,]w em%wJ '"~" ,=,,ß"
* the hope that it will be useful, . "K= ,=RMMMßM"""
* but WITHOUT ANY WARRANTY; .'''
* without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Mandelbulber. If not, see <http://www.gnu.org/licenses/>.
*
* ###########################################################################
*
* Authors: Krzysztof Marczak ([email protected])
*
* SSAO shader function optimized for opencl
*/

//------------------ MAIN RENDER FUNCTION --------------------
kernel void SSAO(__global float *zBuffer, __global float *out, sParamsSSAO p)
{
Expand Down Expand Up @@ -55,4 +89,4 @@ kernel void SSAO(__global float *zBuffer, __global float *out, sParamsSSAO p)
totalAmbient = max(totalAmbient, 0.0f);
}
out[i] = totalAmbient;
}
}
35 changes: 31 additions & 4 deletions mandelbulber2/opencl/material_cl.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
/*
* material.h
/**
* Mandelbulber v2, a 3D fractal generator ,=#MKNmMMKmmßMNWy,
* ,B" ]L,,p%%%,,,§;, "K
* Copyright (C) 2017 Mandelbulber Team §R-==%w["'~5]m%=L.=~5N
* ,=mm=§M ]=4 yJKA"/-Nsaj "Bw,==,,
* This file is part of Mandelbulber. §R.r= jw",M Km .mM FW ",§=ß., ,TN
* ,4R =%["w[N=7]J '"5=],""]]M,w,-; T=]M
* Mandelbulber is free software: §R.ß~-Q/M=,=5"v"]=Qf,'§"M= =,M.§ Rz]M"Kw
* you can redistribute it and/or §w "xDY.J ' -"m=====WeC=\ ""%""y=%"]"" §
* modify it under the terms of the "§M=M =D=4"N #"%==A%p M§ M6 R' #"=~.4M
* GNU General Public License as §W =, ][T"]C § § '§ e===~ U !§[Z ]N
* published by the 4M",,Jm=,"=e~ § § j]]""N BmM"py=ßM
* Free Software Foundation, ]§ T,M=& 'YmMMpM9MMM%=w=,,=MT]M m§;'§,
* either version 3 of the License, TWw [.j"5=~N[=§%=%W,T ]R,"=="Y[LFT ]N
* or (at your option) TW=,-#"%=;[ =Q:["V"" ],,M.m == ]N
* any later version. J§"mr"] ,=,," =="""J]= M"M"]==ß"
* §= "=C=4 §"eM "=B:m|4"]#F,§~
* Mandelbulber is distributed in "9w=,,]w em%wJ '"~" ,=,,ß"
* the hope that it will be useful, . "K= ,=RMMMßM"""
* but WITHOUT ANY WARRANTY; .'''
* without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Created on: 9 cze 2017
* Author: krzysztof
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Mandelbulber. If not, see <http://www.gnu.org/licenses/>.
*
* ###########################################################################
*
* Authors: Krzysztof Marczak ([email protected])
*
* material struct for opencl
*/

#ifndef MANDELBULBER2_OPENCL_MATERIAL_CL_H_
Expand Down
35 changes: 31 additions & 4 deletions mandelbulber2/opencl/ssao_cl.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,35 @@
/*
* ssao_cl.h
/**
* Mandelbulber v2, a 3D fractal generator ,=#MKNmMMKmmßMNWy,
* ,B" ]L,,p%%%,,,§;, "K
* Copyright (C) 2017 Mandelbulber Team §R-==%w["'~5]m%=L.=~5N
* ,=mm=§M ]=4 yJKA"/-Nsaj "Bw,==,,
* This file is part of Mandelbulber. §R.r= jw",M Km .mM FW ",§=ß., ,TN
* ,4R =%["w[N=7]J '"5=],""]]M,w,-; T=]M
* Mandelbulber is free software: §R.ß~-Q/M=,=5"v"]=Qf,'§"M= =,M.§ Rz]M"Kw
* you can redistribute it and/or §w "xDY.J ' -"m=====WeC=\ ""%""y=%"]"" §
* modify it under the terms of the "§M=M =D=4"N #"%==A%p M§ M6 R' #"=~.4M
* GNU General Public License as §W =, ][T"]C § § '§ e===~ U !§[Z ]N
* published by the 4M",,Jm=,"=e~ § § j]]""N BmM"py=ßM
* Free Software Foundation, ]§ T,M=& 'YmMMpM9MMM%=w=,,=MT]M m§;'§,
* either version 3 of the License, TWw [.j"5=~N[=§%=%W,T ]R,"=="Y[LFT ]N
* or (at your option) TW=,-#"%=;[ =Q:["V"" ],,M.m == ]N
* any later version. J§"mr"] ,=,," =="""J]= M"M"]==ß"
* §= "=C=4 §"eM "=B:m|4"]#F,§~
* Mandelbulber is distributed in "9w=,,]w em%wJ '"~" ,=,,ß"
* the hope that it will be useful, . "K= ,=RMMMßM"""
* but WITHOUT ANY WARRANTY; .'''
* without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*
* Created on: 22 cze 2017
* Author: krzysztof
* See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Mandelbulber. If not, see <http://www.gnu.org/licenses/>.
*
* ###########################################################################
*
* Authors: Krzysztof Marczak ([email protected])
*
* ssao struct for opencl
*/

#ifndef MANDELBULBER2_OPENCL_SSAO_CL_H_
Expand Down
18 changes: 9 additions & 9 deletions mandelbulber2/qt/thumbnail_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ void cThumbnailWidget::slotRender()
renderJob->moveToThread(thread);
QObject::connect(thread, SIGNAL(started()), renderJob, SLOT(slotExecute()));

// while (renderJob->GetRunningJobCount() > systemData.numberOfThreads * 5)
// {
// }
// while (renderJob->GetRunningJobCount() > systemData.numberOfThreads * 5)
// {
// }
thread->setObjectName("ThumbnailWorker");
thread->start();

Expand Down Expand Up @@ -305,12 +305,12 @@ void cThumbnailWidget::slotFullyRendered()

void cThumbnailWidget::slotRandomRender()
{
if (cRenderJob::GetRunningJobCount() > systemData.numberOfThreads)
{
// if it's to busy, render later
timer->start(Random(100000) * 10 + 1);
}
else
if (cRenderJob::GetRunningJobCount() > systemData.numberOfThreads)
{
// if it's to busy, render later
timer->start(Random(100000) * 10 + 1);
}
else
{
isRendered = true;
slotRender();
Expand Down
4 changes: 2 additions & 2 deletions mandelbulber2/src/animation_keyframes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1133,8 +1133,8 @@ void cKeyframeAnimation::slotExportKeyframesToFlight()
if (gAnimFrames->GetFrames().size() > 0)
{
QMessageBox::StandardButton reply;
reply = QMessageBox::question(mainInterface->mainWindow->GetCentralWidget(),
QObject::tr("Export keyframes to flight"),
reply = QMessageBox::question(
mainInterface->mainWindow->GetCentralWidget(), QObject::tr("Export keyframes to flight"),
QObject::tr(
"There are already captured flight frames present.\nDiscard current flight frames ?"),
QMessageBox::Yes | QMessageBox::No);
Expand Down
45 changes: 26 additions & 19 deletions mandelbulber2/src/command_line_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ cCommandLineInterface::cCommandLineInterface(QCoreApplication *qApplication)
QCoreApplication::translate("main", "Stops rendering on frame number <N>."),
QCoreApplication::translate("main", "N"));

QCommandLineOption overrideOption(QStringList({"O", "override"}),
QCommandLineOption overrideOption(
QStringList({"O", "override"}),
QCoreApplication::translate("main",
"<KEY=VALUE> overrides item '<KEY>' from settings file with new value '<VALUE>'.\n"
"Specify multiple KEY=VALUE pairs by separating with a '#': <KEY1=VALUE1#KEY2=VALUE2>. Quote "
Expand All @@ -89,22 +90,24 @@ cCommandLineInterface::cCommandLineInterface(QCoreApplication *qApplication)
"fractal"),
QCoreApplication::translate("main", "..."));

QCommandLineOption listOption(QStringList({"L", "list"}),
QCommandLineOption listOption(
QStringList({"L", "list"}),
QCoreApplication::translate(
"main", "Lists all possible parameters '<KEY>' with corresponding default value '<VALUE>'."));

QCommandLineOption formatOption(QStringList({"f", "format"}),
QCoreApplication::translate("main",
"Image output format:\n"
" jpg - JPEG format (default)\n"
" png - PNG format\n"
" png16 - 16-bit PNG format\n"
" png16alpha - 16-bit PNG with alpha channel format\n"
" exr - EXR format\n"
" tiff - TIFF format"),
"Image output format:\n"
" jpg - JPEG format (default)\n"
" png - PNG format\n"
" png16 - 16-bit PNG format\n"
" png16alpha - 16-bit PNG with alpha channel format\n"
" exr - EXR format\n"
" tiff - TIFF format"),
QCoreApplication::translate("main", "FORMAT"));

QCommandLineOption resOption(QStringList({"r", "res"}),
QCommandLineOption resOption(
QStringList({"r", "res"}),
QCoreApplication::translate(
"main", "Overrides image resolution. Specify as width and height separated by 'x'"),
QCoreApplication::translate("main", "WxH"));
Expand All @@ -116,7 +119,8 @@ cCommandLineInterface::cCommandLineInterface(QCoreApplication *qApplication)
QCommandLineOption serverOption(QStringList({"S", "server"}),
QCoreApplication::translate("main", "Sets application as a server listening for clients."));

QCommandLineOption hostOption(QStringList({"H", "host"}),
QCommandLineOption hostOption(
QStringList({"H", "host"}),
QCoreApplication::translate("main",
"Sets application as a client connected to server of given host address"
" (Host can be of type IPv4, IPv6 and Domain name address)."),
Expand All @@ -127,8 +131,8 @@ cCommandLineInterface::cCommandLineInterface(QCoreApplication *qApplication)
QCoreApplication::translate("main", "N"));

QCommandLineOption noColorOption(QStringList({"C", "no-cli-color"}),
QCoreApplication::translate(
"main", "Starts program without ANSI colors, when execution on CLI."));
QCoreApplication::translate("main",
"Starts program without ANSI colors, when execution on CLI."));

QCommandLineOption outputOption(QStringList({"o", "output"}),
QCoreApplication::translate("main", "Saves rendered image(s) to this file / folder."),
Expand All @@ -140,20 +144,22 @@ cCommandLineInterface::cCommandLineInterface(QCoreApplication *qApplication)
QCommandLineOption testOption(QStringList({"t", "test"}),
QCoreApplication::translate("main", "Runs testcases on the mandelbulber instance"));

QCommandLineOption benchmarkOption(QStringList({"b", "benchmark"}),
QCommandLineOption benchmarkOption(
QStringList({"b", "benchmark"}),
QCoreApplication::translate("main",
"Runs benchmarks on the mandelbulber instance, specify optional"
" parameter difficulty (1 -> very easy, > 20 -> very hard, 10 -> default)"));

QCommandLineOption touchOption(QStringList({"T", "touch"}),
QCommandLineOption touchOption(
QStringList({"T", "touch"}),
QCoreApplication::translate(
"main", "Resaves a settings file (can be used to update a settings file)"));

QCommandLineOption voxelOption(QStringList({"V", "voxel"}),
QCoreApplication::translate("main",
"Renders the voxel volume. Output formats are:\n"
" slice - stack of PNG images into one folder (default)\n"
" ply - Polygon File Format (single 3d file)\n"),
"Renders the voxel volume. Output formats are:\n"
" slice - stack of PNG images into one folder (default)\n"
" ply - Polygon File Format (single 3d file)\n"),
QCoreApplication::translate("main", "FORMAT"));

QCommandLineOption statsOption(QStringList({"stats"}),
Expand All @@ -164,7 +170,8 @@ cCommandLineInterface::cCommandLineInterface(QCoreApplication *qApplication)
QCommandLineOption helpExamplesOption(
QStringList({"help-examples"}), QCoreApplication::translate("main", "Shows example commands."));

parser.addPositionalArgument("settings_file",
parser.addPositionalArgument(
"settings_file",
QCoreApplication::translate("main",
"file with fractal settings (program also tries\nto find file in ./mandelbulber/settings "
"directory)\n"
Expand Down
2 changes: 1 addition & 1 deletion mandelbulber2/src/dof.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void cPostRenderingDOF::Render(cRegion<int> screenRegion, float deep, float neut
sRGBFloat *temp_image = new sRGBFloat[quint64(imageWidth) * quint64(imageHeight)];
unsigned short *temp_alpha = new unsigned short[quint64(imageWidth) * quint64(imageHeight)];
quint64 sortBufferSize = quint64(screenRegion.height) * quint64(screenRegion.width);
sSortZ<float> *temp_sort = new sSortZ<float>[ sortBufferSize ];
sSortZ<float> *temp_sort = new sSortZ<float>[sortBufferSize];

{
quint64 index = 0;
Expand Down
2 changes: 1 addition & 1 deletion mandelbulber2/src/fractal_enums.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Mandelbulber v2, a 3D fractal generator ,=#MKNmMMKmmßMNWy,
* ,B" ]L,,p%%%,,,§;, "K
* Copyright (C) 2016 Mandelbulber Team §R-==%w["'~5]m%=L.=~5N
* Copyright (C) 2016-17 Mandelbulber Team §R-==%w["'~5]m%=L.=~5N
* ,=mm=§M ]=4 yJKA"/-Nsaj "Bw,==,,
* This file is part of Mandelbulber. §R.r= jw",M Km .mM FW ",§=ß., ,TN
* ,4R =%["w[N=7]J '"5=],""]]M,w,-; T=]M
Expand Down
Loading

0 comments on commit aa0d0ff

Please sign in to comment.