Skip to content

Commit

Permalink
Merge pull request #41 from ReinhardPrix/bugfix-release-1.2.3
Browse files Browse the repository at this point in the history
Bugfix release 1.2.3
  • Loading branch information
ReinhardPrix authored Jan 8, 2024
2 parents e17ecf7 + af5cfe1 commit 126664e
Show file tree
Hide file tree
Showing 28 changed files with 339 additions and 321 deletions.
4 changes: 2 additions & 2 deletions AndroidAppSettings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ AppName="Freedroid"
AppFullName=net.sourceforge.freedroid

# Application version code (integer)
AppVersionCode=129
AppVersionCode=130

# Application user-visible version name (string)
AppVersionName="1.2.2"
AppVersionName="1.2.3"

# Specify path to download application data in zip archive in the form "Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...'
# If you'll start Description with '!' symbol it will be enabled by default, '!!' will also hide the entry from the menu, so it cannot be disabled
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Process this file with autoconf to produce a configure script.
AC_INIT(freedroid, 1.2.2)
AC_INIT(freedroid, 1.2.3)

dnl Setup for automake
SDL_VERSION=1.2.3
Expand Down
2 changes: 1 addition & 1 deletion map/Paradroid.mission
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Possible Start Point : Level=7 XPos=2 YPos=1

The title picture in the graphics subdirectory for this mission is : title.jpg
The title song in the sound subdirectory for this mission is : Paradroid.ogg
Song name to play in the end title if the mission is completed: android-commando_hiscore.mod
Song name to play in the end title if the mission is completed: android-commando_hiscore.mod.ogg


* New Mission Briefing Text Subsection *
Expand Down
2 changes: 1 addition & 1 deletion sound/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sounddir = $(pkgdatadir)/sound

music = \
AnarchyMenu1.mod \
android-commando_hiscore.mod \
android-commando_hiscore.mod.ogg \
dreamfish-green_beret.mod \
dreamfish-sanxion.mod \
dreamfish-uridium2_loader.mod \
Expand Down
46 changes: 25 additions & 21 deletions src/BFont.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
BFont_Info *CurrentFont;


void InitFont (BFont_Info * Font);

/* utility functions */
Uint32 GetPixel (SDL_Surface * Surface, Sint32 X, Sint32 Y);
void PutPixel (SDL_Surface * surface, int x, int y, Uint32 pixel);
int count (const char *text);


void
Expand Down Expand Up @@ -298,7 +301,7 @@ TextWidthFont (BFont_Info * Font, const char *text)

/* counts the spaces of the strings */
int
count (char *text)
count (const char *text)
{
char *p = NULL;
int pos = -1;
Expand All @@ -313,14 +316,14 @@ count (char *text)
}

void
JustifiedPutString (SDL_Surface * Surface, int y, char *text)
JustifiedPutString (SDL_Surface * Surface, int y, const char *text)
{
JustifiedPutStringFont (Surface, CurrentFont, y, text);
}

void
JustifiedPutStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *text)
const char *text)
{
int spaces = 0;
int gap;
Expand Down Expand Up @@ -377,12 +380,13 @@ JustifiedPutStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
}
}
strtmp = NULL;
size_t len = strlen (&text[pos + 1]) + 1;
strtmp =
(char *) calloc (strlen (&text[pos + 1]) + 1, sizeof (char));
(char *) calloc (len, sizeof (char));

if (strtmp != NULL)
{
strncpy (strtmp, &text[pos + 1], strlen (&text[pos + 1]));
memcpy (strtmp, &text[pos + 1], len);
PutStringFont (Surface, Font, xpos, y, strtmp);
free (strtmp);
}
Expand All @@ -391,50 +395,50 @@ JustifiedPutStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
}

void
CenteredPutString (SDL_Surface * Surface, int y, char *text)
CenteredPutString (SDL_Surface * Surface, int y, const char *text)
{
CenteredPutStringFont (Surface, CurrentFont, y, text);
}

void
CenteredPutStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *text)
const char *text)
{
PutStringFont (Surface, Font,
Surface->w / 2 - TextWidthFont (Font, text) / 2, y, text);
}

void
RightPutString (SDL_Surface * Surface, int y, char *text)
RightPutString (SDL_Surface * Surface, int y, const char *text)
{
RightPutStringFont (Surface, CurrentFont, y, text);
}

void
RightPutStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *text)
const char *text)
{
PutStringFont (Surface, Font, Surface->w - TextWidthFont (Font, text) - 1,
y, text);
}

