2582 Commits

Author SHA1 Message Date
adam 20c0a8e258 Move the sorting into the C++ so I can make qsort disappear. 2024-04-24 20:37:46 -04:00
adam d813c3ae37 More modern memory management in the modern pstarmap file. 2024-04-24 20:05:26 -04:00
adam 34199636ed Starting hook for custom C++ or Lua gen definitions. 2024-04-24 19:42:04 -04:00
adam a40f4e0801 Start doing some C++ memory management. 2024-04-24 19:40:01 -04:00
adam d2c22dc648 A toe in the water for the first bits of pure (modern) C++ in the code.
I'll expand it from here.
2024-04-24 18:46:56 -04:00
adam 2a4d7f40e2 Some hyperspace physics hacks...
You can go faster in hyperspace, but because of the inertial
calculations, it gets a bit janky in hyperspace slow-down...
2024-04-24 15:53:49 -04:00
adam 703bc6114e Some of my hacky system generation playing.
I'll probably roll all this back, but now I can hack around with
putting new starbases in systems, playing with the map, etc.

Then I might be able to look into auto-gen stuff!
2024-04-24 15:52:53 -04:00
adam 048e97450e Some C++ compat. 2024-04-24 15:52:31 -04:00
adam 96fb179e4b Make slave-shields be blue... just a bit of a tweak.
A bit hacky for now...
2024-04-24 15:51:54 -04:00
adam af26d16562 Permit up to 5 moons. 2024-04-24 10:14:41 -04:00
adam 104cc02ed1 Starbase menu is now accessible by a function.
The original game did a bunch of one-off specifics to enter the
starbase menu.  Since I want to make this available in multiple
places (even via script... and maybe by *building* new starbases),
I'll need a simple function to call.

I've tested it by making the Chmmr and Syreen starbase both call
this function -- it works.  (It's kinda neat to have starbases
all over the galaxy!  It totally makes for a different kind of
game.)

Of course, since I intend to make all planet stuff customizable
via Lua -- one can make their own game have whatever they want.
A main starbase, which might get conquered and then have to be
relocated could be interesting.  I aim to make "nearly anything"
possible.
2024-04-24 10:09:49 -04:00
adam bdbd7158b9 Dynamically compute the number of stars in the array. 2024-04-24 10:05:20 -04:00
adam 41d31a4870 Turn off all slave shields.
Unfortunately...  Earth has no texture/resource/asset for the
zoomed-in landing.  Just the mini-map and the globe.  What's
interesting here is that this indicates that those two assets
are distinct!  I always thought they were the same.

I'll have to dig into how they're related.
2024-04-23 23:41:45 -04:00
adam 7b8f588467 Turn off the death-march.
Why?  To permit exploration for fun.

(I intend to have per-game random seeds to permit planets and star
systems to be uniquely generated, if so desired.  I'm also
considering making it so that whole constellations that aren't
associated with races can just spawn in random places, etc.)
2024-04-23 23:40:14 -04:00
adam 3343f6391c Add speed to the precursor ship.
This permits a lot of racing about hyperspace...  For fun and profit.

(Mostly just to explore the game world.)
2024-04-23 23:31:10 -04:00
Michael Martin e04c4cf2d6 Fix input of trans-ASCII Unicode characters under SDL2 2022-08-17 19:08:54 -07:00
Michael Martin 5cc99564a7 Updated fix for Bug #934.
SDL1 and SDL2 have slightly different behavior regarding detection
of the NUM LOCK key. Both branches should now interpret keypad input
when in text-input mode as only text when NUM LOCK is on.
2021-11-01 20:42:29 -07:00
Michael Martin 4f5cbef324 Upgrade internal libmikmod to 3.3.11.1.
This should fix music playback corruption issues reported on
64-bit ARM architectures.
2021-07-25 14:47:32 -07:00
Michael Martin c194cd2ad9 Correctly handle Unicode Replacement Characters 2020-12-26 19:06:47 -08:00
Michael Martin 57b887c8d8 Put the Text Input code in the correct SDL version branch 2020-12-26 19:06:37 -08:00
Michael Martin 83b215fd25 Fix misplaced FlashRect when renaming Captain/Ship 2020-12-25 17:55:02 -08:00
Michael Martin d15087102f Restrict SDL_Start/StopTextInput calls to the UI thread 2020-12-23 16:18:44 -08:00
Michael Martin c8eba312f4 Remove beta marker from version strings 2020-11-27 16:12:18 -08:00
Michael Martin c7bdd74ee6 Fix two bugs regarding stale SIS messages, from Kruzen
When entering Hyperspace on Auto-Pilot, or are intercepted by
neutral or hostile alien ships during Auto-Pilot, the text at the
top of the screen doesn't update properly until the status
would need to change. This corrects the times when DrawSisMessage
is called to keep that up-to-date as needed.

