Commit Graph

480 Commits

Author SHA1 Message Date
Julie Marchant 24e565680b Lots of Unicode usages, + title screen efficiency 2019-06-04 19:10:24 -04:00
Julie Marchant c665d2451d FINALLY fixed the unicode rendering! 100% good now!
Font switched to TakaoGothic. May change again later, we'll see.
I think I'll make it so that translations can specify a custom font.
2019-06-04 11:45:57 -04:00
Julie Marchant 4ca7cbe0c9 Fixed coloring. 2019-06-04 09:49:26 -04:00
Julie Marchant d675800a17 Fixed the text breaking part.
Now for the rendering... Seems to be a font issue.
2019-06-04 09:31:45 -04:00
Julie Marchant c798d0d7ec Starting to fix the core problem.
Using Pango's pango_get_log_attrs function.

Not finished yet, but this is the start of it.
2019-06-03 22:36:03 -04:00
Julie Marchant 0a522faea6 Ugh, it doesn't work at all. 2019-06-03 21:05:38 -04:00
Julie Marchant 1f3f1d46b1 Turn on use of Unicode. (Still not actually used.) 2019-06-03 20:20:13 -04:00
Julie Marchant edd1239f01 Finally fixed, I think. 2019-06-03 15:54:02 -04:00
Julie Marchant 8a7edc7202 Completely reworked that. Hopefully good now? Will test later. 2019-06-03 14:05:31 -04:00
Julie Marchant a3e2867ae9 Ugh, this is broken beyond belief... 2019-06-02 23:37:40 -04:00
Julie Marchant 1b8581f471 A bit more 2019-06-02 19:53:03 -04:00
Julie Marchant 1af6cfd75b Boy was I wrong...
Not surprising. Anyway, made some further progress.
2019-06-02 17:40:32 -04:00
Julie Marchant f23307f34c A little more progress 2019-06-02 14:39:52 -04:00
Julie Marchant 24f44e509f Implemented Unicode text rendering... I think?
I'm in a bit of a rush so I can't check yet (also it's deactivated
for now). But I think I'm finished? Will check later.
2019-06-02 11:30:39 -04:00
Julie Marchant e17247aa99 Always update options surface. 2019-06-02 07:39:54 -04:00
Julie Marchant 56ac26c794 Improved the pause screen somewhat when resizing.
I unfortunately can't make it perfect because rendering is too
closely tied into game logic, but this way, you at least see the
"PAUSED" text.
2019-06-01 23:42:13 -04:00
Julie Marchant 47e2aa7a40 Fixed status screen. 2019-06-01 23:28:54 -04:00
Julie Marchant ee3ba27fe8 Fixed copyright text in title screen. 2019-06-01 23:06:52 -04:00
Julie Marchant 4a2b05b6d6 Updated all remaining blitTextInPlace calls. Removed legacy function. 2019-06-01 23:04:19 -04:00
Julie Marchant a4760466fe Fixed some more 2019-06-01 18:16:32 -04:00
Julie Marchant 356a6472b4 Converted the main menu. 2019-06-01 15:12:02 -04:00
Julie Marchant 7011080965 Adapt shop positioning when window resized, plus removed several magic numbers 2019-05-31 22:33:28 -04:00
Julie Marchant 6a945685b9 More conversions 2019-05-31 14:23:48 -04:00
Julie Marchant 3369b6c5c1 Fixed screen_adjustDimensions, plus updated some more blitTexts. 2019-05-30 23:09:10 -04:00
Julie Marchant d38c82ea69 More conversions, incl. status screen 2019-05-30 22:15:51 -04:00
Julie Marchant bf01637f57 A couple more. 2019-05-30 18:42:10 -04:00
Julie Marchant ba248f8264 Started migrating to the new blitText, plus a small fix
The fix is simpl to make blitTextInPlace center text to the
screen rather than the text creation doing it. That way you don't
get weird behavior with screen_blitText (which already handles centering).
2019-05-30 18:33:31 -04:00
Julie Marchant 0ac42df374 Added a new screen_blitText function.
The old one still remains while I adapt the code to the new one.
This is simply a decoupling of the absolute position of text from
the creation of the text, to better facilitate position adaptation
to changes in screen size. Position indicated at creation remains
only for relative position (for use by e.g. credits and status lines).
2019-05-30 18:09:15 -04:00
Julie Marchant 3c866fe150 Revert "Adapt the menu properly when resizing the window."
This reverts commit 4b2811b56b.
2019-05-30 18:02:33 -04:00
Julie Marchant dabda7f436 Revert "Adapt HUD during missions"
This reverts commit 9d825e5415.
2019-05-30 18:02:18 -04:00
Julie Marchant 9d825e5415 Adapt HUD during missions 2019-05-30 17:52:58 -04:00
Julie Marchant 4b2811b56b Adapt the menu properly when resizing the window. 2019-05-30 17:35:40 -04:00
Julie Marchant 840b7fbd30 Rescale backgrounds when resizing window. 2019-05-30 16:51:02 -04:00
Julie Marchant 12a3fcdbab Started on adaptive aspect ratio adjustment.
Just one problem: the backgrounds don't get resized and so you get
awful mush on the right side/bottom of the screen. Will fix in
the next commit.
2019-05-30 13:14:32 -04:00
Julie Marchant f10af4aaf3 Made the window resizable. 2019-05-30 12:29:47 -04:00
Julie Marchant 7296b8ab76 Fixed some graphical problems.
Problem 1: fullscreen switching was leaving artifacts. Fixed by
drawing all black when switching fullscreen (and switching fullscreen
is now handled by its own function).