void
LeftPutString (SDL_Surface * Surface, int y, char *text)
LeftPutString (SDL_Surface * Surface, int y, const char *text)
{
LeftPutStringFont (Surface, CurrentFont, y, text);
}

void
LeftPutStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *text)
const char *text)
{
PutStringFont (Surface, Font, 0, y, text);
}

/******/

void
PrintString (SDL_Surface * Surface, int x, int y, char *fmt, ...)
PrintString (SDL_Surface * Surface, int x, int y, const char *fmt, ...)
{
va_list args;
char *temp;
Expand All @@ -453,7 +457,7 @@ PrintString (SDL_Surface * Surface, int x, int y, char *fmt, ...)

void
PrintStringFont (SDL_Surface * Surface, BFont_Info * Font, int x, int y,
char *fmt, ...)
const char *fmt, ...)
{
va_list args;
char *temp;
Expand All @@ -469,7 +473,7 @@ PrintStringFont (SDL_Surface * Surface, BFont_Info * Font, int x, int y,
}

void
CenteredPrintString (SDL_Surface * Surface, int y, char *fmt, ...)
CenteredPrintString (SDL_Surface * Surface, int y, const char *fmt, ...)
{
va_list args;
char *temp;
Expand All @@ -486,7 +490,7 @@ CenteredPrintString (SDL_Surface * Surface, int y, char *fmt, ...)

void
CenteredPrintStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *fmt, ...)
const char *fmt, ...)
{
va_list args;
char *temp;
Expand All @@ -503,7 +507,7 @@ CenteredPrintStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
}

void
RightPrintString (SDL_Surface * Surface, int y, char *fmt, ...)
RightPrintString (SDL_Surface * Surface, int y, const char *fmt, ...)
{
va_list args;
char *temp;
Expand All @@ -520,7 +524,7 @@ RightPrintString (SDL_Surface * Surface, int y, char *fmt, ...)

void
RightPrintStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *fmt, ...)
const char *fmt, ...)
{
va_list args;
char *temp;
Expand All @@ -536,7 +540,7 @@ RightPrintStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
}

void
LeftPrintString (SDL_Surface * Surface, int y, char *fmt, ...)
LeftPrintString (SDL_Surface * Surface, int y, const char *fmt, ...)
{
va_list args;
char *temp;
Expand All @@ -553,7 +557,7 @@ LeftPrintString (SDL_Surface * Surface, int y, char *fmt, ...)

void
LeftPrintStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *fmt, ...)
const char *fmt, ...)
{
va_list args;
char *temp;
Expand All @@ -569,7 +573,7 @@ LeftPrintStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
}

void
JustifiedPrintString (SDL_Surface * Surface, int y, char *fmt, ...)
JustifiedPrintString (SDL_Surface * Surface, int y, const char *fmt, ...)
{
va_list args;
char *temp;
Expand All @@ -586,7 +590,7 @@ JustifiedPrintString (SDL_Surface * Surface, int y, char *fmt, ...)

void
JustifiedPrintStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *fmt, ...)
const char *fmt, ...)
{
va_list args;
char *temp;
Expand Down
36 changes: 18 additions & 18 deletions src/BFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,55 +59,55 @@ void PutString (SDL_Surface * Surface, int x, int y, const char *text);
void PutStringFont (SDL_Surface * Surface, BFont_Info * Font, int x, int y, const char *text);

/* Write a left-aligned string on the "Surface" with the current font */
void LeftPutString (SDL_Surface * Surface, int y, char *text);
void LeftPutString (SDL_Surface * Surface, int y, const char *text);

/* Write a left-aligned string on the "Surface" with the specified font */
void LeftPutStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *text);
const char *text);

/* Write a center-aligned string on the "Surface" with the current font */
void CenteredPutString (SDL_Surface * Surface, int y, char *text);
void CenteredPutString (SDL_Surface * Surface, int y, const char *text);

/* Write a center-aligned string on the "Surface" with the specified font */
void CenteredPutStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *text);
const char *text);

/* Write a right-aligned string on the "Surface" with the specified font */
void RightPutString (SDL_Surface * Surface, int y, char *text);
void RightPutString (SDL_Surface * Surface, int y, const char *text);

/* Write a right-aligned string on the "Surface" with the specified font */
void RightPutStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *text);
const char *text);

/* Write a justify-aligned string on the "Surface" with the specified font */
void JustifiedPutString (SDL_Surface * Surface, int y, char *text);
void JustifiedPutString (SDL_Surface * Surface, int y, const char *text);

/* Write a justify-aligned string on the "Surface" with the specified font */
void JustifiedPutStringFont (SDL_Surface * Surface, BFont_Info * Font,
int y, char *text);
int y, const char *text);


