Skip to content

Commit

Permalink
Remove trailing spaces/whitespace again and New release v1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
genbtc committed Oct 22, 2023
1 parent 2101d82 commit 82c4ed0
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake_minimum_required(VERSION 3.8)
# Works on VCPKG using CMake in Visual Studio 2017 natively, with: "vcpkg install freeglut:x64-windows" ; "vcpkg integrate install"
# Confirmed to work on Linux 2023
set(PACKAGE_NAME "Megaminx")
set(PACKAGE_VERSION "1.4.1")
set(PACKAGE_VERSION "1.4.2")
project(${PACKAGE_NAME})
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_TARNAME ${PACKAGE_NAME})
Expand Down
10 changes: 5 additions & 5 deletions src/Res.rc
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
GLUT_ICON ICON "MAINICON.ico"
// Executable version information.
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,4,0,0
PRODUCTVERSION 1,4,0,0
FILEVERSION 1,4,2,0
PRODUCTVERSION 1,4,2,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904b0"
BEGIN
VALUE "CompanyName", "genBTC"
VALUE "FileDescription", "Megaminx v1.4.0 - genBTC mod"
VALUE "FileVersion", "1.4.0.0"
VALUE "FileDescription", "Megaminx v1.4.2 - genBTC mod"
VALUE "FileVersion", "1.4.2.0"
VALUE "InternalName", "Megaminx"
VALUE "LegalCopyright", "©2023 genBTC, based on TarasKhalymon"
VALUE "OriginalFilename", "Megaminx.exe"
VALUE "ProductName", "Megaminx"
VALUE "ProductVersion", "1.4.0.0"
VALUE "ProductVersion", "1.4.2.0"
END
END
END
2 changes: 1 addition & 1 deletion src/engine/corner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void Corner::render() const
glBegin(GL_LINE_LOOP);
glVertex3d(_vertex[2][0] * 1.005, _vertex[2][1] * 1.005, _vertex[2][2] * 1.005);
glVertex3d(_vertex[5][0] * 1.005, _vertex[5][1] * 1.005, _vertex[5][2] * 1.005);
glEnd();
glEnd();

//Piece Numbering Test:
std::string c = std::to_string(data.pieceNum);
Expand Down
2 changes: 1 addition & 1 deletion src/engine/edge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void Edge::render() const
glVertex3dv(_vertex[i]);
}
glEnd();

if (data.hotPieceMoving)
glColor3d(.4, 1, 0);
else
Expand Down
2 changes: 1 addition & 1 deletion src/engine/face.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ constexpr AlgoString g_AlgoStrings[MAXIMUM_ALGORITHMS] = {
.modby = { -2, 0, 0, 1, 1 }
},
//#32=#7Last-Layer: Step 2: Edge Permutation 3d- //"LL Edge 3d- CCW Both+Backs=Safe"
//#33= 3e+
//#33= 3e