Problem 2: the mission briefing screen would distort if you changed
fullscreen during it. Fixed by redrawing the screen (it was previously
only drawn once).
2019-05-30 12:01:42 -04:00
Julie Marchant 04033b332e Added "desktop" fullscreen back in, plus removed key repeats. 2019-05-30 11:32:50 -04:00
Julie Marchant d8331ac14e Re-added the classic-mode-edge-behavior in a better way.
This way preserves checks for Classic difficulty within (where
auto-camera-centering is implemented) so that if the edge behavior
ever changes again, it won't have unintended side-effects.  The
conditional is also inverted to make it easier to read.
2019-05-29 21:08:54 -04:00
Julie Marchant 628ed07c8b Revert "Removed the camera fix for Classic difficulty."
This reverts commit 0bacdfa494.
2019-05-29 20:58:12 -04:00
Julie Marchant ec2d532435 Fixed up some stuff in the Apple code (or at least I think I did) 2019-05-27 00:56:51 -04:00
Julie Marchant c0ca361da6 Added proper Windows support.
I think this should be good, but I can't test it right now because
I don't have a Windows compiler handy at the moment. Will make sure
to do so before making a release.
2019-05-27 00:28:04 -04:00
Julie Marchant 44f3d05533 Sell secondary for "none" in Classic difficulty, as in the original.
The modern version sells for rockets (i.e. you get rockets back when
you sell your secondary), but the original instead left you with
no secondary at all in this case. This behavior has now been restored.
2019-05-26 20:31:34 -04:00
Julie Marchant 5c6d4e5134 Restored use of the word "Target" for all target life bars in Classic mode.
At some point I replaced the "Target" text with "Sid", "Phoebe", and
"Kline" for those respective characters. Classic difficulty now always
uses the word "Target" once again.
2019-05-26 20:18:10 -04:00
Julie Marchant dcd4fd735b Fixed the bug that caused the time cheat to make Mars unwinnable.
Am I going crazy? I could have swore this was fixed years ago.
2019-05-26 20:01:16 -04:00
Julie Marchant 431358e7ae Fixed a bug that caused mobile shields to resurrect the boss from the dead.
The main problem with this bug was simply that it caused a constant
cycle of resurrection and death, which generated tons and tons of
powerups. It was only realistically achievable with cheats enabled,
but still, this seems undesirable.
2019-05-26 19:49:28 -04:00
Julie Marchant 87253b7212 Always show the arrow as red in Classic difficulty. 2019-05-26 19:41:31 -04:00
Julie Marchant 7a066e08a0 Implemented centering of the target arrow in Classic difficulty. 2019-05-26 19:32:52 -04:00
Julie Marchant e86e5210df Re-implemented a targeting system similar to the original for Classic.
It's not exactly the same technically, but in function it is. The
only functional difference is that the original would sometimes show
an unexpected health bar for a small(ish) enemy, whereas the new
implementation never does that.

Also different is that exact location is still shown. Will fix that
next.
2019-05-26 18:22:08 -04:00
Julie Marchant ac44cbdf75 fixed the long-standing segfault, plus fixed a bug with the Dorim mission.
So, that segfault? Turns out there's a place where I forgot to check
if something was NULL before accessing it, which turned out to be
important because for some reason, gfx_textSprites[TS_RADIO] got
set to 32 at some point while gfx_messageBox remained NULL.

