Skip to content

Commit d60223c

Browse files
make cube have black outline like it did before move animatinos were added
1 parent 148d5a3 commit d60223c

File tree

4 files changed

+53
-2
lines changed

4 files changed

+53
-2
lines changed

floppysolver

0 Bytes
Binary file not shown.

src/floppy.c

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,35 @@ FloppyCube DrawFloppyCube(FloppyCube floppyCube){
4242
bRotating = 0;
4343
}
4444
}
45-
Vector2 planeSize = {1.9, 1.9};
45+
Vector2 planeSize = {1.85, 1.85};
4646

4747
float planeOffset = 0.005;
4848

4949
// Black centre area
50-
// DrawCube((Vector3){0.0,0.0,0.0}, 6.0, 2.0, 6.0, BLACK);
50+
for(int i = 0; i < 9; i++){
51+
Vector3 pos = {0.0, 0.0, 0.0};
52+
53+
pos.x = (i % 3 - 1) * 2.0;
54+
pos.z = floor(i / 3.0) * 2.0 - 2.0;
55+
56+
if(fRotating && pos.z == 2){
57+
continue;
58+
}
59+
60+
if(rRotating && pos.x == 2){
61+
continue;
62+
}
63+
64+
if(lRotating && pos.x == -2){
65+
continue;
66+
}
67+
68+
if(bRotating && pos.z == -2){
69+
continue;
70+
}
71+
72+
DrawCube(pos, 2.0, 2.0, 2.0, BLACK);
73+
}
5174

5275
// White and yellow stickers
5376
DrawPlane((Vector3){0.0,planeOffset+1.0,0.0}, planeSize, WHITE);
@@ -120,6 +143,13 @@ FloppyCube DrawFloppyCube(FloppyCube floppyCube){
120143
rlRotatef(progress, 1, 0, 0);
121144
}
122145
DrawPlane((Vector3){-2,3+planeOffset,0}, planeSize, GetColorFromIndex(floppyCube.frontFace[0]));
146+
147+
if(fRotating){
148+
DrawCube((Vector3){2, 2, 0}, 2.0, 2.0, 2.0, BLACK);
149+
DrawCube((Vector3){0, 2, 0}, 2.0, 2.0, 2.0, BLACK);
150+
DrawCube((Vector3){-2, 2, 0}, 2.0, 2.0, 2.0, BLACK);
151+
}
152+
123153
if(lRotating){
124154
rlRotatef(progress, -1, 0, 0);
125155
}
@@ -140,6 +170,13 @@ FloppyCube DrawFloppyCube(FloppyCube floppyCube){
140170
rlRotatef(progress, 0, 0, 1);
141171
}
142172
DrawPlane((Vector3){0,3+planeOffset,2}, planeSize, GetColorFromIndex(floppyCube.rightFace[0]));
173+
174+
if(rRotating){
175+
DrawCube((Vector3){0, 2, 2}, 2.0, 2.0, 2.0, BLACK);
176+
DrawCube((Vector3){0, 2, 0}, 2.0, 2.0, 2.0, BLACK);
177+
DrawCube((Vector3){0, 2, -2}, 2.0, 2.0, 2.0, BLACK);
178+
}
179+
143180
if(fRotating){
144181
rlRotatef(progress, 0, 0, -1);
145182
}
@@ -160,6 +197,13 @@ FloppyCube DrawFloppyCube(FloppyCube floppyCube){
160197
rlRotatef(progress, 0, 0, 1);
161198
}
162199
DrawPlane((Vector3){0,3+planeOffset,-2}, planeSize, GetColorFromIndex(floppyCube.leftFace[0]));
200+
201+
if(lRotating){
202+
DrawCube((Vector3){0, 2, 2}, 2.0, 2.0, 2.0, BLACK);
203+
DrawCube((Vector3){0, 2, 0}, 2.0, 2.0, 2.0, BLACK);
204+
DrawCube((Vector3){0, 2, -2}, 2.0, 2.0, 2.0, BLACK);
205+
}
206+
163207
if(bRotating){
164208
rlRotatef(progress, 0, 0, -1);
165209
}
@@ -180,6 +224,13 @@ FloppyCube DrawFloppyCube(FloppyCube floppyCube){
180224
rlRotatef(progress, 1, 0, 0);
181225
}
182226
DrawPlane((Vector3){2,3+planeOffset,0}, planeSize, GetColorFromIndex(floppyCube.backFace[0]));
227+
228+
if(bRotating){
229+
DrawCube((Vector3){2, 2, 0}, 2.0, 2.0, 2.0, BLACK);
230+
DrawCube((Vector3){-2, 2, 0}, 2.0, 2.0, 2.0, BLACK);
231+
DrawCube((Vector3){0, 2, 0}, 2.0, 2.0, 2.0, BLACK);
232+
}
233+
183234
if(rRotating){
184235
rlRotatef(progress, -1, 0, 0);
185236
}

src/moves.c

Whitespace-only changes.

src/moves.h

Whitespace-only changes.

0 commit comments

Comments
 (0)