- Removed jail_audio, included chirps
This commit is contained in:
40
mini.cpp
40
mini.cpp
@@ -3,7 +3,8 @@
|
||||
#include <string.h>
|
||||
#include "lua.h"
|
||||
#include "gif.c"
|
||||
#include "jail_audio.h"
|
||||
|
||||
#include "chirp.h"
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
@@ -55,7 +56,6 @@ SDL_Renderer *mini_ren;
|
||||
SDL_Texture *mini_bak;
|
||||
Uint32 *pixels;
|
||||
int pitch;
|
||||
JA_Music music = NULL;
|
||||
|
||||
uint32_t palette[256] = { 0x001a1c2c, 0x005d275d, 0x00b13e53, 0x00ef7d57, 0x00ffcd75, 0x00a7f070, 0x0038b764, 0x00257179,
|
||||
0x0029366f, 0x003b5dc9, 0x0041a6f6, 0x0073eff7, 0x00f4f4f4, 0x0094b0c2, 0x00566c86, 0x00333c57 };
|
||||
@@ -86,7 +86,7 @@ char* get_value_from_line(char* line) {
|
||||
void read_ini() {
|
||||
int size;
|
||||
FILE *f = file_getfilepointer("game.ini", size); // fopen("game.ini", "r");
|
||||
char line[256];
|
||||
char line[1024];
|
||||
if (f == NULL) return;
|
||||
while (fgets(line, sizeof(line), f)) {
|
||||
char *value = get_value_from_line(line);
|
||||
@@ -123,14 +123,10 @@ void reinit() {
|
||||
}
|
||||
|
||||
void initaudio() {
|
||||
if (music!=NULL) JA_DeleteMusic(music);
|
||||
music = NULL;
|
||||
JA_Init(22050, AUDIO_S16, 2);
|
||||
chirp_init();
|
||||
}
|
||||
void quitaudio() {
|
||||
if (music!=NULL) JA_DeleteMusic(music);
|
||||
music = NULL;
|
||||
JA_Quit();
|
||||
|
||||
}
|
||||
|
||||
int scrw() {
|
||||
@@ -899,7 +895,7 @@ int rnd(int x) {
|
||||
srand(x);
|
||||
}*/
|
||||
|
||||
char tostr_tmp[256];
|
||||
char tostr_tmp[1024];
|
||||
const char* tostr(int val) {
|
||||
return SDL_itoa(val, tostr_tmp, 10);
|
||||
}
|
||||
@@ -912,7 +908,7 @@ uint8_t ascii(const char *str, uint8_t index) {
|
||||
return str[index];
|
||||
}
|
||||
|
||||
char fstr[255];
|
||||
char fstr[1024];
|
||||
|
||||
void fopen(const char *filename, uint8_t mode) {
|
||||
if (file != NULL) fclose(file);
|
||||
@@ -988,26 +984,8 @@ bool freadb() {
|
||||
return strcmp(fstr, "true")==0?true:false;
|
||||
}
|
||||
|
||||
void playmusic(const char *filename, const bool loop) {
|
||||
if (music != NULL) JA_DeleteMusic(music);
|
||||
music = JA_LoadMusic(filename);
|
||||
JA_PlayMusic(music, loop?-1:0);
|
||||
}
|
||||
|
||||
void pausemusic() {
|
||||
JA_PauseMusic();
|
||||
}
|
||||
|
||||
void resumemusic() {
|
||||
JA_ResumeMusic();
|
||||
}
|
||||
|
||||
void stopmusic() {
|
||||
JA_StopMusic();
|
||||
}
|
||||
|
||||
bool ismusicplaying() {
|
||||
return JA_GetMusicState() == JA_MUSIC_PLAYING;
|
||||
void playchirp(const char *song) {
|
||||
chirp_play(song);
|
||||
}
|
||||
|
||||
void exit() {
|
||||
|
||||
Reference in New Issue
Block a user