-
Notifications
You must be signed in to change notification settings - Fork 0
/
resource_data.cpp
85 lines (78 loc) · 6.6 KB
/
resource_data.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/********************************************************************************\
** **
** Copyright (C) 2008 Josh Ventura **
** **
** This file is a part of the ENIGMA Development Environment. **
** **
** **
** ENIGMA is free software: you can redistribute it and/or modify it under the **
** terms of the GNU General Public License as published by the Free Software **
** Foundation, version 3 of the license or any later version. **
** **
** This application and its source code is distributed AS-IS, WITHOUT ANY **
** WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS **
** FOR A PARTICULAR PURPOSE. See the GNU General Public License for more **
** details. **
** **
** You should have recieved a copy of the GNU General Public License along **
** with this code. If not, see <http://www.gnu.org/licenses/> **
** **
** ENIGMA is an environment designed to create games and other programs with a **
** high-level, fully compilable language. Developers of ENIGMA or anything **
** associated with ENIGMA are in no way responsible for its users or **
** applications created by its users, or damages caused by the environment **
** or programs made in the environment. **
** **
\********************************************************************************/
#include <map>
#include "Universal_System/var4.h"
#include "resource_data.h"
using namespace std;
static map<string,int> resources;
namespace enigma
{
extern size_t script_idmax;
void map_resource_ids(nameid_pair* n)
{
for (nameid_pair* i = n; i->id != -1; i++)
{
//TODO: IMPLEMENT
}
}
}
namespace enigma_user
{
int resource_get_id(string name)
{
return -1;
}
variant script_execute(int scr, variant arg0, variant arg1, variant arg2, variant arg3, variant arg4, variant arg5, variant arg6, variant arg7, variant arg8, variant arg9, variant arg10, variant arg11, variant arg12, variant arg13, variant arg14, variant arg15)
{
enigma::callable_script &i = enigma::callable_scripts[scr];
switch (i.argnum)
{
case 0: return ((variant(*)())i.base) ();
case 1: return ((variant(*)(variant))i.base) (arg0);
case 2: return ((variant(*)(variant,variant))i.base) (arg0,arg1);
case 3: return ((variant(*)(variant,variant,variant))i.base) (arg0,arg1,arg2);
case 4: return ((variant(*)(variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3);
case 5: return ((variant(*)(variant,variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3,arg4);
case 6: return ((variant(*)(variant,variant,variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3,arg4,arg5);
case 7: return ((variant(*)(variant,variant,variant,variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3,arg4,arg5,arg6);
case 8: return ((variant(*)(variant,variant,variant,variant,variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7);
case 9: return ((variant(*)(variant,variant,variant,variant,variant,variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
case 10: return ((variant(*)(variant,variant,variant,variant,variant,variant,variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
case 11: return ((variant(*)(variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
case 12: return ((variant(*)(variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11);
case 13: return ((variant(*)(variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12);
case 14: return ((variant(*)(variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13);
case 15: return ((variant(*)(variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14);
case 16: return ((variant(*)(variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant,variant))i.base) (arg0,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13,arg14,arg15);
default: return 0;
}
}
bool script_exists(int script)
{
return (script >= 0 && size_t(script) < enigma::script_idmax && bool(enigma::callable_scripts[script].base));
}
}