[Add] Actually use the new loading graphics.

This commit is contained in:
Allanis 2014-02-02 19:49:56 +00:00
parent 0b65e1c4b9
commit 45333c33d5
4 changed files with 18 additions and 11 deletions

View File

@ -74,6 +74,7 @@ DATA_AI := $(wildcard ../scripts/ai/*.lua \
../scripts/ai/include/*.lua \
../scripts/ai/tpl/*.lua)
DATA_GFX := $(wildcard ../gfx/*.png \
../gfx/loading/*.png \
../gfx/gui/*.png \
../gfx/logo/*.png \
../gfx/outfit/space/*.png \

View File

@ -13,8 +13,7 @@ function create()
if rnd.int() > 0.7 then
mem.bribe = math.sqrt(ai.shipmass())*(500. * rnd.int() + 1750.)
mem.bribe_prompt = string.format("\"For some %d credits I could forget \
about seeing you.\"", mem.bribe)
mem.bribe_prompt = string.format("\"For some %d credits I could forget about seeing you.\"", mem.bribe)
mem.bribe_paid = "\"Now, scram, before I change my mind.\""
else
if rnd.int() > 0.5 then

View File

@ -12,16 +12,14 @@ function create()
-- Deal with bribeability.
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
mem.bribe = math.sqrt(ai.shipmass()) * (300. * rnd.int() + 850.)
if rnd.int() > 0.5 then
mem.bribe_prompt = string.format("\"It'll cost you %d credits for me to ifnore your pile \
of rubbish.\"", mem.bribe)
mem.bribe_prompt = string.format("\"It'll cost you %d credits for me to ifnore your pile of rubbish.\"", mem.bribe)
mem.bribe_paid = "\"You're lucky I'm so kind.\""
else
mem.bribe_prompt = string.format("\"I'm in a good mood so I'll let you go for \
%d credits.\"", mem.bribe)
mem.bribe_prompt = string.format("\"I'm in a good mood so I'll let you go for %d credits.\"", mem.bribe)
mem.bribe_paid = "\"Life doesn't get easier then this.\""
end
end

View File

@ -279,6 +279,7 @@ int main(int argc, char** argv) {
void loadscreen_load(void) {
int i;
char file_path[PATH_MAX];
char** loadscreens;
char** files;
uint32_t nfiles;
size_t len;
@ -286,11 +287,14 @@ void loadscreen_load(void) {
/* Count the loading screens. */
files = pack_listfiles(data, &nfiles);
len = strlen("../gfx/loading");
len = strlen("../gfx/loading/");
nload = 0;
loadscreens = malloc(sizeof(char*) * nfiles);
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++;
} else
free(files[i]);
}
@ -301,8 +305,13 @@ void loadscreen_load(void) {
}
/* 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);
/* Clean up. */
for(i = 0; i < nload; i++)
free(loadscreens[i]);
free(loadscreens);
}
/**