This patch was backported from the Mega-Mod.
2020-10-05 21:22:51 -07:00
Michael Martin 8da99fc5d1 Fix the ZFP dialog desync bug introduced post 0.7.
The core issue is that the sound-advancement callbacks (used only
for altering the ZFP dialog locations) were altered to be launched
asynchronously from the main thread. This meant that new dialog
could be detected before the waiting callbacks had run.

This patch moves audio callbacks back into the audio decoding thread
and protects them with the speech-channel mutex. This should
guarantee that cur_sub_chunk only appears as a value when consulting
the current subtitles after the callback has run completely.

Logic has also been added to CheckSubtitles to raise a warning in
the logs if the values get out of sync.
2020-09-27 18:01:14 -07:00
Michael Martin 5f268d85d1 Fix a render crash on Intel GPUs in 32-bit DX9 2020-08-02 17:34:37 -07:00
Michael Martin 49a6612fea Rework SDL2 render driver selection.
The "direct3d" DX9 driver is no longer skipped by default.
There is a new --renderer=VALUE option to attempt to use the named
SDL2 render driver if present and compatible.
2020-07-11 15:34:21 -07:00
Michael Martin 1faf6c87c3 Reimplement log_displayBox on macOS.
NSRunCriticalAlertPanel was replaced with the NSAlert class in 10.3
and deprecated in 10.10. This rewrite uses that class instead.

Furthermore, original comments to the contrary, we are not compiling
with ARC and need to actually release the classes we create and allow
for an autorelease pool.
2020-06-09 18:54:32 -07:00
Michael Martin 6093fb467c Fix another pointer signedness warning 2020-06-09 18:36:39 -07:00
Michael Martin 6bcaa2a1f3 Fix SaveSummary return type 2020-06-09 18:18:36 -07:00
Michael Martin 4f393ac170 Defensive casting to silence clang warnings 2020-06-09 18:18:12 -07:00
Michael Martin 76bc15156f dirname can modify its argument; don't pass in a const char * 2020-06-09 17:45:55 -07:00
Michael Martin 1d5cbf3350 Remove potential format-string attack on log_displayBox on macOS 2020-06-09 17:38:34 -07:00
Michael Martin 86109d570c Fix an alarming bug in AlarmTime_compare 2020-06-09 17:21:59 -07:00
Michael Martin ca9174d317 Fix strncpy warning by making it more obviously dangerous
The function as a whole is boundschecked after the fact, but as its
comments state, this function really needs its API changed to carry
buffer lengths in from the outside.
2020-06-09 17:18:36 -07:00
Michael Martin bd9b78e601 Fix strncpy warning with correct bounding value 2020-06-09 17:18:05 -07:00
Michael Martin 002e1994a1 Fix oscilloscope display under SDL2 2020-06-09 15:09:21 -07:00
Michael Martin f39a37ff2f Fix icon on Windows with MinGW/MSYS2 builds, from Ala-lala 2020-06-08 16:09:05 -07:00
Michael Martin a8785656eb Update in-game version to beta status 2020-06-08 00:22:08 -07:00
Michael Martin c30050cb6a Update version number to 0.8.0 2020-04-04 20:04:39 -07:00
Michael Martin d414c0bf45 Remove redundant statefile saver from new format 2020-04-04 19:47:05 -07:00
Michael Martin 1e687b9392 Merge commit '7326ff096d0fc60086f2' into v0.8.0 2020-04-04 17:52:44 -07:00
Michael Martin d8716aad4c Do not use the D3D9 SDL2 driver if any alternatives are to hand.
This works around a driver crash in Intel Integrated drivers on
Windows.
2020-04-04 16:39:31 -07:00
Michael Martin c46baa8a29 Update version to 0.7.2 2020-04-04 00:06:21 -07:00
Michael Martin 31e09def39 Fix SDL1 build 2020-04-03 23:43:25 -07:00
Michael Martin 75da16d99e Fix SDL2 build errors 2020-04-03 23:30:10 -07:00
Michael Martin f2a7328037 Backport atexit consolidation 2020-04-03 23:13:34 -07:00
Michael Martin 202c1454f0 Consolidate Create_Screen and ReInit_Screen for the SDL1 drivers.
SDL1 drivers use a special SDL1_ReInit_Screen function not available
to SDL2 systems.
2020-04-03 22:28:52 -07:00
Michael Martin dae12ade1e Backfit commit '103f9379' to SDL1/2 build:
"Removed retired function TFB_BlitSurface()"
2020-04-03 22:21:08 -07:00
Michael Martin a0823420c3 Fix some merge wobbles in headers 2020-04-03 22:20:14 -07:00