// #7Last-Layer: Step 2: Edge Position, 5-way star cycle CW+ , Opposite Faces CW
Expand Down
2 changes: 1 addition & 1 deletion src/engine/megaminx.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* MegaMinx v1.4.1 - 2017+2018+2019+2020+2023 - genBTC edition
/* MegaMinx v1.4.2 - 2017+2018+2019+2020+2023 - genBTC edition
* Uses code originally from Taras Khalymon (tkhalymon) / @cybervisiontech / [email protected]
* genBTC November 2017 - [email protected] / @genr8_ / github.com/genbtc/
* genBTC December 2018 - fixups, tweaks.
Expand Down
4 changes: 2 additions & 2 deletions src/engine/piece.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class Piece {
for(int i = i; i<n/2; ++i) {
int temp = arr[i];
arr[i] = arr[n-i-1];
arr[n-i-1] = temp;
arr[n-i-1] = temp;
}
}

Expand Down Expand Up @@ -231,7 +231,7 @@ class Piece {
}
return &_vertex[0][0];
}

//Creates the common starting vertexes for all pieces that are FACES
double* faceInit() {
numSides = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/engine/shadow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ void Megaminx::updateRotateQueueWithShadow(Megaminx* shadowDom)
auto& op = shadowDom->shadowRotateQueue.front();
rotateQueue.push(op);
undoStack.push(op);
shadowDom->shadowRotateQueue.pop();
shadowDom->shadowRotateQueue.pop();
}
undoStack.push({ 999, 999 });
}

//Populate the shadowRotateQueue with a whole bulk sequence of numdir vectors
void Megaminx::bulkShadowRotate(std::vector<numdir> bulk) {
for (auto op : bulk) //+1 the 0-11 faces
shadowRotate(op.num + 1, op.dir);
shadowRotate(op.num + 1, op.dir);
}

//Create megaminx array, from pieces read from a file, and put into shadow array.
Expand Down
14 changes: 7 additions & 7 deletions src/engine/solve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class EdgeLayerAssist {
const Piece* currentPiece;
bool currentpieceFlipStatusOK;
int row1, row2, row3, row4, row5, row6, rowLAST;


EdgeLayerAssist(Megaminx* shadowDom, int i) {
sourceEdgeIndex = shadowDom->findEdge(i);
Expand Down Expand Up @@ -382,7 +382,7 @@ void Megaminx::rotateSolveWhiteCorners(Megaminx* shadowDom)
offby -= 5;
int aoffby = i + RED;
MMg(aoffby,YELLOW);
assert(offby == aoffby);
assert(offby == aoffby);
if (offby >= 2) {
if (l.CornerItselfA->data.flipStatus == 2)
bulkAlgo = shadowDom->ParseAlgorithmID(51, offby); // .algo = "f dr F' "
Expand Down Expand Up @@ -1079,7 +1079,7 @@ void Megaminx::rotateSolveLayer7Edges(Megaminx* shadowDom)
else if (solvedCount == 3 && !twoAdjacentOffColors) {
std::cout << "solvedCount3 not accounted for \n"
<< "Bug in rotateSolveLayer7Edges() where solvedCount == 3 && !twoAdjacentOffColors\n";
}
}
else if ((offby == 4 || offby == 3) && solvedCount == 1 && !allEdgeColorsSolved && twoGraysUnsolved(3, 4)) //TT-84-2 + //TT-85-2
{
bulkAlgo = shadowDom->ParseAlgorithmString(g_AlgoStrings[14].algo, g_faceNeighbors[LIGHT_BLUE + firstOffColorPiece], 14); //algo #14 3a- (F/L Safe)
Expand Down Expand Up @@ -1188,7 +1188,7 @@ void Megaminx::rotateSolveLayer7Edges(Megaminx* shadowDom)
else if (offby == 3 && solvedCount == 1 && allCornersAllSolved && twoGraysUnsolved(2, 3)) //TT80-2
{
bulkAlgo = shadowDom->ParseAlgorithmString(g_AlgoStrings[33].algo, g_faceNeighbors[LIGHT_GREEN], 33); //3e+ #33 same. (F/L safe tho)
}
}
else if (offby == 4 && solvedCount == 0 && allCornersAllSolved && twoGraysUnsolved(3,4)) //TT47-2
{
bulkAlgo = shadowDom->ParseAlgorithmString(g_AlgoStrings[33].algo, g_faceNeighbors[PINK], 33); //3e+ #33 same. (F/L safe tho)
Expand All @@ -1197,7 +1197,7 @@ void Megaminx::rotateSolveLayer7Edges(Megaminx* shadowDom)
{
bulkAlgo = shadowDom->ParseAlgorithmString(g_AlgoStrings[33].algo, g_faceNeighbors[LIGHT_BLUE + offby + 2], 33); //3e+ #33 same. (F/L safe tho)
}

else if (solvedCount == 0 && allEdgeColorsSolved && allCornersAllSolved&& checkPieceMatches(pieceOrder, 28, 29, 26, 27, 25)) //TT75-2
{ //(needs another mushroom- after this one to solve it)
bulkAlgo = shadowDom->ParseAlgorithmString(g_AlgoStrings[33].algo, g_faceNeighbors[LIGHT_BLUE], 33); //3e+ #33 same. (F/L safe tho)
Expand Down Expand Up @@ -1389,7 +1389,7 @@ void Megaminx::rotateSolve7thLayerCorners(Megaminx* shadowDom)
(twoSolvedPieces(0, 1)) || (twoSolvedPieces(1, 2)) || (twoSolvedPieces(2, 3)) || (twoSolvedPieces(3, 4)) || (twoSolvedPieces(4, 0));
bool twoOppositePieces =
(twoSolvedPieces(0, 2)) || (twoSolvedPieces(1, 3)) || (twoSolvedPieces(2, 4)) || (twoSolvedPieces(3, 0)) || (twoSolvedPieces(4, 1));

//Not Needed. L7-Edges is mandatorily run as a pre-requisite.
// firstly rotate solved Edge 0 (e#25) gray top back to default, by checking the first EDGE and setting that rotation.
int findIfFirstEdgeDefault = shadowDom->findEdge(25); //always piece first
Expand Down Expand Up @@ -1951,7 +1951,7 @@ void Megaminx::testingAlgostrings(Megaminx* shadowDom)
if (foundEdges[k] == 28)
modby[3]=newDifference[k];
if (foundEdges[k] == 29)
modby[4]=newDifference[k];
modby[4]=newDifference[k];
}
// std::cout << " = foundEdges: # " << algo << std::endl;
for (int k = 0; k < 5; ++k) {
Expand Down
20 changes: 10 additions & 10 deletions src/main-menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void myglutOnKeyboard(unsigned char key, int x, int y) {
break;
default:
break;

}
}
//Game commands
Expand Down Expand Up @@ -128,7 +128,7 @@ void myglutOnSpecialKeyPress(int key, int x, int y) {
break;
// THESE FUNC KEYS HAVE TO BE HANDLED IN HERE (even though this file is not for cubing)
case GLUT_KEY_F1:
// menuHandler(300); //Rotate_white_edges
// menuHandler(300); //Rotate_white_edges
// menuHandler(301); //Rotate_white_corners
// manually call these (the double clone cube call was messing up)
MakeShadowCubeClone(); // init
Expand Down Expand Up @@ -237,7 +237,7 @@ void createMenu()
glutAddMenuEntry("20. 7LL-Edge 2+2swap BUNNY Opp. 2&4,3&5 + INVERT 8'/1'", 70);
glutAddMenuEntry("37. 7LL-Edge 2+2swap BUNNY BEST 2&5,3&4", 87);
glutAddMenuEntry("19. 7LL-Edge 2+2swap BUNNY Adj. 2&3,4&5", 69);
glutAddMenuEntry("29. 7LL-Edge 2+2swap BUNNY Colors ONLY 2,3,4,5", 79);
glutAddMenuEntry("29. 7LL-Edge 2+2swap BUNNY Colors ONLY 2,3,4,5", 79);
glutAddMenuEntry("38. 7LL-Edge 5-way CCW cycle by +2 all", 88);
glutAddMenuEntry("17. 7LL-Edge 5-way CW cycle by -2 all", 67);
//glutAddMenuEntry("18. 7LL-Edge 5-way CCW cycle by 1,2,-1,2,1", 68);
Expand Down Expand Up @@ -267,7 +267,7 @@ void createMenu()
glutAddMenuEntry("2nd Layer, 1 Edge (Left drop)", 71);
glutAddMenuEntry("2nd Layer, 1 Edge (Right drop)",72);
glutAddMenuEntry("4th Layer, 1 Edge (Left drop)", 73);
glutAddMenuEntry("4th Layer, 1 Edge (Right drop)",74);
glutAddMenuEntry("4th Layer, 1 Edge (Right drop)",74);
glutAddMenuEntry("4th Layer, 1 Edge (Left+Flip)", 84);
glutAddMenuEntry("4th Layer, 1 Edge (Right+Flip)",85);
glutAddMenuEntry("6th Layer, 1 Edge (Left drop)", 75);
Expand Down Expand Up @@ -344,15 +344,15 @@ void createMenu()
glutAddMenuEntry("Swap Edges 2 & 4", 130); //order
glutAddMenuEntry("Swap Edges 2 & 5", 131);
glutAddMenuEntry("Swap Edges 3 & 4", 132);
glutAddMenuEntry("Swap Edges 3 & 5", 133);
glutAddMenuEntry("Swap Edges 3 & 5", 133);
glutAddMenuEntry("Swap Edges 4 & 5", 134);
glutAddMenuEntry("Swap Corners 1 & 2", 135);
glutAddMenuEntry("Swap Corners 1 & 3", 136);
glutAddMenuEntry("Swap Corners 1 & 4", 137);
glutAddMenuEntry("Swap Corners 1 & 5", 138);
glutAddMenuEntry("Swap Corners 1 & 5", 138);
glutAddMenuEntry("Swap Corners 2 & 3", 139);
glutAddMenuEntry("Swap Corners 2 & 4", 140);
glutAddMenuEntry("Swap Corners 2 & 5", 141);
glutAddMenuEntry("Swap Corners 2 & 5", 141);
glutAddMenuEntry("Swap Corners 3 & 4", 142);
glutAddMenuEntry("Swap Corners 3 & 5", 143);
glutAddMenuEntry("Swap Corners 4 & 5", 144);
Expand Down Expand Up @@ -406,7 +406,7 @@ void menuHandler(int num)
case 99: //Restore Cube State to File
RestoreCubeFromFile();
break;

//menu submenu2_id: Compu.Mod Current Face
case 19:
megaminx->rotate(currentFace, Face::CCW); break;
Expand Down Expand Up @@ -455,7 +455,7 @@ void menuHandler(int num)
// Solve a Face (Reset) any selected face 1-12:
case 171 ... 182:
megaminx->resetFace(1+num-171); break;

//menu SubLevel3: Teleport Reset by Layer
case 40: //1st Layer = WHITE Edges
megaminx->resetFacesEdges(WHITE); break;
Expand Down Expand Up @@ -529,7 +529,7 @@ void menuHandler(int num)
megaminx->rotateSolve5thLayerCorners(shadowDom);
megaminx->rotateSolveLayer6Edges(shadowDom);
megaminx->rotateSolveLayer7Edges(shadowDom);
megaminx->rotateSolve7thLayerCorners(shadowDom);
megaminx->rotateSolve7thLayerCorners(shadowDom);
break;
case 312: //brute force checker for solver = F11
for (int i = 0; i < 50000; ++i) {
Expand Down
9 changes: 5 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
static const char *myglutTitle = "GenBTC's Megaminx Solver v1.4.1";
static const char *myglutTitle = "GenBTC's Megaminx Solver v1.4.2";
///////////////////////////////////////////////////////////////////////////////
/* MegaMinx2 - v1.3 Oct24-Dec12, 2017 - genBTC mod
- v1.3.2 Nov 22, 2018
Expand All @@ -7,7 +7,8 @@ static const char *myglutTitle = "GenBTC's Megaminx Solver v1.4.1";
- v1.3.8 Feb 03, 2023
- v1.3.9 Mar 06, 2023
- v1.4.0-b1 Mar 8, 2023 - CLI Shell (readline)
- v1.4.1 Oct 14, 2023
- v1.4.1 Oct 14, 2023 (bug: ld gc'ed needed symbols)
- v1.4.2 Oct 22, 2023 (clean code)
* Uses some code originally from:
* Taras Khalymon (tkhalymon) / @cybervisiontech / [email protected]
* Modified by:
Expand Down Expand Up @@ -76,7 +77,7 @@ int main(int argc, char *argv[]) {
glutReshapeFunc(myglutChangeWindowSize);
glutMouseFunc(myglutMousePressed);
glutMotionFunc(myglutMousePressedMove);

// Right click menu:
createMenu();
glutMenuStatusFunc(myglutMenuVisible);
Expand Down Expand Up @@ -120,7 +121,7 @@ void myglutRenderScene() {
g_camera.m_angleX, g_camera.m_angleY);
GetCurrentFace();
utDrawText2D(10.f, HEIGHT - 40.f, lastface);

// Print out Text (Help display)
if (g_help)
utPrintHelpMenu(WIDTH - 245.f, HEIGHT - 265.f);
Expand Down
6 changes: 3 additions & 3 deletions src/unused/const_math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ double fraction(double x) {

constexpr
double exp_helper(const double r) {
return 1.0 + r + pow(r,2)/2.0 + pow(r,3)/6.0
pow(r,4)/24.0 + pow(r,5)/120.0
return 1.0 + r + pow(r,2)/2.0 + pow(r,3)/6.0
pow(r,4)/24.0 + pow(r,5)/120.0
pow(r,6)/720.0 + pow(r,7)/5040.0;
}

Expand Down Expand Up @@ -149,7 +149,7 @@ int exponent(const double x) { return exponent_helper(x,0); }

constexpr
double log_helper2(const double y) {
return 2.0 * (y + pow(y,3)/3.0 + pow(y,5)/5.0
return 2.0 * (y + pow(y,3)/3.0 + pow(y,5)/5.0
pow(y,7)/7.0 + pow(y,9)/9.0 + pow(y,11)/11.0);
}

Expand Down

0 comments on commit 82c4ed0

Please sign in to comment.