add_sound, 1.3.5 up

This commit is contained in:
p.kosyh 2011-03-29 10:12:17 +00:00
parent a1b7b10c01
commit fc439d19ce
19 changed files with 101 additions and 26 deletions

View file

@ -1,4 +1,4 @@
VERSION := 1.3.4
VERSION := 1.3.5
PREFIX=./
DESTDIR=

View file

@ -1,6 +1,6 @@
# Contributor: Peter Kosyh <p.kosyhgmail.com>
pkgname=instead
pkgver=1.3.4
pkgver=1.3.5
pkgrel=1
pkgdesc="instead quest interpreter"
arch=('i686' 'x86_64')

View file

@ -1,4 +1,4 @@
VERSION := 1.3.4
VERSION := 1.3.5
DESTDIR=
BIN=

View file

@ -1,4 +1,4 @@
VERSION := 1.3.4
VERSION := 1.3.5
DESTDIR=
BIN=

View file

@ -1,4 +1,4 @@
VERSION := 1.3.4
VERSION := 1.3.5
PREFIX=/usr/local
DESTDIR=

View file

@ -1,4 +1,4 @@
VERSION := 1.3.4
VERSION := 1.3.5
PREFIX=./
DESTDIR=

View file

@ -1,4 +1,4 @@
VERSION := 1.3.4
VERSION := 1.3.5
PREFIX=
DESTDIR=

11
debian/changelog vendored
View file

@ -1,3 +1,14 @@
instead (1.3.5) unstable; urgency=low
* bug fix in imgl/imgr;
* bug fix in xact;
* bug fix in jump to pos logic;
* global dir is now readdir;
* multichannal sound system (add_sound);
* show dir to be deleted while remove game;
-- Peter Kosyh <p.kosyh@gmail.com> Tue, 29 Mar 2011 14:08:00 +0300
instead (1.3.4) unstable; urgency=low
* bug fix in text renderer with italic text;

View file

@ -1,6 +1,6 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.3.4
Version=1.3.5
Type=Application
Name=INSTEAD
Name[ru]=INSTEAD

View file

@ -13,7 +13,7 @@ body { font-family: Verdana, Arial, Helvetica, sans-serif;
</style>
<title>INSTEAD -- interpreter of simple text adventures for Unix and Windows</title>
</head><body bgcolor="#f0f0f0">
<h2>INSTEAD 1.3.4</h2>
<h2>INSTEAD 1.3.5</h2>
<p>INSTEAD -- interpreter of simple text adventures for Unix and Windows.<br>
INSTEAD was designed to interpret the games that are the mix of visual novels, text quests and classical 90'ss quests.</p>

View file

@ -1,4 +1,4 @@
.TH INSTEAD 6 "Version 1.3.4" Instead GAMES
.TH INSTEAD 6 "Version 1.3.5" Instead GAMES
.SH NAME

View file

@ -8,7 +8,7 @@
&EN
; standard SIS file header
#{"INSTEAD"},(0xA0020410),1,3,4
#{"INSTEAD"},(0xA0020410),1,3,5
;Localised Vendor name
%{"Peter Kosyh"}

View file

@ -1,6 +1,6 @@
Summary: simply text adventures/visual novels engine and game
Name: instead
Version: 1.3.4
Version: 1.3.5
Release: 1%{?dist}
License: GPLv2
URL: http://instead.googlecode.com

View file

@ -1,4 +1,4 @@
INSTEAD 1.3.4
INSTEAD 1.3.5
=============
WARNING! For successfull building you must install these development packages (names may vary in your distribution):

View file

@ -1,11 +1,11 @@
[Setup]
AppName=INSTEAD-KIT
AppVerName=INSTEAD 1.3.4
AppVerName=INSTEAD 1.3.5
DefaultDirName={pf}\Pinebrush games\INSTEAD
DefaultGroupName=Pinebrush games
UninstallDisplayIcon={app}\sdl-instead.exe
OutputDir=.
OutputBaseFilename=instead-kit-1.3.4
OutputBaseFilename=instead-kit-1.3.5
AllowNoIcons=true
[Languages]

View file

@ -1,11 +1,11 @@
[Setup]
AppName=INSTEAD
AppVerName=INSTEAD 1.3.4
AppVerName=INSTEAD 1.3.5
DefaultDirName={pf}\Pinebrush games\INSTEAD
DefaultGroupName=Pinebrush games
UninstallDisplayIcon={app}\sdl-instead.exe
OutputDir=.
OutputBaseFilename=instead-1.3.4
OutputBaseFilename=instead-1.3.5
AllowNoIcons=true
[Languages]

View file

@ -1322,6 +1322,8 @@ static int wavs_pos = 0;
static wav_t sound_add(const char *fname)
{
wav_t w;
if (!fname || !*fname)
return NULL;
w = snd_load_wav(dirpath(fname));
if (!w)
return NULL;
@ -1366,9 +1368,51 @@ static void sounds_reload(void)
}
}
static int _play_combined_snd(char *filename, int chan, int loop)
{
char *str;
char *p, *ep;
wav_t w;
p = str = strdup(filename);
if (!str)
return -1;
p = strip(p);
while (*p) {
int c = chan, l = loop;
ep = p + strcspn(p, ";@");
if (*ep == '@') {
*ep = 0; ep ++;
sscanf(ep, "%d,%d", &c, &l);
ep += strcspn(ep, ";");
if (*ep)
ep ++;
} else if (*ep == ';') {
*ep = 0; ep ++;
} else if (*ep) {
goto err;
}
p = strip(p);
w = sound_find(p);
if (!w)
w = sound_add(p);
if (w)
snd_play(w, c, l - 1);
else
snd_halt_chan(c, 500);
p = ep;
}
free(str);
return 0;
err:
free(str);
return -1;
}
void game_sound_player(void)
{
wav_t w;
char *snd;
int chan = -1;
int loop = 1;
@ -1398,13 +1442,8 @@ void game_sound_player(void)
instead_function("instead.set_sound", args); instead_clear();
unix_path(snd);
w = sound_find(snd);
if (!w)
w = sound_add(snd);
_play_combined_snd(snd, chan, loop);
free(snd);
if (!w)
return;
snd_play(w, chan, loop - 1);
}
static char *get_inv(void)

View file

@ -1,7 +1,7 @@
#ifndef S60_H
#define S60_H
#define PATH_MAX 256
#define VERSION "1.3.4"
#define VERSION "1.3.5"
#define DATAPATH "./"
#define STEAD_PATH DATAPATH"stead/"
#define THEMES_PATH DATAPATH"themes/"

View file

@ -1,5 +1,5 @@
stead = {
version = "1.3.4",
version = "1.3.5",
api_version = "1.1.6", -- last version before 1.2.0
table = table,
delim = ',',
@ -2635,6 +2635,31 @@ function get_sound_loop()
return game._sound_loop
end
function stop_sound(chan)
if not tonumber(chan) then
set_sound('@');
return
end
set_sound('@'..tostring(chan));
end
function add_sound(s, chan, loop)
if type(s) ~= 'string' then
return
end
if type(game._sound) == 'string' then
if tonumber(chan) then
s = s..'@'..tostring(chan);
end
if tonumber(loop) then
s = s..','..tostring(loop)
end
set_sound(game._sound..';'..s, get_sound_chan(), get_sound_loop());
else
set_sound(s, chan, loop);
end
end
function set_sound(s, chan, loop)
game._sound = s;
if not tonumber(loop) then