Skip to content

Commit

Permalink
Rename NUM_IFS_PARAMS to NUM_IFS_2D_PARAMS
Browse files Browse the repository at this point in the history
  • Loading branch information
LegalizeAdulthood committed Feb 9, 2025
1 parent cafcaec commit 4fad6e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion libid/fractals/ifs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int ifs_load() // read in IFS parameters
}

string_lower(buf);
int const row_size = std::strstr(buf, "(3d)") != nullptr ? NUM_IFS_3D_PARAMS : NUM_IFS_PARAMS;
int const row_size = std::strstr(buf, "(3d)") != nullptr ? NUM_IFS_3D_PARAMS : NUM_IFS_2D_PARAMS;
g_ifs_type = row_size == NUM_IFS_3D_PARAMS;

int ret = 0;
Expand Down
10 changes: 5 additions & 5 deletions libid/fractals/lorenz.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ static int ifs2d()
int color_method = (int) g_params[0];
try
{
local_ifs.resize(g_num_affine_transforms*NUM_IFS_PARAMS);
local_ifs.resize(g_num_affine_transforms*NUM_IFS_2D_PARAMS);
}
catch (const std::bad_alloc &)
{
Expand All @@ -1836,9 +1836,9 @@ static int ifs2d()

for (int i = 0; i < g_num_affine_transforms; i++) // fill in the local IFS array
{
for (int j = 0; j < NUM_IFS_PARAMS; j++)
for (int j = 0; j < NUM_IFS_2D_PARAMS; j++)
{
local_ifs[i*NUM_IFS_PARAMS+j] = (long)(g_ifs_definition[i*NUM_IFS_PARAMS+j] * g_fudge_factor);
local_ifs[i*NUM_IFS_2D_PARAMS+j] = (long)(g_ifs_definition[i*NUM_IFS_2D_PARAMS+j] * g_fudge_factor);
}
}

Expand Down Expand Up @@ -1873,10 +1873,10 @@ static int ifs2d()
int k = 0;
while (sum < r && k < g_num_affine_transforms-1) // fixed bug of error if sum < 1
{
sum += local_ifs[++k*NUM_IFS_PARAMS+6];
sum += local_ifs[++k*NUM_IFS_2D_PARAMS+6];
}
// calculate image of last point under selected iterated function
long *l_f_ptr = local_ifs.data() + k * NUM_IFS_PARAMS; // point to first parm in row
long *l_f_ptr = local_ifs.data() + k * NUM_IFS_2D_PARAMS; // point to first parm in row
long new_x = multiply(l_f_ptr[0], x, g_bit_shift) + multiply(l_f_ptr[1], y, g_bit_shift) + l_f_ptr[4];
long new_y = multiply(l_f_ptr[2], x, g_bit_shift) + multiply(l_f_ptr[3], y, g_bit_shift) + l_f_ptr[5];
x = new_x;
Expand Down
2 changes: 1 addition & 1 deletion libid/include/fractals/ifs.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

enum
{
NUM_IFS_PARAMS = 7,
NUM_IFS_2D_PARAMS = 7,
NUM_IFS_3D_PARAMS = 13
};

Expand Down

0 comments on commit 4fad6e1

Please sign in to comment.