--Bug fixes

-Really fix locking of affine scale.

--Code changes
 -Remove dependency projects from the solution. Move to a project design where they are built once via command line and stored in a /Deps folder.
  --Because of this, libpng is built as a static lib instead of a dll because that's what its command line makefile supports.
  --Remove libpng16.dll from Wix installer.
 -Remove all configs except for debug and release.
 -Remove all platforms except for x64.
 -Add #define __TBB_NO_IMPLICIT_LINKAGE 1 to prevent tbb from locking for tbb_debug.lib by default on debug builds.
 -Put Ember.rc in a filter folder in the project.
 -Place pragma warning disable statements in PCH files rather than in projects. This makes it easier when using Qt Creator.
 -Move all resource files to the MSVC folder.
 -Set all targets in QtCreator project to their lowercase names to be more *nix friendly. Set -l link statements to use these new lowercase names for ember and embercl.
 -Rework projects to favor shadow builds.
 -Remove the symlinks.sh file and all references to it. It was never needed. Instead, just specify multiple include and link paths in the .pro files.
 -Change WIN32 to _WIN32.
 -Fix a few code warnings.
This commit is contained in:
mfeemster
2016-03-01 17:26:45 -08:00
parent 695b8fc823
commit 7c856c929c
70 changed files with 1300 additions and 4046 deletions

View File

@ -1,6 +1,6 @@
#include "EmberPch.h"
#ifdef WIN32
#ifdef _WIN32
/// <summary>
/// Generated by Visual Studio to make the DLL run properly.
/// </summary>

View File

@ -54,8 +54,8 @@ public:
/// </summary>
/// <param name="ember">The Ember object to copy</param>
Ember(const Ember<T>& ember)
: m_VariationList(VariationList<T>::Instance()),
m_Edits(nullptr)
: m_Edits(nullptr),
m_VariationList(VariationList<T>::Instance())
{
Ember<T>::operator=<T>(ember);
}
@ -66,8 +66,8 @@ public:
/// <param name="ember">The Ember object to copy</param>
template <typename U>
Ember(const Ember<U>& ember)
: m_VariationList(VariationList<T>::Instance()),
m_Edits(nullptr)
: m_Edits(nullptr),
m_VariationList(VariationList<T>::Instance())
{
Ember<T>::operator=<U>(ember);
}

View File

@ -92,7 +92,7 @@ static inline size_t NowMs()
//#define ISAAC_FLAM3_DEBUG 1//This is almost never needed, but is very useful when troubleshooting difficult bugs. Enable it to do a side by side comparison with flam3.
//These two must always match.
#ifdef WIN32
#ifdef _WIN32
#define ALIGN __declspec(align(16))
#else
#define ALIGN __attribute__ ((aligned (16)))

View File

@ -1,4 +1,4 @@
#ifdef WIN32
#ifdef _WIN32
#pragma once
#endif
@ -8,8 +8,10 @@
#define NOMINMAX
#define _USE_MATH_DEFINES
#define __TBB_NO_IMPLICIT_LINKAGE 1//Prevent tbb from automatically looking for tbb_debug.lib. We only care about the release tbb.lib/dll.
#ifdef _WIN32
#pragma warning(disable : 4251; disable : 4661; disable : 4100)
#define basename(x) _strdup(x)
#define snprintf _snprintf
#define snprintf_s _snprintf_s

View File

@ -348,7 +348,7 @@ public:
//Add the edit attributes.
//Date.
myTime = time(nullptr);
#ifdef WIN32
#ifdef _WIN32
tm localt;
localtime_s(&localt, &myTime);
strftime(timeString, 128, "%a %b %d %H:%M:%S %z %Y", &localt);//XXX use standard time format including timezone.

View File

@ -1260,7 +1260,7 @@ EmberStats Renderer<T, bucketT>::Iterate(size_t iterCount, size_t temporalSample
parallel_for(size_t(0), m_ThreadsToUse, [&] (size_t threadIndex)
{
#endif
#if defined(WIN32)
#if defined(_WIN32)
SetThreadPriority(GetCurrentThread(), int(m_Priority));
#elif defined(__APPLE__)
sched_param sp = {0};

View File

@ -239,7 +239,7 @@ bool RendererBase::Ok() const
size_t RendererBase::MemoryAvailable()
{
size_t memAvailable = 0;
#ifdef WIN32
#ifdef _WIN32
MEMORYSTATUSEX stat;
stat.dwLength = sizeof(stat);
GlobalMemoryStatusEx(&stat);

View File

@ -446,9 +446,9 @@ const Variation<T>* VariationList<T>::GetVariation(size_t index, eVariationType
/// <param name="weight">The weight to assign the new copy. Default: 1</param>
/// <returns>A pointer to the variation at the index if in range, else nullptr.</returns>
template <typename T>
Variation<T>* VariationList<T>::GetVariationCopy(size_t index, T weight = 1) const { return MakeCopyWithWeight(GetVariation(index), weight); }
Variation<T>* VariationList<T>::GetVariationCopy(size_t index, T weight) const { return MakeCopyWithWeight(GetVariation(index), weight); }
template <typename T>
Variation<T>* VariationList<T>::GetVariationCopy(size_t index, eVariationType varType, T weight = 1) const { return MakeCopyWithWeight(GetVariation(index, varType), weight); }
Variation<T>* VariationList<T>::GetVariationCopy(size_t index, eVariationType varType, T weight) const { return MakeCopyWithWeight(GetVariation(index, varType), weight); }
/// <summary>
/// Get a pointer to the variation with the specified ID.
@ -473,7 +473,7 @@ const Variation<T>* VariationList<T>::GetVariation(eVariationId id) const
/// <param name="weight">The weight to assign the new copy. Default: 1</param>
/// <returns>A pointer to the variation with a matching ID, else nullptr.</returns>
template <typename T>
Variation<T>* VariationList<T>::GetVariationCopy(eVariationId id, T weight = 1) const { return MakeCopyWithWeight(GetVariation(id), weight); }
Variation<T>* VariationList<T>::GetVariationCopy(eVariationId id, T weight) const { return MakeCopyWithWeight(GetVariation(id), weight); }
/// <summary>
/// Get a pointer to the variation with the specified name.
@ -498,7 +498,7 @@ const Variation<T>* VariationList<T>::GetVariation(const string& name) const
/// <param name="weight">The weight to assign the new copy. Default: 1</param>
/// <returns>A pointer to the variation with a matching name, else nullptr.</returns>
template <typename T>
Variation<T>* VariationList<T>::GetVariationCopy(const string& name, T weight = 1) const { return MakeCopyWithWeight(GetVariation(name), weight); }
Variation<T>* VariationList<T>::GetVariationCopy(const string& name, T weight) const { return MakeCopyWithWeight(GetVariation(name), weight); }
/// <summary>
/// Get a parametric variation at the specified index.
@ -586,4 +586,4 @@ template EMBER_API class VariationList<float>;
#ifdef DO_DOUBLE
template EMBER_API class VariationList<double>;
#endif
}
}

View File

@ -442,7 +442,7 @@ public:
static string Itos(int i, int radix = 10)
{
char ch[16];
#ifdef WIN32
#ifdef _WIN32
_itoa_s(i, ch, 16, radix);
#else
sprintf(ch, "%d", i);
@ -460,7 +460,7 @@ public:
static string Itos64(size_t i, int radix = 10)
{
char ch[64];
#ifdef WIN32
#ifdef _WIN32
_ui64toa_s(i, ch, 64, radix);
#else
sprintf(ch, "%lu", i);
@ -1495,7 +1495,7 @@ private:
}
while (colorCount < numColors && colorCount < ember.m_Palette.m_Entries.size());
#ifdef WIN32
#ifdef _WIN32
if (sscanf_s(&(colstr[colorIndex]), "%1s", tmps, sizeof(tmps)) > 0) //Really need to migrate all of this parsing to C++.//TODO
#else

View File

@ -462,7 +462,7 @@ int _tmain(int argc, _TCHAR* argv[])
EmberOptions opt;
//Required for large allocs, else GPU memory usage will be severely limited to small sizes.
//This must be done in the application and not in the EmberCL DLL.
#ifdef WIN32
#ifdef _WIN32
_putenv_s("GPU_MAX_ALLOC_PERCENT", "100");
#else
putenv(const_cast<char*>("GPU_MAX_ALLOC_PERCENT=100"));

View File

@ -1,98 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include <windows.h>
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "..\\Fractorium\\Icons\\\\Fractorium.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,9,9,4
PRODUCTVERSION 0,9,9,4
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x0L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Open Source"
VALUE "FileDescription", "Renders fractal flames as animations with motion blur"
VALUE "FileVersion", "0.9.9.4"
VALUE "InternalName", "EmberAnimate.exe"
VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2015, GPL v3"
VALUE "OriginalFilename", "EmberAnimate.exe"
VALUE "ProductName", "Ember Animate"
VALUE "ProductVersion", "0.9.9.4"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -147,11 +147,10 @@ uint DEOpenCLKernelCreator::MaxDEFilterSize() { return 9; }//The true max would
/// size of up to 9: (20 - 1) / 2 == (19 / 2) == 9 could be supported.
/// This function is deprecated, the appropriate kernels take care of this problem now.
/// </summary>
/// <param name="maxBoxSize">Maximum size of the box.</param>
/// <param name="desiredFilterSize">Size of the desired filter.</param>
/// <param name="ss">The supersample being used</param>
/// <returns>The maximum filter radius allowed</returns>
double DEOpenCLKernelCreator::SolveMaxDERad(uint maxBoxSize, double desiredFilterSize, double ss)
double DEOpenCLKernelCreator::SolveMaxDERad(double desiredFilterSize, double ss)
{
uint finalFilterSize = uint((ceil(desiredFilterSize) * ss) + (ss - 1.0));

View File

@ -41,7 +41,7 @@ public:
//Miscellaneous static functions.
static uint MaxDEFilterSize();
static double SolveMaxDERad(uint maxBoxSize, double desiredFilterSize, double ss);
static double SolveMaxDERad(double desiredFilterSize, double ss);
static uint SolveMaxBoxSize(uint localMem);
private:

View File

@ -1,4 +1,4 @@
#ifdef WIN32
#ifdef _WIN32
#pragma once
#endif
@ -14,6 +14,7 @@
#include "Renderer.h"
#if defined(_WIN32)
#pragma warning(disable : 4251; disable : 4661; disable : 4100)
#include <windows.h>
#include <SDKDDKVer.h>
#include "GL/gl.h"

View File

@ -119,7 +119,7 @@ bool RendererCL<T, bucketT>::Init(const vector<pair<size_t, size_t>>& devices, b
{
try
{
unique_ptr<RendererClDevice> cld(new RendererClDevice(typeid(T) == typeid(double), devices[i].first, devices[i].second, i == 0 ? shared : false));
unique_ptr<RendererClDevice> cld(new RendererClDevice(devices[i].first, devices[i].second, i == 0 ? shared : false));
if ((b = cld->Init()))//Build a simple program to ensure OpenCL is working right.
{

View File

@ -12,7 +12,7 @@ namespace EmberCLns
/// <param name="device">The index device of the device to use</param>
/// <param name="shared">True if shared with OpenGL, else false.</param>
/// <returns>True if success, else false.</returns>
RendererClDevice::RendererClDevice(bool doublePrec, size_t platform, size_t device, bool shared)
RendererClDevice::RendererClDevice(size_t platform, size_t device, bool shared)
{
m_Init = false;
m_Shared = shared;

View File

@ -18,7 +18,7 @@ namespace EmberCLns
class EMBERCL_API RendererClDevice : public EmberReport
{
public:
RendererClDevice(bool doublePrec, size_t platform, size_t device, bool shared);
RendererClDevice(size_t platform, size_t device, bool shared);
bool Init();
bool Ok() const;
bool Shared() const;

View File

@ -115,7 +115,7 @@ static bool InitPaletteList(const string& filename)
static vector<string> paths =
{
"./",
#ifndef WIN32
#ifndef _WIN32
"~/.fractorium",
"~/.config/fractorium",
"/usr/share/fractorium",

View File

@ -1,5 +1,5 @@
#ifdef WIN32
#pragma once
#ifdef _WIN32
#pragma once
#endif
/// <summary>
@ -11,19 +11,20 @@
#define _USE_MATH_DEFINES
#ifdef _WIN32
#include <SDKDDKVer.h>
#include <windows.h>
#include <winsock.h>//For htons().
#include <BaseTsd.h>
#include <crtdbg.h>
#include <tchar.h>
#define snprintf _snprintf
#pragma warning(disable : 4251; disable : 4661; disable : 4100)
#include <SDKDDKVer.h>
#include <windows.h>
#include <winsock.h>//For htons().
#include <BaseTsd.h>
#include <crtdbg.h>
#include <tchar.h>
#define snprintf _snprintf
#else
#include <arpa/inet.h>
#define _TCHAR char
#define _tmain main
#define _T
#define fprintf_s fprintf
#include <arpa/inet.h>
#define _TCHAR char
#define _tmain main
#define _T
#define fprintf_s fprintf
#endif
#include <iostream>

View File

@ -22,7 +22,6 @@ static bool WritePpm(const char* filename, byte* image, size_t width, size_t hei
{
fprintf_s(file, "P6\n");
fprintf_s(file, "%lu %lu\n255\n", width, height);
b = (size == fwrite(image, 1, size, file));
fclose(file);
}
@ -57,14 +56,12 @@ static bool WriteJpeg(const char* filename, byte* image, size_t width, size_t he
char nickString[64], urlString[128], idString[128];
char bvString[64], niString[64], rtString[64];
char genomeString[65536], verString[64];
//Create the mandatory comment strings.
snprintf_s(genomeString, 65536, "flam3_genome: %s", comments.m_Genome.c_str());
snprintf_s(bvString, 64, "flam3_error_rate: %s", comments.m_Badvals.c_str());
snprintf_s(niString, 64, "flam3_samples: %s", comments.m_NumIters.c_str());
snprintf_s(rtString, 64, "flam3_time: %s", comments.m_Runtime.c_str());
snprintf_s(verString, 64, "flam3_version: %s", EmberVersion());
info.err = jpeg_std_error(&jerr);
jpeg_create_compress(&info);
jpeg_stdio_dest(&info, file);
@ -73,15 +70,16 @@ static bool WriteJpeg(const char* filename, byte* image, size_t width, size_t he
info.image_width = JDIMENSION(width);
info.image_height = JDIMENSION(height);
jpeg_set_defaults(&info);
#ifdef _WIN32
jpeg_set_quality(&info, quality, static_cast<boolean>(TRUE));
jpeg_start_compress(&info, static_cast<boolean>(TRUE));
//Win32:TRUE is defined in MSVC2013\Windows Kits\8.1\Include\shared\minwindef.h:"#define TRUE 1"
//cast from int to boolean in External/libjpeg/jmorecfg.h:"typedef enum { FALSE = 0, TRUE =1 } boolean;"
#else
jpeg_set_quality(&info, quality, TRUE);
jpeg_start_compress(&info, TRUE);
#endif
#ifdef _WIN32
jpeg_set_quality(&info, quality, static_cast<boolean>(TRUE));
jpeg_start_compress(&info, static_cast<boolean>(TRUE));
//Win32:TRUE is defined in MSVC2013\Windows Kits\8.1\Include\shared\minwindef.h:"#define TRUE 1"
//cast from int to boolean in External/libjpeg/jmorecfg.h:"typedef enum { FALSE = 0, TRUE =1 } boolean;"
#else
jpeg_set_quality(&info, quality, TRUE);
jpeg_start_compress(&info, TRUE);
#endif
//Write comments to jpeg.
if (enableComments)
{
@ -154,35 +152,27 @@ static bool WritePng(const char* filename, byte* image, size_t width, size_t hei
size_t i;
glm::uint16 testbe = 1;
vector<byte*> rows(height);
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
text[0].key = const_cast<png_charp>("flam3_version");
text[0].text = const_cast<png_charp>(EmberVersion());
text[1].compression = PNG_TEXT_COMPRESSION_NONE;
text[1].key = const_cast<png_charp>("flam3_nickname");
text[1].text = const_cast<png_charp>(nick.c_str());
text[2].compression = PNG_TEXT_COMPRESSION_NONE;
text[2].key = const_cast<png_charp>("flam3_url");
text[2].text = const_cast<png_charp>(url.c_str());
text[3].compression = PNG_TEXT_COMPRESSION_NONE;
text[3].key = const_cast<png_charp>("flam3_id");
text[3].text = const_cast<png_charp>(id.c_str());
text[4].compression = PNG_TEXT_COMPRESSION_NONE;
text[4].key = const_cast<png_charp>("flam3_error_rate");
text[4].text = const_cast<png_charp>(comments.m_Badvals.c_str());
text[5].compression = PNG_TEXT_COMPRESSION_NONE;
text[5].key = const_cast<png_charp>("flam3_samples");
text[5].text = const_cast<png_charp>(comments.m_NumIters.c_str());
text[6].compression = PNG_TEXT_COMPRESSION_NONE;
text[6].key = const_cast<png_charp>("flam3_time");
text[6].text = const_cast<png_charp>(comments.m_Runtime.c_str());
text[7].compression = PNG_TEXT_COMPRESSION_zTXt;
text[7].key = const_cast<png_charp>("flam3_genome");
text[7].text = const_cast<png_charp>(comments.m_Genome.c_str());
@ -202,12 +192,11 @@ static bool WritePng(const char* filename, byte* image, size_t width, size_t hei
}
png_init_io(png_ptr, file);
png_set_IHDR(png_ptr, info_ptr, png_uint_32(width), png_uint_32(height), 8 * png_uint_32(bytesPerChannel),
PNG_COLOR_TYPE_RGBA,
PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_BASE,
PNG_FILTER_TYPE_BASE);
PNG_COLOR_TYPE_RGBA,
PNG_INTERLACE_NONE,
PNG_COMPRESSION_TYPE_BASE,
PNG_FILTER_TYPE_BASE);
if (enableComments == 1)
png_set_text(png_ptr, info_ptr, text, PNG_COMMENT_MAX);
@ -245,18 +234,17 @@ static byte* ConvertRGBToBMPBuffer(byte* buffer, size_t width, size_t height, si
size_t padding = 0;
size_t scanlinebytes = width * 3;
while ((scanlinebytes + padding ) % 4 != 0)
padding++;
size_t psw = scanlinebytes + padding;
newSize = height * psw;
byte* newBuf = new byte[newSize];
if (newBuf)
{
memset (newBuf, 0, newSize);
size_t bufpos = 0;
size_t newpos = 0;
@ -266,10 +254,9 @@ static byte* ConvertRGBToBMPBuffer(byte* buffer, size_t width, size_t height, si
{
bufpos = y * 3 * width + x; // position in original buffer
newpos = (height - y - 1) * psw + x; // position in padded buffer
newBuf[newpos] = buffer[bufpos+2]; // swap r and b
newBuf[newpos] = buffer[bufpos + 2]; // swap r and b
newBuf[newpos + 1] = buffer[bufpos + 1]; // g stays
newBuf[newpos + 2] = buffer[bufpos]; // swap b and r
//No swap.
//newBuf[newpos] = buffer[bufpos];
//newBuf[newpos + 1] = buffer[bufpos + 1];
@ -294,20 +281,18 @@ static byte* ConvertRGBToBMPBuffer(byte* buffer, size_t width, size_t height, si
/// <returns>True if success, else false</returns>
static bool SaveBmp(const char* filename, byte* image, size_t width, size_t height, size_t paddedSize)
{
#ifdef WIN32
#ifdef _WIN32
BITMAPFILEHEADER bmfh;
BITMAPINFOHEADER info;
DWORD bwritten;
HANDLE file;
memset (&bmfh, 0, sizeof (BITMAPFILEHEADER));
memset (&info, 0, sizeof (BITMAPINFOHEADER));
bmfh.bfType = 0x4d42; // 0x4d42 = 'BM'
bmfh.bfReserved1 = 0;
bmfh.bfReserved2 = 0;
bmfh.bfSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (DWORD)paddedSize;
bmfh.bfOffBits = 0x36;
info.biSize = sizeof(BITMAPINFOHEADER);
info.biWidth = (LONG)width;
info.biHeight = (LONG)height;

View File

@ -816,7 +816,7 @@ int _tmain(int argc, _TCHAR* argv[])
EmberOptions opt;
//Required for large allocs, else GPU memory usage will be severely limited to small sizes.
//This must be done in the application and not in the EmberCL DLL.
#ifdef WIN32
#ifdef _WIN32
_putenv_s("GPU_MAX_ALLOC_PERCENT", "100");
#else
putenv(const_cast<char*>("GPU_MAX_ALLOC_PERCENT=100"));

View File

@ -1,98 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include <windows.h>
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "..\\Fractorium\\Icons\\\\Fractorium.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,9,9,4
PRODUCTVERSION 0,9,9,4
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x0L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Open Source"
VALUE "FileDescription", "Manipulates fractal flames parameter files"
VALUE "FileVersion", "0.9.9.4"
VALUE "InternalName", "EmberGenome.exe"
VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2015, GPL v3"
VALUE "OriginalFilename", "EmberGenome.exe"
VALUE "ProductName", "Ember Genome"
VALUE "ProductVersion", "0.9.9.4"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -345,7 +345,7 @@ int _tmain(int argc, _TCHAR* argv[])
EmberOptions opt;
//Required for large allocs, else GPU memory usage will be severely limited to small sizes.
//This must be done in the application and not in the EmberCL DLL.
#ifdef WIN32
#ifdef _WIN32
_putenv_s("GPU_MAX_ALLOC_PERCENT", "100");
//_putenv_s("GPU_FORCE_64BIT_PTR", "1");
#else

View File

@ -1,98 +0,0 @@
// Microsoft Visual C++ generated resource script.
//
#include <windows.h>
#include "resource.h"
/////////////////////////////////////////////////////////////////////////////
// English (United States) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_ICON1 ICON "..\\Fractorium\\Icons\\\\Fractorium.ico"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE
BEGIN
"\0"
END
3 TEXTINCLUDE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,9,9,4
PRODUCTVERSION 0,9,9,4
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x40004L
FILETYPE 0x0L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Open Source"
VALUE "FileDescription", "Renders fractal flames as single images"
VALUE "FileVersion", "0.9.9.4"
VALUE "InternalName", "EmberRender.exe"
VALUE "LegalCopyright", "Copyright (C) Matt Feemster 2015, GPL v3"
VALUE "OriginalFilename", "EmberRender.exe"
VALUE "ProductName", "Ember Render"
VALUE "ProductVersion", "0.9.9.4"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

View File

@ -106,8 +106,6 @@ public:
/// </summary>
void MakeNamesUnique()
{
int x = 0;
for (size_t i = 0; i < m_Embers.size(); i++)
{
for (size_t j = 0; j < m_Embers.size(); j++)
@ -169,7 +167,6 @@ public:
if (!QFile::exists(filename))
return filename;
int counter = 2;
QString newPath;
QFileInfo original(filename);
QString path = original.absolutePath() + '/';

View File

@ -17,7 +17,6 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(FractoriumSettings* set
int row = 0, spinHeight = 20;
double dmax = numeric_limits<double>::max();
QTableWidget* table = ui.FinalRenderParamsTable;
QTableWidgetItem* item = nullptr;
m_Info = OpenCLInfo::Instance();
m_Fractorium = qobject_cast<Fractorium*>(p);
m_Settings = settings;
@ -532,14 +531,12 @@ void FractoriumFinalRenderDialog::OnStripsChanged(int d)
}
/// <summary>
/// If a single ember is being rendered, show the save file dialog.
/// If a more than one is being rendered, show the save folder dialog.
/// Show the save folder dialog.
/// Called when the ... file button is clicked.
/// </summary>
/// <param name="checked">Ignored</param>
void FractoriumFinalRenderDialog::OnFileButtonClicked(bool checked)
{
bool doAll = ui.FinalRenderDoAllCheckBox->isChecked();
QString s = m_Fractorium->SetupSaveFolderDialog();
if (Exists(s))
@ -684,7 +681,6 @@ void FractoriumFinalRenderDialog::reject()
/// <returns>True if successful, else false.</returns>
bool FractoriumFinalRenderDialog::CreateControllerFromGUI(bool createRenderer)
{
bool ok = true;
int index = Current() - 1;
#ifdef DO_DOUBLE
size_t elementSize = Double() ? sizeof(double) : sizeof(float);
@ -767,4 +763,4 @@ bool FractoriumFinalRenderDialog::SetMemory()
}
return false;
}
}

View File

@ -460,7 +460,6 @@ template <typename T>
bool FinalRenderEmberController<T>::CreateRenderer(eRendererType renderType, const vector<pair<size_t, size_t>>& devices, bool shared)
{
bool ok = true;
bool deviceDiff = false;
//uint channels = m_FinalRenderDialog->Ext().endsWith("png", Qt::CaseInsensitive) ? 4 : 3;
bool renderTypeMismatch = (m_Renderer.get() && (m_Renderer->RendererType() != renderType)) ||
(!m_Renderers.empty() && (m_Renderers[0]->RendererType() != renderType));

View File

@ -17,7 +17,7 @@
Fractorium::Fractorium(QWidget* p)
: QMainWindow(p)
{
int spinHeight = 20, iconSize_ = 9;
int iconSize_ = 9;
size_t i = 0;
string s;
Timing t;

Binary file not shown.

View File

@ -376,7 +376,7 @@ static QString BaseStyle()
"This is needed to deal with the large tabs in the fusion theme which is the default on Linux, and optional on Windows.\n"
"It's not needed for other themes."
"You should keep this at the top of whatever custom style you make to ensure the tabs aren't unusually large.*/\n"
#ifndef WIN32
#ifndef _WIN32
"QTabBar::tab { height: 3ex; }\n\n"
#else
"QTabBar::tab { height: 5ex; }\n\n"

View File

@ -480,7 +480,6 @@ void FractoriumEmberController<T>::CopyAllXml()
{
ostringstream os;
EmberToXml<T> emberToXml;
auto settings = m_Fractorium->m_Settings;
os << "<flames>\n";
for (auto& e : m_EmberFile.m_Embers)
@ -693,7 +692,6 @@ void Fractorium::OnActionResetWorkspace(bool checked)
template <typename T>
void FractoriumEmberController<T>::AddReflectiveSymmetry()
{
auto combo = m_Fractorium->ui.CurrentXformCombo;
Update([&]()
{
m_Ember.AddSymmetry(-1, m_Rand);
@ -711,7 +709,6 @@ void Fractorium::OnActionAddReflectiveSymmetry(bool checked) { m_Controller->Add
template <typename T>
void FractoriumEmberController<T>::AddRotationalSymmetry()
{
auto combo = m_Fractorium->ui.CurrentXformCombo;
Update([&]()
{
m_Ember.AddSymmetry(2, m_Rand);
@ -729,7 +726,6 @@ void Fractorium::OnActionAddRotationalSymmetry(bool checked) { m_Controller->Add
template <typename T>
void FractoriumEmberController<T>::AddBothSymmetry()
{
auto combo = m_Fractorium->ui.CurrentXformCombo;
Update([&]()
{
m_Ember.AddSymmetry(-2, m_Rand);

View File

@ -81,7 +81,6 @@ bool FractoriumEmberController<T>::FillPaletteTable(const string& s)
if (!s.empty())//This occasionally seems to get called with an empty string for reasons unknown.
{
auto paletteTable = m_Fractorium->ui.PaletteListTable;
auto palettePreviewTable = m_Fractorium->ui.PalettePreviewTable;
m_CurrentPaletteFilePath = m_Fractorium->ui.PaletteFilenameCombo->property("path").toString().toStdString() + "/" + s;
if (int paletteSize = int(m_PaletteList.Size(m_CurrentPaletteFilePath)))
@ -139,7 +138,6 @@ void Fractorium::OnPaletteFilenameComboChanged(const QString& text)
template <typename T>
void FractoriumEmberController<T>::ApplyPaletteToEmber()
{
int rot = 0;
uint blur = m_Fractorium->m_PaletteBlurSpin->value();
uint freq = m_Fractorium->m_PaletteFrequencySpin->value();
double sat = double(m_Fractorium->m_PaletteSaturationSpin->value() / 100.0);

View File

@ -1,14 +1,15 @@
#ifndef FRACTORIUM_PCH
#define FRACTORIUM_PCH
#ifndef FRACTORIUM_PCH_H
#define FRACTORIUM_PCH_H//GCC doesn't like #pragma once
#define GL_GLEXT_PROTOTYPES 1
#define XFORM_COLOR_COUNT 14
#undef QT_OPENGL_ES_2//Make absolutely sure OpenGL ES is not used.
#define QT_NO_OPENGL_ES_2
#ifdef _WIN32
#pragma warning(disable : 4251; disable : 4661; disable : 4100)
#endif
#ifndef WIN32
#include <QtWidgets>
//Has to come first on non-Windows platforms due to some weird naming collisions on *nix.
#ifndef _WIN32
#include <QtWidgets>
#endif
#include "Renderer.h"
@ -21,8 +22,8 @@
#include "JpegUtils.h"
#include "EmberCommon.h"
#ifdef WIN32
#include <QtWidgets>
#ifdef _WIN32
#include <QtWidgets>
#endif
#include <deque>
@ -77,12 +78,11 @@
#include "glm/gtc/matrix_transform.hpp"
#include "glm/gtc/type_ptr.hpp"
#ifndef WIN32
#undef Bool
#ifndef _WIN32
#undef Bool
#endif
using namespace std;
using namespace EmberNs;
using namespace EmberCLns;
#endif

View File

@ -651,7 +651,6 @@ bool Fractorium::CreateRendererFromOptions()
/// <returns>True if successful, else false.</returns>
bool Fractorium::CreateControllerFromOptions()
{
bool ok = true;
size_t elementSize =
#ifdef DO_DOUBLE
m_Settings->Double() ? sizeof(double) :
@ -666,6 +665,7 @@ bool Fractorium::CreateControllerFromOptions()
auto con = m_PaletteContrastSpin->value();
auto blur = m_PaletteBlurSpin->value();
auto freq = m_PaletteFrequencySpin->value();
double scale;
#ifdef DO_DOUBLE
Ember<double> ed;
EmberFile<double> efd;
@ -680,6 +680,7 @@ bool Fractorium::CreateControllerFromOptions()
//First check if a controller has already been created, and if so, save its embers and gracefully shut it down.
if (m_Controller.get())
{
scale = m_Controller->LockedScale();
m_Controller->StopPreviewRender();//Must stop any previews first, else changing controllers will crash the program.
m_Controller->CopyTempPalette(tempPalette);//Convert float to double or save double verbatim;
//Replace below with this once LLVM fixes a crash in their compiler with default lambda parameters.//TODO
@ -709,6 +710,7 @@ bool Fractorium::CreateControllerFromOptions()
ed.m_Palette = tempPalette;//Restore base temp palette. Adjustments will be then be applied and stored back in in m_Ember.m_Palette below.
m_Controller->SetEmber(ed);//Convert float to double or set double verbatim. This will assign m_Ember.m_Palette (which was just tempPalette) to m_TempPalette.
m_Controller->SetEmberFile(efd);
m_Controller->LockedScale(scale);
//Setting these and updating the GUI overwrites the work of clearing them done in SetEmber() above.
//It's a corner case, but doesn't seem to matter.
m_PaletteHueSpin->SetValueStealth(hue);

View File

@ -28,7 +28,7 @@ void Fractorium::InitXformsUI()
ui.XformWeightNameTable->setItem(0, 1, new QTableWidgetItem());
connect(ui.XformWeightNameTable, SIGNAL(cellChanged(int, int)), this, SLOT(OnXformNameChanged(int, int)), Qt::QueuedConnection);
ui.CurrentXformCombo->setProperty("soloxform", -1);
#ifndef WIN32
#ifndef _WIN32
//For some reason linux makes these 24x24, even though the designer explicitly says 16x16.
ui.AddXformButton->setIconSize(QSize(16, 16));
ui.DuplicateXformButton->setIconSize(QSize(16, 16));
@ -173,8 +173,6 @@ void FractoriumEmberController<T>::DuplicateXform()
}, eXformUpdate::UPDATE_SELECTED_EXCEPT_FINAL, false);
Update([&]()
{
auto combo = m_Fractorium->ui.CurrentXformCombo;
for (auto& it : vec)
m_Ember.AddXform(it);
@ -213,7 +211,7 @@ void Fractorium::OnClearXformButtonClicked(bool checked) { m_Controller->ClearXf
template <typename T>
void FractoriumEmberController<T>::DeleteXforms()
{
int i = 0, offset = 0, current = 0, checked = 0;
int offset = 0, current = 0, checked = 0;
bool haveFinal = false;
size_t count;
auto combo = m_Fractorium->ui.CurrentXformCombo;
@ -281,7 +279,6 @@ void FractoriumEmberController<T>::AddFinalXform()
Update([&]()
{
Xform<T> final;
auto combo = m_Fractorium->ui.CurrentXformCombo;
final.AddVariation(m_VariationList.GetVariationCopy(eVariationId::VAR_LINEAR));//Just a placeholder so other parts of the code don't see it as being empty.
m_Ember.SetFinalXform(final);
int index = int(m_Ember.TotalXformCount() - 1);//Set index to the last item.

View File

@ -6,7 +6,7 @@
/// </summary>
void Fractorium::InitXformsAffineUI()
{
int row = 0, affinePrec = 6, spinHeight = 20;
int affinePrec = 6, spinHeight = 20;
double affineStep = 0.01, affineMin = std::numeric_limits<double>::lowest(), affineMax = std::numeric_limits<double>::max();
auto table = ui.PreAffineTable;
connect(ui.LockAffineCheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnLockAffineScaleCheckBoxStateChanged(int)), Qt::QueuedConnection);
@ -95,7 +95,7 @@ void Fractorium::InitXformsAffineUI()
connect(ui.ShowPostAffineAllRadio, SIGNAL(toggled(bool)), this, SLOT(OnAffineDrawAllCurrentRadioButtonToggled(bool)), Qt::QueuedConnection);
connect(ui.ShowPostAffineCurrentRadio, SIGNAL(toggled(bool)), this, SLOT(OnAffineDrawAllCurrentRadioButtonToggled(bool)), Qt::QueuedConnection);
connect(ui.PolarAffineCheckBox, SIGNAL(stateChanged(int)), this, SLOT(OnPolarAffineCheckBoxStateChanged(int)), Qt::QueuedConnection);
#ifndef WIN32
#ifndef _WIN32
//For some reason linux makes these 24x24, even though the designer explicitly says 16x16.
//Also, in order to get 4 pixels of spacing between elements in the grid layout, 0 must be specified.
ui.PreFlipHorizontalButton->setIconSize(QSize(16, 16));

View File

@ -201,7 +201,6 @@ void FractoriumEmberController<T>::VariationSpinBoxValueChanged(double d)//Would
auto objSender = m_Fractorium->sender();
auto tree = m_Fractorium->ui.VariationsTree;
auto sender = dynamic_cast<VariationTreeDoubleSpinBox*>(objSender);
auto xform = m_Ember.GetTotalXform(m_Fractorium->ui.CurrentXformCombo->currentIndex());//Will retrieve normal xform or final if needed.
if (sender)
{

View File

@ -59,7 +59,6 @@ void GLWidget::InitGL()
/// </summary>
void GLWidget::DrawQuad()
{
GLint texWidth = 0, texHeight = 0;
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@ -417,9 +416,7 @@ void GLEmberController<T>::MousePress(QMouseEvent* e)
{
v3T mouseFlipped(e->x() * m_GL->devicePixelRatio(), m_Viewport[3] - e->y() * m_GL->devicePixelRatio(), 0);//Must flip y because in OpenGL, 0,0 is bottom left, but in windows, it's top left.
auto ember = m_FractoriumEmberController->CurrentEmber();
auto xforms = ember->TotalXformCount();
auto renderer = m_FractoriumEmberController->Renderer();
size_t i = 0;
//Ensure everything has been initialized.
if (!renderer)

View File

@ -8,28 +8,24 @@
/// <param name="argc">The number of command line arguments passed</param>
/// <param name="argv">The command line arguments passed</param>
/// <returns>0 if successful, else 1.</returns>
int main(int argc, char *argv[])
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
#ifdef TEST_CL
QMessageBox::critical(QApplication::desktop(), "Error", "Fractorium cannot be run in test mode, undefine TEST_CL first.");
return 1;
#endif
#ifdef ISAAC_FLAM3_DEBUG
QMessageBox::critical(QApplication::desktop(), "Error", "Fractorium cannot be run in test mode, undefine ISAAC_FLAM3_DEBUG first.");
return 1;
#endif
//Required for large allocs, else GPU memory usage will be severely limited to small sizes.
//This must be done in the application and not in the EmberCL DLL.
#ifdef WIN32
#ifdef _WIN32
_putenv_s("GPU_MAX_ALLOC_PERCENT", "100");
#else
putenv(const_cast<char*>("GPU_MAX_ALLOC_PERCENT=100"));
#endif
int rv = -1;
try