|
|
|
@ -85,7 +85,11 @@ int long_comparator(const void *a, const void *b, void *non) {
@@ -85,7 +85,11 @@ int long_comparator(const void *a, const void *b, void *non) {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void sort_times(void) { |
|
|
|
|
#ifdef __linux__ |
|
|
|
|
qsort_r(save_times_lst.times, save_times_lst.size, sizeof(long), long_comparator, NULL); |
|
|
|
|
#elif WIN32 |
|
|
|
|
qsort_s(save_times_lst.times, save_times_lst.size, sizeof(long), long_comparator, NULL); |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
long get_best_time(void) { |
|
|
|
@ -1009,6 +1013,7 @@ void add_rope(int mouse_x, int mouse_y) {
@@ -1009,6 +1013,7 @@ void add_rope(int mouse_x, int mouse_y) {
|
|
|
|
|
struct physics_collection s; |
|
|
|
|
bool found = false; |
|
|
|
|
double len = MAX_ROPE_GRAB_LEN; |
|
|
|
|
double t, u; |
|
|
|
|
for (int j = 0; j < (floor.numItems + ceil.numItems - 2); j++) { |
|
|
|
|
if (j >= floor.numItems - 1) { |
|
|
|
|
s = ceil; |
|
|
|
@ -1029,10 +1034,10 @@ void add_rope(int mouse_x, int mouse_y) {
@@ -1029,10 +1034,10 @@ void add_rope(int mouse_x, int mouse_y) {
|
|
|
|
|
double x4 = wall_e.x; |
|
|
|
|
double y4 = wall_e.y; |
|
|
|
|
|
|
|
|
|
double t = ((x1 - x3)*(y3 - y4) - (y1 - y3)*(x3-x4)) |
|
|
|
|
t = ((x1 - x3)*(y3 - y4) - (y1 - y3)*(x3-x4)) |
|
|
|
|
/ ((x1-x2)*(y3-y4) - (y1 - y2)*(x3-x4)); |
|
|
|
|
|
|
|
|
|
double u = ((x1 - x2)*(y1 - y3) - (y1 - y2)*(x1 - x3)) |
|
|
|
|
u = ((x1 - x2)*(y1 - y3) - (y1 - y2)*(x1 - x3)) |
|
|
|
|
/ ((x1 - x2)*(y3 - y4) - (y1 - y2)*(x3 - x4)); |
|
|
|
|
|
|
|
|
|
if (t < 0 || u > 0 || t > 1 || u < -1) { |
|
|
|
|