aboutsummaryrefslogtreecommitdiff
path: root/games/alex4
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2019-02-04 06:48:33 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2019-02-04 06:48:33 +0000
commitb7d53da3c4360c0a5eb7378447ef1ddec97c843d (patch)
tree813965dd94845cf2dd2ffbebb07170c8fe2c045b /games/alex4
parent00347a147fb4ce70930c38c542e60e955a3617ac (diff)
downloadports-b7d53da3c4360c0a5eb7378447ef1ddec97c843d.tar.gz
ports-b7d53da3c4360c0a5eb7378447ef1ddec97c843d.zip
games/alex4: Prepare for Allegro 4.4.3
Allegro 4.4.3 removed aliases for fsin, fcos, etc. They are also available as fixsin, fixcos, etc., so use them instead. PR: 235477
Notes
Notes: svn path=/head/; revision=492100
Diffstat (limited to 'games/alex4')
-rw-r--r--games/alex4/files/patch-main.c25
-rw-r--r--games/alex4/files/patch-shooter.c37
2 files changed, 59 insertions, 3 deletions
diff --git a/games/alex4/files/patch-main.c b/games/alex4/files/patch-main.c
index 3c19befb5ea7..e96b05258832 100644
--- a/games/alex4/files/patch-main.c
+++ b/games/alex4/files/patch-main.c
@@ -1,4 +1,4 @@
---- main.c.orig 2016-06-14 16:25:53 UTC
+--- main.c.orig 2019-02-04 06:12:31 UTC
+++ main.c
@@ -38,6 +38,7 @@
#include "main.h"
@@ -221,6 +221,18 @@
if (pf) {
save_hisc_table(hisc_table, pf);
save_hisc_table(hisc_table_space, pf);
+@@ -1158,9 +1212,9 @@ void draw_custom_ending(BITMAP *bmp) {
+
+ blit(data[INTRO_BG].dat, bmp, 0, 0, 0, 0, 160, 120);
+
+- r = 70 + fixtoi(20 * fcos(itofix(game_count >> 1)) + 20 * fsin(itofix((int)(game_count / 2.7))) );
++ r = 70 + fixtoi(20 * fixcos(itofix(game_count >> 1)) + 20 * fixsin(itofix((int)(game_count / 2.7))) );
+ for(i = 0; i < 256; i += 32)
+- draw_sprite(bmp, head, 80 - head->w/2 + fixtoi(r * fcos(itofix(game_count + i))), 60 - head->h/2 + fixtoi(r * fsin(itofix(game_count + i))));
++ draw_sprite(bmp, head, 80 - head->w/2 + fixtoi(r * fixcos(itofix(game_count + i))), 60 - head->h/2 + fixtoi(r * fixsin(itofix(game_count + i))));
+
+ draw_sprite_h_flip(bmp, data[ALEX].dat, 60, 40);
+ draw_sprite(bmp, data[LOLA].dat, 84, 40);
@@ -1289,7 +1343,7 @@ void show_cutscene(int level) {
// poll music machine
if (got_sound) al_poll_duh(dp);
@@ -230,7 +242,7 @@
mode = 2;
}
-@@ -1343,7 +1397,7 @@ void show_scores(int space, Thisc *table
+@@ -1343,7 +1397,7 @@ void show_scores(int space, Thisc *table) {
if (space) {
// get space bg
packfile_password(init_string);
@@ -248,6 +260,15 @@
if (p->actor->status == AC_BALL) {
camera_type = 2;
+@@ -2485,7 +2539,7 @@ void draw_title(BITMAP *bmp, int tick) {
+ textout(bmp, data[THE_FONT].dat, "QUIT", x+1, y+1, 1);
+ textout(bmp, data[THE_FONT].dat, "QUIT", x, y, 4);
+
+- draw_sprite(bmp, data[POINTER].dat, x - 25 + fixtoi(3 * fcos(itofix(tick << 2))), 44 + menu_choice * step);
++ draw_sprite(bmp, data[POINTER].dat, x - 25 + fixtoi(3 * fixcos(itofix(tick << 2))), 44 + menu_choice * step);
+ }
+
+
@@ -2841,6 +2895,10 @@ int do_main_menu() {
}
else {
diff --git a/games/alex4/files/patch-shooter.c b/games/alex4/files/patch-shooter.c
index d2ab8de98528..f37d25dfb3b7 100644
--- a/games/alex4/files/patch-shooter.c
+++ b/games/alex4/files/patch-shooter.c
@@ -1,5 +1,40 @@
---- shooter.c.orig 2016-06-14 16:25:53 UTC
+--- shooter.c.orig 2019-02-04 06:12:31 UTC
+++ shooter.c
+@@ -500,12 +500,12 @@ void s_update_object(Tspace_object *o) {
+ break;
+ case SM_SIN_WAVE:
+ o->x += o->vx;
+- o->y = o->d2 + fixtoi(fmul(ftofix(o->vy), fsin(itofix(o->t))));
++ o->y = o->d2 + fixtoi(fixmul(ftofix(o->vy), fixsin(itofix(o->t))));
+ o->t += o->d1;
+ break;
+ case SM_COS_WAVE:
+ o->x += o->vx;
+- o->y = o->d2 + fixtoi(fmul(ftofix(o->vy), fcos(itofix(o->t))));
++ o->y = o->d2 + fixtoi(fixmul(ftofix(o->vy), fixcos(itofix(o->t))));
+ o->t += o->d1;
+ break;
+ case SM_BOSS_1:
+@@ -516,8 +516,8 @@ void s_update_object(Tspace_object *o) {
+ o->tx = o->x;
+ }
+ else {
+- o->y = o->ty + fixtoi(fmul(ftofix(o->vy), fsin(itofix(o->t))));
+- o->x = o->tx - fixtoi(10 * fsin(itofix(o->t >> 1)));
++ o->y = o->ty + fixtoi(fixmul(ftofix(o->vy), fixsin(itofix(o->t))));
++ o->x = o->tx - fixtoi(10 * fixsin(itofix(o->t >> 1)));
+ o->t ++;
+ }
+ break;
+@@ -573,7 +573,7 @@ void s_update_object(Tspace_object *o) {
+ else if (o->image == ENEMY15) {
+ int i;
+ for(i = 0; i < 256; i += 32)
+- s_make_enemy_bullet((int)o->x + o->bw / 2, (int)o->y + o->bh, fixtof(1 * fcos(itofix(i - 6))), fixtof(1 * fsin(itofix(i - 6))));
++ s_make_enemy_bullet((int)o->x + o->bw / 2, (int)o->y + o->bh, fixtof(1 * fixcos(itofix(i - 6))), fixtof(1 * fixsin(itofix(i - 6))));
+ o->fire_counter = 200 + rand()%50;
+ }
+
@@ -1372,7 +1372,7 @@ int s_init_shooter() {
// load data
log2file(" loading shooter data");