Added reload of levels on F7 (Update levelpack) to ease the test of changes.
[enigmagame.git] / src / enigma-lua.pkg
bloba02a31335446f89228f674f9eea4a60aabbe9e56
1 //==================================================  -*- Mode: C++ -*-
2 // Copyright (C) 2002,2003,2004 Daniel Heck
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this program; if not, write to the Free Software Foundation, Inc.,
16 // 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
18 // $Id: enigma-lua.pkg,v 1.25 2004/03/15 20:15:36 dheck Exp $
19 //======================================================================
22 /* -------------------- enigma.cc -------------------- */
24 $#include "server.hh"
25 $#include "world.hh"
26 $#include "lev/PersistentIndex.hh"
28 $using namespace enigma;
29 $using ecl::Surface;
30 $using ecl::Font;
32 module enigma
34     enum Direction {NODIR, NORTH, EAST, SOUTH, WEST};
36     Surface *GetImage(const char *name);
37     Surface *GetImage(const char *name, const char *extension);
38     Surface *LoadImage(const char *name);
39     Surface *RegisterImage(const char *name, Surface *s);
40     Font    *GetFont(const char *name);
42     const char *date(const char *format); // format see 'man strftime'
45 /* -------------------- server.cc, lev/Index.cc -------------------- */
47 $using namespace server;
48 $using namespace lev;
49 module enigma
51     extern int    TwoPlayerGame;
52     extern int    SingleComputerGame;
53     extern int    ConserveLevel;
54     extern int    AllowTogglePlayer;
55     extern int    ShowMoves;
56     extern double Brittleness;
57     extern double SlopeForce;
58     extern double FlatForce;
59     extern double FrictionFactor;
60     extern double ElectricForce;
61     extern double BumperForce;
62     extern double MagnetForce;
63     extern double MagnetRange;
64     extern double WaterSinkSpeed;
65     extern double SwampSinkSpeed;
66     extern double WormholeForce;
67     extern double WormholeRange;
68     extern double HoleForce;
69     extern bool   CreatingPreview;
71     void AddLevelPack (const char *init_file, const char *name);
72     void AddZippedLevelPack (const char *zipfile);
73     void SetCompatibility(const char *version);
76 /* -------------------- world.cc, objects.cc -------------------- */
78 $using namespace enigma;
80 module world
82     class Object;
83     class Floor : public Object {};
84     class Item : public Object {};
85     class Stone : public Object {};
87     Object *MakeObject(const char *kind);
88     Floor *MakeFloor(const char *kind);
89     Item *MakeItem(const char *kind);
90     Stone *MakeStone(const char *kind);
92     Object *GetNamedObject(const char *name);
94     void Resize(int w, int h);
97 /* -------------------- video.cc -------------------- */
99 $#include "video.hh"
100 $using namespace video;
101 $using ecl::Screen;
103 module video
105     Screen *GetScreen();
106     void HideMouse();
107     void ShowMouse();
110 /* -------------------- sound.cc -------------------- */
112 $#include "SoundEffectManager.hh"
113 $using namespace sound;
115 module sound
117     // Note that EmitSound is defined in lua.cc, due to its object reference.
118     void DefineSoundEffect(string table, string name, string filename,
119                            double volume, bool loop, bool global, int priority,
120                            double damp_max, double damp_inc, double damp_mult,
121                            double damp_min, double damp_tick, string silence_string);
122     void SetActiveSoundSet(string table);