1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

* fixed crashbug on savegame choice when no savegames were available

* removed unneeded files
* bumped up version (0.68a)
* added authors list
This commit is contained in:
Michał W. Urbańczyk 2009-01-24 22:17:49 +00:00
parent 49b5b47976
commit 302b5d9427
8 changed files with 49 additions and 177 deletions

29
AUTHORS
View File

@ -0,0 +1,29 @@
VCMI PROJECT CODE CONTRIBUTORS:
Micha³ Urbañczyk aka Tow, <impono@gmail.com>
* project originator; programming, making releases, website
maintenance, reverse engineering, general support.
Tow dragon, <matcio1@gmail.com>
* general suport, battle support, support for many Heroes 3 config files
Stefan Pavlov aka Ste, <mailste@gmail.com>
* minor fixes in pregame
Yifeng Sun aka phoebus118, <pkusunyifeng@gmail.com>
* a part of .snd handling, minor fixes and updates
Andrea Palmate aka afxgroup, <andrea@amigasoft.net>
* GCC/AmigaOS4 compatibility updates and makefile
Vadim Glazunov aka neweagle, <neweagle@gmail.com>
* minor GCC/Linux compatibility changes
Rafal R. aka ambtrip, <ambtrip@wp.pl>
* GeniusAI (battles)
Lukasz Wychrystenko aka tezeriusz, <t0@czlug.icis.pcz.pl>
* minor GCC/Linux compatibility changes, code review
Xiaomin Ding <dingding303@gmail.com>
* smack videos player

View File

@ -1,129 +0,0 @@
#include "stdafx.h"
#ifndef _MSC_VER
extern "C" {
#endif
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
#ifndef _MSC_VER
}
#endif
//#include <luabind/luabind.hpp>
//#include <luabind/function.hpp>
//#include <luabind/class.hpp>
#include "CLuaHandler.h"
#include "boost/filesystem.hpp"
#include <boost/algorithm/string.hpp>
void piszpowitanie2(std::string i) //simple global function for testing
{
std::cout<<"powitanie2zc++. Liczba dnia to " << i;
}
CLuaHandler::CLuaHandler()
{
}
CLuaHandler::~CLuaHandler()
{
}
void CLuaHandler::test()
{
//int iErr = 0;
//lua_State *lua = lua_open (); // Open Lua
//LUA_OPEN_LIB(lua, luaopen_base);
//LUA_OPEN_LIB(lua, luaopen_io);
//if ((iErr = luaL_loadfile (lua, "scripts/lua/objects/0023_marletto_tower.lua")) == 0)
//{
// // Call main...
// if ((iErr = lua_pcall (lua, 0, LUA_MULTRET, 0)) == 0)
// {
// lua_pushstring (lua, "rightText");
// lua_gettable (lua, LUA_GLOBALSINDEX);
// lua_pcall (lua, 0, 0, 0);
// }
//}
//lua_close (lua);
}
std::vector<std::string> * CLuaHandler::searchForScripts(std::string fol)
{
std::vector<std::string> * ret = new std::vector<std::string> ();
boost::filesystem::path folder(fol);
if (!boost::filesystem::exists(folder))
#ifndef __GNUC__
throw new std::exception("No such folder!");
#else
throw new std::exception();
#endif
boost::filesystem::directory_iterator end_itr;
for
(
boost::filesystem::directory_iterator it(folder);
it!=end_itr;
it++
)
{
if(boost::algorithm::ends_with((it->path().leaf()),".lua"))
{
ret->push_back(fol+"/"+(it->path().leaf()));
}
}
return ret;
}
std::vector<std::string> * CLuaHandler::functionList(std::string file)
{
std::vector<std::string> * ret = new std::vector<std::string> ();
char linia[500];
std::ifstream is(file.c_str());
while (!is.eof())
{
is.getline(linia,500);
std::string ss(linia);
boost::algorithm::trim_left(ss);
if (boost::algorithm::starts_with(ss,"local"))
boost::algorithm::erase_first(ss,"local ");
if (boost::algorithm::starts_with(ss,"function"))
{
boost::algorithm::erase_first(ss,"function ");
int ps = ss.find_first_of(' ');
int op = ss.find_first_of('(');
if (ps<0)
ps = ss.length()-1;
if (op<0)
op = ss.length()-1;
ps = std::min(ps,op);
ret->push_back(ss.substr(0,ps));
}
}
is.close();
return ret;
}

View File

@ -1,24 +0,0 @@
#ifndef __CLUAHANDLER_H__
#define __CLUAHANDLER_H__
#include "global.h"
#if (LUA_VERSION_NUM < 500)
# define LUA_OPEN_LIB(L, lib) lib(L)
#else
# define LUA_OPEN_LIB(L, lib) \
lua_pushcfunction((L), lib); \
lua_pcall((L), 0, 0, 0);
#endif
class CLuaHandler
{
public:
CLuaHandler();
static std::vector<std::string> * searchForScripts(std::string fol);
static std::vector<std::string> * functionList(std::string file);
~CLuaHandler();
void test();
};
#endif // __CLUAHANDLER_H__

View File

@ -24,7 +24,6 @@
#include "CGameState.h"
#include "CCallback.h"
#include "CPlayerInterface.h"
#include "CLuaHandler.h"
#include "CAdvmapInterface.h"
#include "hch/CBuildingHandler.h"
#include "hch/CVideoHandler.h"

View File

@ -835,22 +835,23 @@ int MapSel::countWL()
}
void MapSel::printMaps(int from, int to, int at, bool abs)
{
if (true)//
if(slid->positionsAmnt < slid->capacity)
from = 0;
int help=-1;
for (size_t i=0; i < curVector().size(); ++i)
{
int help=-1;
for (size_t i=0; i < curVector().size(); ++i)
if (sizeFilter && ((curVector()[i].width) != sizeFilter))
{
if (sizeFilter && ((curVector()[i].width) != sizeFilter)) {
continue;
}
else {
help++;
}
if (help==from)
{
from=i;
break;
}
continue;
}
else
{
help++;
}
if (help==from)
{
from=i;
break;
}
}
SDL_Surface * scenin = CSDL_Ext::newSurface(351,25);

View File

@ -326,10 +326,6 @@
RelativePath=".\Client.cpp"
>
</File>
<File
RelativePath="..\CLuaHandler.cpp"
>
</File>
<File
RelativePath="..\CMessage.cpp"
>
@ -468,10 +464,6 @@
RelativePath=".\Client.h"
>
</File>
<File
RelativePath="..\CLuaHandler.h"
>
</File>
<File
RelativePath="..\CMessage.h"
>
@ -557,6 +549,10 @@
RelativePath="..\ChangeLog"
>
</File>
<File
RelativePath="C:\Documents and Settings\Micha³\Moje dokumenty\net.txt"
>
</File>
</Files>
<Globals>
</Globals>

View File

@ -19,7 +19,7 @@ typedef boost::int8_t si8; //signed int 8 bits (1 byte)
#define THC
#endif
#define NAME_VER ("VCMI 0.65")
#define NAME_VER ("VCMI 0.68a")
#define CONSOLE_LOGGING_LEVEL 5
#define FILE_LOGGING_LEVEL 6

Binary file not shown.