mirror of
https://gitlab.com/drummyfish/anarch.git
synced 2024-11-24 01:42:19 -05:00
Update teminal
This commit is contained in:
parent
4263c7454f
commit
7cb6bd749a
13
game.h
13
game.h
@ -1712,7 +1712,7 @@ void SFG_init()
|
||||
else
|
||||
{
|
||||
SFG_LOG("saving/loading not possible");
|
||||
SFG_game.save[0] = SFG_NUMBER_OF_LEVELS | 0xf0; // revealed all levels
|
||||
SFG_game.save[0] = (SFG_NUMBER_OF_LEVELS - 1) | 0xf0; // revealed all levels
|
||||
}
|
||||
|
||||
SFG_enableMusic(SFG_game.settings & 0x02);
|
||||
@ -3734,7 +3734,7 @@ void SFG_gameStepMenu()
|
||||
SFG_player.ammo[1] = SFG_game.save[4];
|
||||
SFG_player.ammo[2] = SFG_game.save[5];
|
||||
|
||||
SFG_playerRotateWeapon(0); // this chooses weapon with ammo available
|
||||
SFG_playerRotateWeapon(1); // this chooses weapon with ammo available
|
||||
break;
|
||||
}
|
||||
|
||||
@ -4069,10 +4069,11 @@ void SFG_drawStoryText()
|
||||
|
||||
SFG_clearScreen(clearColor);
|
||||
|
||||
SFG_blitImage(SFG_monsterSprites + sprite * SFG_TEXTURE_STORE_SIZE,
|
||||
(SFG_GAME_RESOLUTION_X - SFG_TEXTURE_SIZE * SFG_FONT_SIZE_SMALL) / 2,
|
||||
SFG_GAME_RESOLUTION_Y - (SFG_TEXTURE_SIZE + 3) * SFG_FONT_SIZE_SMALL,
|
||||
SFG_FONT_SIZE_SMALL);
|
||||
if (SFG_GAME_RESOLUTION_Y > 50)
|
||||
SFG_blitImage(SFG_monsterSprites + sprite * SFG_TEXTURE_STORE_SIZE,
|
||||
(SFG_GAME_RESOLUTION_X - SFG_TEXTURE_SIZE * SFG_FONT_SIZE_SMALL) / 2,
|
||||
SFG_GAME_RESOLUTION_Y - (SFG_TEXTURE_SIZE + 3) * SFG_FONT_SIZE_SMALL,
|
||||
SFG_FONT_SIZE_SMALL);
|
||||
|
||||
uint16_t textLen = 0;
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <fcntl.h>
|
||||
#include <linux/input.h>
|
||||
#include <stdio.h>
|
||||
@ -26,7 +27,7 @@
|
||||
#define SFG_SCREEN_RESOLUTION_X 127
|
||||
#define SFG_SCREEN_RESOLUTION_Y 42
|
||||
#define SFG_DITHERED_SHADOW 1
|
||||
#define SFG_FPS 20
|
||||
#define SFG_FPS 30
|
||||
|
||||
#include "game.h"
|
||||
|
||||
@ -134,10 +135,22 @@ void SFG_playSound(uint8_t soundIndex, uint8_t volume)
|
||||
{
|
||||
}
|
||||
|
||||
int running = 1;
|
||||
|
||||
void handleSignal(int signal)
|
||||
{
|
||||
puts("\033[?25h"); // show cursor
|
||||
running = 0;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int devFile;
|
||||
|
||||
signal(SIGINT,handleSignal);
|
||||
signal(SIGQUIT,handleSignal);
|
||||
signal(SIGTERM,handleSignal);
|
||||
|
||||
timeStart = getTime();
|
||||
|
||||
devFile = open("/dev/input/event0",O_RDONLY);
|
||||
@ -157,7 +170,12 @@ int main()
|
||||
|
||||
setvbuf(stdout, NULL, _IOFBF, SCREENSIZE + 1);
|
||||
|
||||
while (1)
|
||||
for (uint8_t i = 0; i < 100; ++i) // clear screen
|
||||
putchar('\n');
|
||||
|
||||
puts("\033[?25l"); // hide cursor
|
||||
|
||||
while (running)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
@ -178,11 +196,12 @@ int main()
|
||||
}
|
||||
|
||||
puts("\033[0;0H"); // move cursor to 0;0
|
||||
|
||||
puts(screen);
|
||||
fflush(stdout);
|
||||
|
||||
if (!SFG_mainLoopBody())
|
||||
break;
|
||||
running = 0;
|
||||
}
|
||||
|
||||
puts("\033[?25h"); // show cursor
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user