mirror of
https://github.com/stevenhowes/CTheEscape.git
synced 2026-05-26 15:53:29 +01:00
Don't repeatedly fire actions. Load some sounds for mission2.
This commit is contained in:
Binary file not shown.
@@ -40,18 +40,14 @@ Squeezeflags = -o $@
|
||||
|
||||
|
||||
# Dynamic dependencies:
|
||||
o.Graphics: c.Graphics
|
||||
o.Graphics: C:h.swis
|
||||
o.Graphics: C:h.kernel
|
||||
o.Graphics: C:h.kernel
|
||||
o.Input: c.Input
|
||||
o.Input: C:h.swis
|
||||
o.Input: C:h.kernel
|
||||
o.Input: C:h.kernel
|
||||
o.Graphics: c.Graphics
|
||||
o.Graphics: C:h.swis
|
||||
o.Graphics: C:h.kernel
|
||||
o.Graphics: C:h.kernel
|
||||
o.Graphics: c.Graphics
|
||||
o.Graphics: C:h.swis
|
||||
o.Graphics: C:h.kernel
|
||||
o.Graphics: C:h.kernel
|
||||
o.CTheEscape: c.CTheEscape
|
||||
o.CTheEscape: C:h.swis
|
||||
o.CTheEscape: C:h.kernel
|
||||
@@ -82,3 +78,4 @@ o.Mission2: h.Graphics
|
||||
o.Mission2: C:h.swis
|
||||
o.Mission2: C:h.kernel
|
||||
o.Mission2: C:h.kernel
|
||||
o.Mission2: h.Sound
|
||||
|
||||
+17
-4
@@ -1,6 +1,7 @@
|
||||
#include "Graphics.h"
|
||||
#include "swis.h"
|
||||
#include <kernel.h>
|
||||
#include "Sound.h"
|
||||
|
||||
extern int tick;
|
||||
extern int lasttick;
|
||||
@@ -53,6 +54,8 @@ struct TilePlayer_s {
|
||||
struct EntityLocation_s lastmapoffset;
|
||||
struct EntityLocation_s localtile;
|
||||
int rawtile;
|
||||
int lastrawtile;
|
||||
|
||||
unsigned char direction;
|
||||
unsigned char facedirection;
|
||||
unsigned char sprite[13];
|
||||
@@ -231,6 +234,12 @@ void game2_fillmap(int xoffset, int yoffset)
|
||||
memcpy(map[0][9],fullmap+yoffset+(xoffset*100)+900,10);
|
||||
}
|
||||
|
||||
void game2_setup_audio()
|
||||
{
|
||||
sound_pcm_loadsample(PCMSAMPLE_HAIL,"sounds.commbdg");
|
||||
sound_pcm_loadsample(PCMSAMPLE_DOOR,"sounds.door");
|
||||
}
|
||||
|
||||
void game2_setup()
|
||||
{
|
||||
screen_flipbuffer();
|
||||
@@ -256,7 +265,7 @@ void game2_setup()
|
||||
TilePlayer.animframe = 0;
|
||||
TilePlayer.nextanimframe = 0;
|
||||
TilePlayer.nextanimidle = 0;
|
||||
|
||||
TilePlayer.lastrawtile = -1;
|
||||
memset(map[0],0xFF,100);
|
||||
memset(map[1],0xFF,100);
|
||||
memset(map[2],0xFF,100);
|
||||
@@ -264,6 +273,7 @@ void game2_setup()
|
||||
game2_loadmap("m2_map");
|
||||
game2_loadsmarttiles("m2_smart");
|
||||
game2_loadareanames("m2_areas");
|
||||
game2_setup_audio();
|
||||
|
||||
game2_fillmap(TilePlayer.mapoffset.X,TilePlayer.mapoffset.Y);
|
||||
}
|
||||
@@ -509,20 +519,23 @@ int game2_tick()
|
||||
}
|
||||
}
|
||||
|
||||
TilePlayer.lastrawtile = TilePlayer.rawtile;
|
||||
TilePlayer.rawtile = (TilePlayer.mapoffset.Y) + TilePlayer.localtile.Y + (TilePlayer.mapoffset.X * 100) + (TilePlayer.localtile.X * 100);
|
||||
|
||||
if(TilePlayer.rawtile != TilePlayer.lastrawtile)
|
||||
{
|
||||
// Trigger any smart tiles for our centre of mass
|
||||
for(i = 0; i < SMARTTILES; i++)
|
||||
{
|
||||
if(SmartTiles[i].Tile == TilePlayer.rawtile)
|
||||
{
|
||||
// Change tile sprite
|
||||
if(SmartTiles[i].Action == 0)
|
||||
if(SmartTiles[i].Action == 0) // Change tile sprite
|
||||
fullmap[SmartTiles[i].ActionTarget] = SmartTiles[i].ActionValue;
|
||||
else if(SmartTiles[i].Action == 1)
|
||||
else if(SmartTiles[i].Action == 1) // Change area name
|
||||
sprintf(areaname,"%s",Areas[SmartTiles[i].ActionValue].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
game2_tick_input();
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ enum pcmchannel_e{
|
||||
PCMCHANNEL_NPC2 = 7,
|
||||
PCMCHANNEL_AMBIENT = 8
|
||||
};
|
||||
enum pcmsample_e{PCMSAMPLE_DURNOTORPEDO, PCMSAMPLE_PHASER, PCMSAMPLE_SHIPEXPLODE, PCMSAMPLE_TRACTOR, PCMSAMPLE_HAIL, PCMSAMPLE_MAX};
|
||||
enum pcmsample_e{PCMSAMPLE_DURNOTORPEDO, PCMSAMPLE_PHASER, PCMSAMPLE_SHIPEXPLODE, PCMSAMPLE_TRACTOR, PCMSAMPLE_HAIL, PCMSAMPLE_DOOR, PCMSAMPLE_MAX};
|
||||
|
||||
struct CompositionElement {
|
||||
signed short int Start;
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user