Files
RustRaptor/raptor/src/eshot.h
T
raptorreplica 214789fe87 Fork the vendored engine into the playable replica
Engine changes vs the vendored upstream (full ledger in
docs/upstream-patches.md):

- Assets: replace the encrypted FILE000N.GLB archives with a catalog of
  pre-decrypted loose files (data/INDEX); GLB_SlotItems() drives
  mission-pack / registered-version detection; payloads never run the
  GLB cipher at runtime.
- Platform: Linux/SDL2/ALSA only; Android, MSVC/MinGW, macOS packaging,
  bundled Windows SDL2 SDKs and the ENDOOM exit screen are gone;
  EXIT_Error now prints before exiting.
- Rendering: decouple presentation from simulation -- sim stays at the
  original 70/3 Hz, frames render interpolated at display rate (player,
  map scroll, enemies, shots, bonuses, anims, shadows); menus keep 70 Hz
  pacing; vsync with a delay-guard fallback.
- QoL: borderless window mode (Video/borderless), no menu cursor
  snapping onto default buttons.

Fix four regressions from the render split:

- Shield bars never redrew: RAP_ThinkStats latches g_oldshield each sim
  step before RAP_DisplayStats' dirty check could fire. Bars now draw
  unconditionally per rendered frame; g_oldsuper deleted, g_oldshield
  kept as sim-side damage-detection state only.
- Dying ships despawned without exploding: the render loop never called
  ANIMS_DisplayHigh(); most air-death explosions register HIGH_AIR.
  Restored between the player and enemy shots, as upstream orders it.
- Laser turret broke: reusing doneflag as a draw marker (it is
  hit/retire game state, and the turret retire path never frees its
  shot) hid the beam on hitting ticks and leaked one SHOTS pool slot
  per fire until no weapon could shoot. S_LINE tracers now carry an age
  counter: one Think pass, every render of their birth step, purged at
  the top of the next Think.
- Muzzle flash was cleared per rendered frame, making it invisible at
  display refresh rates; now cleared once per simulation step.
2026-08-26 18:45:07 +10:00

57 lines
1.9 KiB
C

#pragma once
#include "rap.h"
#include "enemy.h"
#include "gfxapi.h"
typedef enum
{
ES_ATPLAYER, // 0
ES_ATDOWN, // 1
ES_ANGLELEFT, // 2
ES_ANGLERIGHT, // 3
ES_MISSLE, // 4
ES_LASER, // 5
ES_MINES, // 6
ES_PLASMA, // 7
ES_COCONUTS // 8
}ESHOT_TYPE;
typedef struct
{
int item; // BASE ITEM NUMBER
char *pic[10]; // POINTER TO PICS
int num_frames; // NUMBER OF FRAMES
int smokeflag; // TRUE = SMOKETRAIL
int speed; // SPEED OF SHOT
int xoff; // X CENTER OFFSET
int yoff; // Y CENTER OFFSET
int hits; // HIT POINT DAMAGE TO PLAYER
}ESHOT_LIB;
typedef struct ESHOT_S
{
struct ESHOT_S *prev; // LINK LIST PREV
struct ESHOT_S *next; // LINK LIST NEXT
char *pic; // POINTER TO CUR FRAME PIC
int curframe; // CURRENT ANIM FRAME
int x; // CUR SHOT CENTER X
int y; // CUR SHOT CENTER Y
int px; // PREV SIM X (INTERP)
int py; // PREV SIM Y (INTERP)
MOVEOBJ move; // MOVE STUFF
int doneflag; // SHOT DONE = TRUE
ESHOT_LIB *lib; // POINTER TO LIB
int cnt;
int speed;
int pos;
int type;
SPRITE_SHIP *en;
int gun_num;
}ESHOT;
void ESHOT_Shoot(SPRITE_SHIP *enemy, int gun_num);
void ESHOT_Clear(void);
void ESHOT_Think(void);
void ESHOT_Display(void);
void ESHOT_Init(void);