Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:goupilmtos:2024:games
worminator
fix-math-h.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-math-h.patch of Package worminator
diff -Nur worminator-3.0R2.1/particle_ai.h new/particle_ai.h --- worminator-3.0R2.1/particle_ai.h 2006-02-02 21:33:38.000000000 +0100 +++ new/particle_ai.h 2021-04-16 07:35:53.139813179 +0200 @@ -1,3 +1,5 @@ +#include <math.h> + /*********************\ |** FLYUP SPRITE AI **| \*********************/ @@ -175,12 +177,12 @@ sprites[sprite_number].y_acceleration = (float)((rand() % 20) - 10.00) / 10.00; } else if (sprites[sprite_number].action_state == 5) { - sprites[sprite_number].x_acceleration = fixtof(fsin(itofix(sprites[sprite_number].direction))); + sprites[sprite_number].x_acceleration = fixtof(sin(itofix(sprites[sprite_number].direction))); if (sprites[sprite_number].direction == -1) sprites[sprite_number].direction = 0; else sprites[sprite_number].direction += 8; } else if (sprites[sprite_number].action_state == 6) { - sprites[sprite_number].y_acceleration = fixtof(fsin(itofix(sprites[sprite_number].direction))); + sprites[sprite_number].y_acceleration = fixtof(sin(itofix(sprites[sprite_number].direction))); if (sprites[sprite_number].direction == -1) sprites[sprite_number].direction = 0; else sprites[sprite_number].direction += 8; } diff -Nur worminator-3.0R2.1/projectile_ai.h new/projectile_ai.h --- worminator-3.0R2.1/projectile_ai.h 2006-02-02 21:33:38.000000000 +0100 +++ new/projectile_ai.h 2021-04-16 07:34:50.135248922 +0200 @@ -1,3 +1,5 @@ +#include <math.h> + /**************************\ |** WORMINATOR BULLET AI **| \**************************/ @@ -586,14 +588,14 @@ // The following updates are based on the type of spikestar (red - sine, blue - negative sine, yellow - straight) if (sprites[sprite_number].frame == WORMINATOR_SPIKESTAR_RED_FLY) { // Adjust the spikestar's y velocity to conform to a sine wave path - sprites[sprite_number].y_acceleration = fixtof(fsin(itofix(sprites[sprite_number].rotate_factor))); + sprites[sprite_number].y_acceleration = fixtof(sin(itofix(sprites[sprite_number].rotate_factor))); // Stardust smoke trail if (out_of_player_range(sprite_number) == FALSE) spawn_stardust((sprites[sprite_number].x_position_in_pixels + sprites[sprite_number].width / 2), (sprites[sprite_number].y_position_in_pixels + sprites[sprite_number].height / 2), 0, .05, 77, 66, 2, 1); } else if (sprites[sprite_number].frame == WORMINATOR_SPIKESTAR_BLUE_FLY) { // Adjust the spikestar's y velocity to conform to an inverse sine wave path - sprites[sprite_number].y_acceleration = -fixtof(fsin(itofix(sprites[sprite_number].rotate_factor))); + sprites[sprite_number].y_acceleration = -fixtof(sin(itofix(sprites[sprite_number].rotate_factor))); // Stardust smoke trail if (out_of_player_range(sprite_number) == FALSE) spawn_stardust((sprites[sprite_number].x_position_in_pixels + sprites[sprite_number].width / 2), (sprites[sprite_number].y_position_in_pixels + sprites[sprite_number].height / 2), 0, -.05, 157, 146, 2, 1); diff -Nur worminator-3.0R2.1/Worminator.c new/Worminator.c --- worminator-3.0R2.1/Worminator.c 2006-03-03 10:29:44.000000000 +0100 +++ new/Worminator.c 2021-04-16 07:35:18.531503234 +0200 @@ -2053,7 +2053,7 @@ sx = ((int)(screen_width * .8) / 2) + 32; if (x2 - (player.x_position_in_pixels + 37) < ((int)(screen_width * .8) / 2) + 32) sx = x2 - (player.x_position_in_pixels + 37); for (y = 0; y < sx; y++) { - x1 = fixtof(fsin(itofix(y * 12))) * 4; + x1 = fixtof(sin(itofix(y * 12))) * 4; if (rand() % 64 < 32) spawn_stardust(player.x_position_in_pixels + 37 + y, player.y_position_in_pixels + 13 + x1, 0, 0, 217 + (float)((rand() % 20) - 10.00) / 10.00, 212 + (float)((rand() % 20) - 10.00) / 10.00, 1, 1); else spawn_stardust(player.x_position_in_pixels + 37 + y, player.y_position_in_pixels + 13 + x1, (float)((rand() % 20) - 10.00) / 80.00, (float)((rand() % 20) - 10.00) / 80.00, 217 - 64 + (float)((rand() % 20) - 10.00) / 10.00, 212 - 64 + (float)((rand() % 20) - 10.00) / 10.00, 1, 1); } @@ -2093,7 +2093,7 @@ sx = ((int)(screen_width * .8) / 2) + 32; if (player.x_position_in_pixels - 6 - x2 < ((int)(screen_width * .8) / 2) + 32) sx = player.x_position_in_pixels - 6 - x2; for (y = 0; y < sx; y++) { - x1 = fixtof(fsin(itofix(y * 12))) * 4; + x1 = fixtof(sin(itofix(y * 12))) * 4; if (rand() % 64 < 32) spawn_stardust(player.x_position_in_pixels - 6 - y, player.y_position_in_pixels + 13 + x1, (float)((rand() % 20) - 10.00) / 80.00, (float)((rand() % 20) - 10.00) / 80.00, 217 + (float)((rand() % 20) - 10.00) / 10.00, 212 + (float)((rand() % 20) - 10.00) / 10.00, 1, 1); else spawn_stardust(player.x_position_in_pixels - 6 - y, player.y_position_in_pixels + 13 + x1, 0, 0, 217 - 64 + (float)((rand() % 20) - 10.00) / 10.00, 212 - 64 + (float)((rand() % 20) - 10.00) / 10.00, 1, 1); }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor