mirror of
https://github.com/stevenhowes/CTheEscape.git
synced 2026-05-26 15:53:29 +01:00
Audio setup, very hacky hud/font handling
This commit is contained in:
Binary file not shown.
+8
-8
@@ -38,6 +38,14 @@ o.Graphics: c.Graphics
|
|||||||
o.Graphics: C:h.swis
|
o.Graphics: C:h.swis
|
||||||
o.Graphics: C:h.kernel
|
o.Graphics: C:h.kernel
|
||||||
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.Input: c.Input
|
||||||
|
o.Input: C:h.swis
|
||||||
|
o.Input: C:h.kernel
|
||||||
|
o.Input: C:h.kernel
|
||||||
o.CTheEscape: c.CTheEscape
|
o.CTheEscape: c.CTheEscape
|
||||||
o.CTheEscape: C:h.swis
|
o.CTheEscape: C:h.swis
|
||||||
o.CTheEscape: C:h.kernel
|
o.CTheEscape: C:h.kernel
|
||||||
@@ -48,11 +56,3 @@ o.CTheEscape: C:h.swis
|
|||||||
o.CTheEscape: C:h.kernel
|
o.CTheEscape: C:h.kernel
|
||||||
o.CTheEscape: C:h.kernel
|
o.CTheEscape: C:h.kernel
|
||||||
o.CTheEscape: h.Sound
|
o.CTheEscape: h.Sound
|
||||||
o.Input: c.Input
|
|
||||||
o.Input: C:h.swis
|
|
||||||
o.Input: C:h.kernel
|
|
||||||
o.Input: C:h.kernel
|
|
||||||
o.Input: c.Input
|
|
||||||
o.Input: C:h.swis
|
|
||||||
o.Input: C:h.kernel
|
|
||||||
o.Input: C:h.kernel
|
|
||||||
|
|||||||
+76
-1
@@ -26,6 +26,8 @@ extern int current_element;
|
|||||||
enum sprite_e{player_ship, durno_ship,player_shipl,player_shipr};
|
enum sprite_e{player_ship, durno_ship,player_shipl,player_shipr};
|
||||||
char *sprites[] = {"player_ship","durno_ship","player_shipl","player_shipr"};
|
char *sprites[] = {"player_ship","durno_ship","player_shipl","player_shipr"};
|
||||||
|
|
||||||
|
int font = 0;
|
||||||
|
|
||||||
struct EntityLocation_s {
|
struct EntityLocation_s {
|
||||||
short int X,Y;
|
short int X,Y;
|
||||||
};
|
};
|
||||||
@@ -205,9 +207,65 @@ void game_input_tick()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void game_setup_audio()
|
||||||
|
{
|
||||||
|
sound_voices(4);
|
||||||
|
|
||||||
|
sound_set_voice(1,"WaveSynth-Beep");
|
||||||
|
sound_set_voice(2,"Percussion-Noise");
|
||||||
|
sound_set_voice(3,"Percussion-Soft");
|
||||||
|
sound_set_voice(4,"Percussion-Noise");
|
||||||
|
}
|
||||||
|
|
||||||
|
void game_draw_hud()
|
||||||
|
{
|
||||||
|
draw_sprite("lcars",4,DISPLAY_Y-180);
|
||||||
|
|
||||||
|
inreg.r[0] = font;
|
||||||
|
inreg.r[1] = (int)"Shields";
|
||||||
|
inreg.r[2] = 1 << 4;
|
||||||
|
inreg.r[3] = 75;
|
||||||
|
inreg.r[4] = DISPLAY_Y-60;
|
||||||
|
inreg.r[5] = 0;
|
||||||
|
inreg.r[6] = 0;
|
||||||
|
inreg.r[7] = 0;
|
||||||
|
_kernel_swi(Font_Paint,&inreg,&outreg);
|
||||||
|
|
||||||
|
inreg.r[0] = font;
|
||||||
|
inreg.r[1] = (int)"Integrity";
|
||||||
|
inreg.r[2] = 1 << 4;
|
||||||
|
inreg.r[3] = 75;
|
||||||
|
inreg.r[4] = DISPLAY_Y-90;
|
||||||
|
inreg.r[5] = 0;
|
||||||
|
inreg.r[6] = 0;
|
||||||
|
inreg.r[7] = 0;
|
||||||
|
_kernel_swi(Font_Paint,&inreg,&outreg);
|
||||||
|
|
||||||
|
inreg.r[0] = font;
|
||||||
|
inreg.r[1] = (int)"Velocity";
|
||||||
|
inreg.r[2] = 1 << 4;
|
||||||
|
inreg.r[3] = 75;
|
||||||
|
inreg.r[4] = DISPLAY_Y-120;
|
||||||
|
inreg.r[5] = 0;
|
||||||
|
inreg.r[6] = 0;
|
||||||
|
inreg.r[7] = 0;
|
||||||
|
_kernel_swi(Font_Paint,&inreg,&outreg);
|
||||||
|
|
||||||
|
inreg.r[0] = font;
|
||||||
|
inreg.r[1] = (int)"Distance";
|
||||||
|
inreg.r[2] = 1 << 4;
|
||||||
|
inreg.r[3] = 75;
|
||||||
|
inreg.r[4] = DISPLAY_Y-150;
|
||||||
|
inreg.r[5] = 0;
|
||||||
|
inreg.r[6] = 0;
|
||||||
|
inreg.r[7] = 0;
|
||||||
|
_kernel_swi(Font_Paint,&inreg,&outreg);
|
||||||
|
}
|
||||||
|
|
||||||
void game_setup()
|
void game_setup()
|
||||||
{
|
{
|
||||||
game_setup_input();
|
game_setup_input();
|
||||||
|
game_setup_audio();
|
||||||
game_setup_stars();
|
game_setup_stars();
|
||||||
game_setup_player();
|
game_setup_player();
|
||||||
tick = clock();
|
tick = clock();
|
||||||
@@ -226,6 +284,8 @@ void game_tick()
|
|||||||
|
|
||||||
game_draw_stars();
|
game_draw_stars();
|
||||||
game_draw_player();
|
game_draw_player();
|
||||||
|
|
||||||
|
game_draw_hud();
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
@@ -235,10 +295,25 @@ int main(int argc, char *argv[])
|
|||||||
display_mode(DISPLAY_MODE);
|
display_mode(DISPLAY_MODE);
|
||||||
load_sprites("Spr");
|
load_sprites("Spr");
|
||||||
|
|
||||||
intro();
|
//intro();
|
||||||
|
|
||||||
display_mode(DISPLAY_MODE);
|
display_mode(DISPLAY_MODE);
|
||||||
|
|
||||||
|
inreg.r[0] = 0;
|
||||||
|
inreg.r[1] = (int)"System.Medium";
|
||||||
|
inreg.r[2] = 12*16;
|
||||||
|
inreg.r[3] = 8*16;
|
||||||
|
inreg.r[4] = 0;
|
||||||
|
inreg.r[5] = 0;
|
||||||
|
_kernel_swi(Font_FindFont,&inreg,&outreg);
|
||||||
|
|
||||||
|
font = outreg.r[0];
|
||||||
|
inreg.r[0] = 0;
|
||||||
|
inreg.r[1] = 0xffaaa000; // TODO: Not purple
|
||||||
|
inreg.r[2] = 0x11111000;
|
||||||
|
inreg.r[3] = 14;
|
||||||
|
_kernel_swi(ColourTrans_SetFontColours, &inreg, &outreg);
|
||||||
|
|
||||||
game_setup();
|
game_setup();
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user