/* The following functions do the same task but have the classic "printf" sintax */

void PrintString (SDL_Surface * Surface, int x, int y, char *fmt, ...);
void PrintString (SDL_Surface * Surface, int x, int y, const char *fmt, ...);
void PrintStringFont (SDL_Surface * Surface, BFont_Info * Font, int x,
int y, char *fmt, ...);
int y, const char *fmt, ...);

void CenteredPrintString (SDL_Surface * Surface, int y, char *fmt, ...);
void CenteredPrintString (SDL_Surface * Surface, int y, const char *fmt, ...);
void CenteredPrintStringFont (SDL_Surface * Surface, BFont_Info * Font,
int y, char *fmt, ...);
int y, const char *fmt, ...);

void RightPrintString (SDL_Surface * Surface, int y, char *fmt, ...);
void RightPrintString (SDL_Surface * Surface, int y, const char *fmt, ...);
void RightPrintStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *fmt, ...);
const char *fmt, ...);

void LeftPrintString (SDL_Surface * Surface, int y, char *fmt, ...);
void LeftPrintString (SDL_Surface * Surface, int y, const char *fmt, ...);
void LeftPrintStringFont (SDL_Surface * Surface, BFont_Info * Font, int y,
char *fmt, ...);
const char *fmt, ...);

void JustifiedPrintString (SDL_Surface * Surface, int y, char *fmt, ...);
void JustifiedPrintString (SDL_Surface * Surface, int y, const char *fmt, ...);
void JustifiedPrintStringFont (SDL_Surface * Surface, BFont_Info * Font,
int y, char *fmt, ...);
int y, const char *fmt, ...);

/* Returns a new font colored with the color (r,g,b) */
BFont_Info *SetFontColor (BFont_Info * Font, Uint8 r, Uint8 g, Uint8 b);
14 changes: 9 additions & 5 deletions src/bullet.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@
#define DRUIDHITDIST2 (0.3+MORE)*(Droid_Radius+MORE)
// #define DRUIDHITDIST2 0

// local prototypes
int GetDirection (point robo, point bul);



/*@Function============================================================
@Desc: this function moves all the bullets according to their speeds.
Expand Down Expand Up @@ -271,7 +275,7 @@ GetDirection (point robo, point bul)
void
CheckBulletCollisions (int num)
{
int level = CurLevel->levelnum;
int levelnum = CurLevel->levelnum;
float xdist, ydist;
Bullet CurBullet = &AllBullets[num];
static int FBTZaehler = 0;
Expand Down Expand Up @@ -315,7 +319,7 @@ CheckBulletCollisions (int num)
for (i = 0; i < NumEnemys; i++)
{
// !! dont't forget: Only droids on our level are harmed!! (bugfix)
if (AllEnemys[i].levelnum != level)
if (AllEnemys[i].levelnum != levelnum)
continue;

if ( IsVisible (&AllEnemys[i].pos) & (!Druidmap[AllEnemys[i].type].flashimmune) )
Expand Down Expand Up @@ -388,7 +392,7 @@ CheckBulletCollisions (int num)
for (i = 0; i < NumEnemys; i++)
{
if (AllEnemys[i].status == OUT || AllEnemys[i].status == TERMINATED ||
AllEnemys[i].levelnum != level)
AllEnemys[i].levelnum != levelnum)
continue;

xdist = CurBullet->pos.x - AllEnemys[i].pos.x;
Expand Down Expand Up @@ -454,7 +458,7 @@ void
CheckBlastCollisions (int num)
{
int i;
int level = CurLevel->levelnum;
int levelnum = CurLevel->levelnum;
Blast CurBlast = &(AllBlasts[num]);
Bullet CurBullet;
float dist;
Expand Down Expand Up @@ -482,7 +486,7 @@ CheckBlastCollisions (int num)
for (i = 0; i < NumEnemys; i++)
{
if ((AllEnemys[i].status == OUT)
|| (AllEnemys[i].levelnum != level))
|| (AllEnemys[i].levelnum != levelnum))
continue;

vdist.x = AllEnemys[i].pos.x - CurBlast->PX;
Expand Down
2 changes: 2 additions & 0 deletions src/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@

#define FreeIfUsed(pt) do { if ((pt)) SDL_FreeSurface((pt)); } while(0)

#define NUM_ELEM(x) ( sizeof((x)) / sizeof((x)[0]) )

// ----------------------------------------
// some input-related defines and macros

Expand Down
Loading

0 comments on commit 126664e

Please sign in to comment.