This may be indicative of a memory leak somewhere, but it's
also possible that maybe it was left-over from a previous mission
or something, which may have been what made it so hard to spot (that
would make the bug time-sensitive as well as context-sensitive). In
any case, at least the segfault is fixed now.
2019-05-26 17:43:14 -04:00
Julie Marchant 8ca4522ac9 Target the exec transport instead of Sid in Poswic for Classic difficulty.
Also added missing entries about Classic differences in the readme.
2019-05-26 16:19:33 -04:00
Julie Marchant 3e453a2f3c Added an "original AI type" definition for the sake of the exec transport.
This is something I forgot about before: the executive transport
A.I. was changed by me at some point from "Normal" to "Evasive".
This change re-introduces "Normal" A.I. for this ship in Classic
difficulty.
2019-05-26 15:35:46 -04:00
Julie Marchant 72cb75fb7e Added a preference for giving the player needed items. 2019-05-26 01:08:58 -04:00
Julie Marchant d7dc0844c8 Adjusted the delay of ray damage, plus some misc code fixes. 2019-05-24 22:05:09 -04:00
Julie Marchant 281687b1c5 Small adjustment to some checks. 2019-05-23 12:18:29 -04:00
Julie Marchant d17a8f36c7 Better malloc practice, plus several missing warnings 2019-05-23 11:25:54 -04:00
Julie Marchant b251acb4fe Removed the now unnecessary casting for malloc calls. 2019-05-23 11:07:03 -04:00
Julie Marchant 908a6059ac Finished C conversion! Hoorah!
Note: Autoconf files must be cleaned up and regenerated to ensure
proper compilation.
2019-05-23 11:02:48 -04:00
Julie Marchant ed0cc2ec97 Updated one more copyright notice. 2019-05-22 23:35:18 -04:00
Julie Marchant 7dc10025f0 Merge branch 'master' of git.savannah.nongnu.org:/srv/git/starfighter 2019-05-22 22:19:52 -04:00
Julie Marchant f552b66c10 Restored behavior of attachments for Classic difficulty. 2019-05-22 22:19:34 -04:00
Julie Marchant 371896eb60 Updated copyright dates. 2019-05-21 18:47:32 -04:00
Julie Marchant 5670032156 Added difficulty indicator to the status screen. 2019-05-21 18:36:45 -04:00
Julie Marchant 5931846f03 Restored original triple and quad spread for Classic difficulty. 2019-05-21 13:49:28 -04:00
Julie Marchant 0bacdfa494 Removed the camera fix for Classic difficulty.
This re-implements the bug where the edge of the screen effectively
slows you down. I might revert this; we'll see.
2019-05-21 13:35:38 -04:00
Julie Marchant 0801188bd6 Removed prevention of useless plasma in Classic difficulty. 2019-05-21 13:28:09 -04:00
Julie Marchant e398440a56 Made Classic difficulty almost exactly like the original.
There are only a couple changes that I've left in:

1. On normal missions, the edge of the screen still doesn't slow you down.
2. The shop still does not have the old bug where selling was based on the price of the next item.
3. Not sure about this, but some powerups don't spawn if they're of no use to you; I believe this was not in the original, but it's been left in anyway.
4. Not sure about this either, but I believe the original had the 3-way spread much wider. This has not been adjusted for Classic difficulty.

Other than those three, Classic difficulty is now exactly the same,
including a re-implementation of the whole "score" system where destroying
a ship nets you money instantly and the absurd system where you buy only
10 plasma capacity at a time. I might adjust 1, 3, and/or 4 above later
on.
2019-05-21 13:17:07 -04:00
Julie Marchant 838722590c Moved some variable declarations to top of function. 2019-05-21 02:09:26 -04:00
Julie Marchant e22a2bc168 Converted consts to #define calls. 2019-05-21 01:51:39 -04:00
Julie Marchant aa9d673aab Changed screenWidth and screenHeight to #defines. 2019-05-20 11:25:05 -04:00
Julie Marchant e51c55b16b Revert "Converted to C... tried and failed to convert Autoconf."
This reverts commit 7fd19f29ba.
2019-05-20 01:56:16 -04:00
Julie Marchant 7fd19f29ba Converted to C... tried and failed to convert Autoconf.
Broken for now. Committing so I can switch computers.
2019-05-19 23:57:55 -04:00
Julie Marchant 9014be8678 Merge branch 'master' of git.savannah.nongnu.org:/srv/git/starfighter 2019-05-19 23:46:46 -04:00
Julie Marchant 624d5bcb37 Parenthesis 2019-05-19 23:46:26 -04:00
Julie Marchant 8fc30e61f3 Finished conversion to malloc/free. 2019-05-19 18:22:53 -04:00
Julie Marchant 0ba13df0d7 Merge branch 'master' of git.savannah.nongnu.org:/srv/git/starfighter 2019-05-19 13:41:42 -04:00
Julie Marchant 6644be553e Converted some new and delete calls to malloc and free.
This is the last step to converting Starfighter to C. Almost there!
2019-05-19 13:40:50 -04:00
Julie Marchant c5ee1b3e09 Fixed failure to use player_damage for explosions.
Also made one tweak: when shield gets to "low" or "critical",
damage delay is reset (so that you get more protection from rays).
2019-05-11 02:49:21 -04:00
Julie Marchant e406c8eecd Fixed indentation. 2019-05-11 02:38:21 -04:00
Julie Marchant 5cc48d3f9f Tweaked the reduction method of damageDelay. 2019-05-11 02:26:37 -04:00
Julie Marchant 3b7bb45e28 Improved damaged nerfing
Limited damage prevention to only at the "low" and "critical" levels,
plus added a delay for when damage is first inflicted by rays.

