[Add] Actually use the new loading graphics.
This commit is contained in:
parent
0b65e1c4b9
commit
45333c33d5
@ -74,6 +74,7 @@ DATA_AI := $(wildcard ../scripts/ai/*.lua \
|
|||||||
../scripts/ai/include/*.lua \
|
../scripts/ai/include/*.lua \
|
||||||
../scripts/ai/tpl/*.lua)
|
../scripts/ai/tpl/*.lua)
|
||||||
DATA_GFX := $(wildcard ../gfx/*.png \
|
DATA_GFX := $(wildcard ../gfx/*.png \
|
||||||
|
../gfx/loading/*.png \
|
||||||
../gfx/gui/*.png \
|
../gfx/gui/*.png \
|
||||||
../gfx/logo/*.png \
|
../gfx/logo/*.png \
|
||||||
../gfx/outfit/space/*.png \
|
../gfx/outfit/space/*.png \
|
||||||
|
@ -13,8 +13,7 @@ function create()
|
|||||||
|
|
||||||
if rnd.int() > 0.7 then
|
if rnd.int() > 0.7 then
|
||||||
mem.bribe = math.sqrt(ai.shipmass())*(500. * rnd.int() + 1750.)
|
mem.bribe = math.sqrt(ai.shipmass())*(500. * rnd.int() + 1750.)
|
||||||
mem.bribe_prompt = string.format("\"For some %d credits I could forget \
|
mem.bribe_prompt = string.format("\"For some %d credits I could forget about seeing you.\"", mem.bribe)
|
||||||
about seeing you.\"", mem.bribe)
|
|
||||||
mem.bribe_paid = "\"Now, scram, before I change my mind.\""
|
mem.bribe_paid = "\"Now, scram, before I change my mind.\""
|
||||||
else
|
else
|
||||||
if rnd.int() > 0.5 then
|
if rnd.int() > 0.5 then
|
||||||
|
@ -12,16 +12,14 @@ function create()
|
|||||||
|
|
||||||
-- Deal with bribeability.
|
-- Deal with bribeability.
|
||||||
if rnd.int() < 0.05 then
|
if rnd.int() < 0.05 then
|
||||||
mem.bribe_no = = "\"You won't be able to slide out of this one!\""
|
mem.bribe_no = "\"You won't be able to slide out of this one!\""
|
||||||
else
|
else
|
||||||
mem.bribe = math.sqrt(ai.shipmass()) * (300. * rnd.int() + 850.)
|
mem.bribe = math.sqrt(ai.shipmass()) * (300. * rnd.int() + 850.)
|
||||||
if rnd.int() > 0.5 then
|
if rnd.int() > 0.5 then
|
||||||
mem.bribe_prompt = string.format("\"It'll cost you %d credits for me to ifnore your pile \
|
mem.bribe_prompt = string.format("\"It'll cost you %d credits for me to ifnore your pile of rubbish.\"", mem.bribe)
|
||||||
of rubbish.\"", mem.bribe)
|
|
||||||
mem.bribe_paid = "\"You're lucky I'm so kind.\""
|
mem.bribe_paid = "\"You're lucky I'm so kind.\""
|
||||||
else
|
else
|
||||||
mem.bribe_prompt = string.format("\"I'm in a good mood so I'll let you go for \
|
mem.bribe_prompt = string.format("\"I'm in a good mood so I'll let you go for %d credits.\"", mem.bribe)
|
||||||
%d credits.\"", mem.bribe)
|
|
||||||
mem.bribe_paid = "\"Life doesn't get easier then this.\""
|
mem.bribe_paid = "\"Life doesn't get easier then this.\""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -279,6 +279,7 @@ int main(int argc, char** argv) {
|
|||||||
void loadscreen_load(void) {
|
void loadscreen_load(void) {
|
||||||
int i;
|
int i;
|
||||||
char file_path[PATH_MAX];
|
char file_path[PATH_MAX];
|
||||||
|
char** loadscreens;
|
||||||
char** files;
|
char** files;
|
||||||
uint32_t nfiles;
|
uint32_t nfiles;
|
||||||
size_t len;
|
size_t len;
|
||||||
@ -286,12 +287,15 @@ void loadscreen_load(void) {
|
|||||||
|
|
||||||
/* Count the loading screens. */
|
/* Count the loading screens. */
|
||||||
files = pack_listfiles(data, &nfiles);
|
files = pack_listfiles(data, &nfiles);
|
||||||
len = strlen("../gfx/loading");
|
len = strlen("../gfx/loading/");
|
||||||
nload = 0;
|
nload = 0;
|
||||||
|
loadscreens = malloc(sizeof(char*) * nfiles);
|
||||||
for(i = 0; i < (int)nfiles; i++) {
|
for(i = 0; i < (int)nfiles; i++) {
|
||||||
if(strncmp(files[i], "../gfx/loading", len)==0)
|
if(strncmp(files[i], "../gfx/loading/", len)==0) {
|
||||||
|
loadscreens[nload] = files[i];
|
||||||
nload++;
|
nload++;
|
||||||
free(files[i]);
|
} else
|
||||||
|
free(files[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Must have loading screens. */
|
/* Must have loading screens. */
|
||||||
@ -301,8 +305,13 @@ void loadscreen_load(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Load the texture. */
|
/* Load the texture. */
|
||||||
snprintf(file_path, PATH_MAX, "../gfx/loading%03d.png", RNG(0, nload-1));
|
snprintf(file_path, PATH_MAX, loadscreens[RNG(0, nload-1)]);
|
||||||
loading = gl_newImage(file_path);
|
loading = gl_newImage(file_path);
|
||||||
|
|
||||||
|
/* Clean up. */
|
||||||
|
for(i = 0; i < nload; i++)
|
||||||
|
free(loadscreens[i]);
|
||||||
|
free(loadscreens);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user