This prevents ships with multiple concentrated shots from having
a disadvantage, and it helps make rays easier to avoid at the same
time (just get out of the ray in time and you don't take damage).
Of course, neither of these apply to Classic difficulty, although
the ray damage delay does apply to Nightmare difficulty (which,
given how unpredictable rays are, I think is quite reasonable).
2019-05-11 02:15:36 -04:00
Julie Marchant ded0be314e Added a damage-control mechanic.
Limits the damage you take somewhat. Basically, this is intended
to prevent sudden deaths; if it doesn't look like you're dying,
you probably won't suddenly get axed. Of course, this is disabled
in Classic difficulty.
2019-05-10 21:09:34 -04:00
Julie Marchant 828b56d4df Fixed broken code for Classic difficulty.
The mistake caused the Classic game to deviate from the original
by not allowing Kline to drop mines in the Elamale mission. For
some reason I accidentally put that check in for Moebo instead.
Whoops!
2019-05-04 12:47:05 -04:00
Julie Marchant cbdbf94498 Replaced some uses of sprintf with snprintf. 2018-04-21 10:44:33 -04:00
onpon4 341ef6907a Fixed lack of braces.
No real-world effect, but it's still wrong.
2017-10-19 16:36:35 -04:00
onpon4 abc3fbd7c0 Prevent screen sizes smaller than 640x480. 2017-03-28 11:03:53 -04:00
onpon4 209a007775 Open files as text, not binary. 2017-03-28 10:35:11 -04:00
onpon4 9c089a5013 Made a change that I think might fix bug #50644. 2017-03-26 23:52:05 -04:00
onpon4 6c1e59d434 Removed SDL_gfx dependency.
At first I was going to just not bother with the resizing thing, but
then I found out that SDL actually has a scaling function built-in.
So rather than depending on SDL_gfx for this one purpose that never
sees the light of day in practice, I have handed that job over to
that function.
2017-02-20 21:46:35 -05:00
onpon4 427f92ce2b Fixed the method for checking whether compiling for Windows. 2017-02-10 10:39:27 -05:00
onpon4 6c616bb4a2 Fixed where mines appear when screen width is larger than 800.
This causes the game to be easier, but whatever. The game is easier
with a bigger view anyway.
2017-02-05 17:37:22 -05:00
onpon4 2446baf718 Cause scaling to always be square. 2017-02-05 17:25:17 -05:00
onpon4 e36a1e82e7 Changed the game to use true fullscreen.
The fake "windowed fullscreen" is less invasive, but it sometimes
causes ugly artifacts and as a general rule isn't really all that
useful.

However, I also defined it in defs.h, so that it can be more easily
changed in the future.
2017-02-05 16:40:59 -05:00
onpon4 73a7afdc25 Added Pandora/Pyra controls. 2017-02-05 15:45:24 -05:00
onpon4 aa8ab90cf4 Fixed some minor cosmetic issues. 2017-02-05 14:49:43 -05:00
onpon4 6e67ba66c0 Fixed the Buy and Sell buttons. 2017-02-05 12:59:26 -05:00
onpon4 2d2c8e9732 Fixed the shop items. 2017-02-05 12:56:53 -05:00
onpon4 0effb37d4e Fixed shop item positions. 2017-02-05 12:39:02 -05:00
onpon4 3b56b0dbfb Improved the look of the shop. 2017-02-05 12:35:32 -05:00
onpon4 9f0ceebd6a Added a hack to prevent the fullscreen flickering effect and other weirdness. 2017-02-05 12:31:08 -05:00
onpon4 a7f4edb9ea Reverted the last change.
It was just a coincidence. Nothing actually changed.
2017-02-05 12:24:22 -05:00