Skip to content
Snippets Groups Projects
Commit 4942e9f9 authored by Sal's avatar Sal
Browse files

Initial commit

parents
Branches
No related tags found
No related merge requests found
File added
File added
{
"name": "example",
"realname": "Example_Skin",
"gfx_prefix": "EXMP",
"stats": [5, 5],
"startcolor": 160,
"prefcolor": "red",
"transparent_colors": [
115, 115, 255,
82, 82, 255
],
"sprites_comment": "ANYTHING BELOW THIS LINE DOES NOT NEED ALTERED UNLESS YOU'RE CHANGING THE TEMPLATE LAYOUT",
"sprite_size": [80, 80],
"sprites": {
"A1": {
"offset": [40, 71],
"layers": [[0, 0], [0, 320]]
},
"A2A8": {
"offset": [40, 71],
"layers": [[80, 0], [80, 320]]
},
"A3A7": {
"offset": [40, 71],
"layers": [[160, 0], [160, 320]]
},
"A4A6": {
"offset": [40, 71],
"layers": [[240, 0], [240, 320]]
},
"A5": {
"offset": [40, 71],
"layers": [[320, 0], [320, 320]]
},
"B1": {
"offset": [40, 71],
"layers": [[0, 0], [0, 320]],
"vibrate": true
},
"B2B8": {
"offset": [40, 71],
"layers": [[80, 0], [80, 320]],
"vibrate": true
},
"B3B7": {
"offset": [40, 71],
"layers": [[160, 0], [160, 320]],
"vibrate": true
},
"B4B6": {
"offset": [40, 71],
"layers": [[240, 0], [240, 320]],
"vibrate": true
},
"B5": {
"offset": [40, 71],
"layers": [[320, 0], [320, 320]],
"vibrate": true
},
"C1": {
"offset": [40, 71],
"layers": [[0, 0], [0, 320]]
},
"C2C8": {
"offset": [40, 71],
"layers": [[80, 0], [80, 320]]
},
"C3C7": {
"offset": [40, 71],
"layers": [[160, 0], [160, 320]]
},
"C4C6": {
"offset": [40, 71],
"layers": [[240, 0], [240, 320]]
},
"C5": {
"offset": [40, 71],
"layers": [[400, 0], [400, 320]]
},
"D1": {
"offset": [40, 71],
"layers": [[0, 0], [0, 320]],
"vibrate": true
},
"D2D8": {
"offset": [40, 71],
"layers": [[80, 0], [80, 320]],
"vibrate": true
},
"D3D7": {
"offset": [40, 71],
"layers": [[160, 0], [160, 320]],
"vibrate": true
},
"D4D6": {
"offset": [40, 71],
"layers": [[240, 0], [240, 320]],
"vibrate": true
},
"D5": {
"offset": [40, 71],
"layers": [[400, 0], [400, 320]],
"vibrate": true
},
"E1": {
"offset": [40, 71],
"layers": [[0, 0], [0, 320]]
},
"E2E8": {
"offset": [40, 71],
"layers": [[80, 0], [80, 320]]
},
"E3E7": {
"offset": [40, 71],
"layers": [[160, 0], [160, 320]]
},
"E4E6": {
"offset": [40, 71],
"layers": [[240, 0], [240, 320]]
},
"E5": {
"offset": [40, 71],
"layers": [[480, 0], [480, 320]],
"flip": true
},
"F1": {
"offset": [40, 71],
"layers": [[0, 0], [0, 320]],
"vibrate": true
},
"F2F8": {
"offset": [40, 71],
"layers": [[80, 0], [80, 320]],
"vibrate": true
},
"F3F7": {
"offset": [40, 71],
"layers": [[160, 0], [160, 320]],
"vibrate": true
},
"F4F6": {
"offset": [40, 71],
"layers": [[240, 0], [240, 320]],
"vibrate": true
},
"F5": {
"offset": [40, 71],
"layers": [[480, 0], [480, 320]],
"flip": true,
"vibrate": true
},
"G1": {
"offset": [40, 72],
"layers": [[0, 0], [0, 320]]
},
"G2G8": {
"offset": [40, 72],
"layers": [[80, 0], [80, 320]]
},
"G3G7": {
"offset": [40, 72],
"layers": [[160, 0], [160, 320]]
},
"G4G6": {
"offset": [40, 72],
"layers": [[240, 0], [240, 320]]
},
"G5": {
"offset": [40, 72],
"layers": [[320, 0], [320, 320]]
},
"H1": {
"offset": [40, 72],
"layers": [[0, 0], [0, 320]]
},
"H2H8": {
"offset": [40, 72],
"layers": [[80, 0], [80, 320]]
},
"H3H7": {
"offset": [40, 72],
"layers": [[160, 0], [160, 320]]
},
"H4H6": {
"offset": [40, 72],
"layers": [[240, 0], [240, 320]]
},
"H5": {
"offset": [40, 72],
"layers": [[400, 0], [400, 320]]
},
"I1": {
"offset": [40, 72],
"layers": [[0, 0], [0, 320]]
},
"I2I8": {
"offset": [40, 72],
"layers": [[80, 0], [80, 320]]
},
"I3I7": {
"offset": [40, 72],
"layers": [[160, 0], [160, 320]]
},
"I4I6": {
"offset": [40, 72],
"layers": [[240, 0], [240, 320]]
},
"I5": {
"offset": [40, 72],
"layers": [[480, 0], [480, 320]],
"flip": true
},
"J1": {
"offset": [40, 71],
"layers": [[0, 0], [0, 400]]
},
"J2J8": {
"offset": [40, 71],
"layers": [[80, 0], [80, 400]]
},
"J3J7": {
"offset": [40, 71],
"layers": [[160, 0], [160, 400]]
},
"J4J6": {
"offset": [40, 71],
"layers": [[240, 0], [240, 400]]
},
"J5": {
"offset": [40, 71],
"layers": [[320, 0], [320, 400]]
},
"K1": {
"offset": [40, 71],
"layers": [[0, 0], [0, 400]]
},
"K2K8": {
"offset": [40, 71],
"layers": [[80, 0], [80, 400]]
},
"K3K7": {
"offset": [40, 71],
"layers": [[160, 0], [160, 400]]
},
"K4K6": {
"offset": [40, 71],
"layers": [[240, 0], [240, 400]]
},
"K5": {
"offset": [40, 71],
"layers": [[400, 0], [400, 400]]
},
"L1": {
"offset": [40, 71],
"layers": [[0, 0], [0, 400]]
},
"L2L8": {
"offset": [40, 71],
"layers": [[80, 0], [80, 400]]
},
"L3L7": {
"offset": [40, 71],
"layers": [[160, 0], [160, 400]]
},
"L4L6": {
"offset": [40, 71],
"layers": [[240, 0], [240, 400]]
},
"L5": {
"offset": [40, 71],
"layers": [[480, 0], [480, 400]],
"flip": true
},
"M1O1": {
"offset": [39, 71],
"layers": [[0, 80], [640, 320]]
},
"M2O8": {
"offset": [39, 71],
"layers": [[80, 80], [0, 320]]
},
"M3O7": {
"offset": [39, 71],
"layers": [[160, 80], [80, 320]]
},
"M4O6": {
"offset": [39, 71],
"layers": [[240, 80], [160, 320]]
},
"M5O5": {
"offset": [39, 71],
"layers": [[320, 80], [240, 320]]
},
"M6O4": {
"offset": [39, 71],
"layers": [[400, 80], [320, 320]]
},
"M7O3": {
"offset": [39, 71],
"layers": [[480, 80], [480, 320]]
},
"M8O2": {
"offset": [39, 71],
"layers": [[560, 80], [560, 320]]
},
"N1P1": {
"offset": [41, 71],
"layers": [[0, 80], [640, 400]]
},
"N2P8": {
"offset": [41, 71],
"layers": [[80, 80], [0, 400]]
},
"N3P7": {
"offset": [41, 71],
"layers": [[160, 80], [80, 400]]
},
"N4P6": {
"offset": [41, 71],
"layers": [[240, 80], [160, 400]]
},
"N5P5": {
"offset": [41, 71],
"layers": [[320, 80], [240, 400]]
},
"N6P4": {
"offset": [41, 71],
"layers": [[400, 80], [320, 400]]
},
"N7P3": {
"offset": [41, 71],
"layers": [[480, 80], [480, 400]]
},
"N8P2": {
"offset": [41, 71],
"layers": [[560, 80], [560, 400]]
},
"Q1": {
"offset": [40, 71],
"layers": [[0, 160], [0, 320]]
},
"Q2Q8": {
"offset": [40, 71],
"layers": [[80, 160], [80, 320]]
},
"Q3Q7": {
"offset": [40, 71],
"layers": [[160, 160], [160, 320]]
},
"Q4Q6": {
"offset": [40, 71],
"layers": [[240, 160], [240, 320]]
},
"Q5": {
"offset": [40, 71],
"layers": [[320, 160], [320, 320]]
},
"R1": {
"heightfactor": 4,
"offset": [40, 17],
"layers": [[0, 0], [0, 320]]
},
"R2R8": {
"heightfactor": 4,
"offset": [40, 17],
"layers": [[80, 0], [80, 320]]
},
"R3R7": {
"heightfactor": 4,
"offset": [40, 17],
"layers": [[160, 0], [160, 320]]
},
"R4R6": {
"heightfactor": 4,
"offset": [40, 17],
"layers": [[240, 0], [240, 320]]
},
"R5": {
"heightfactor": 4,
"offset": [40, 17],
"layers": [[320, 0], [320, 320]]
},
"S0": {
"offset": [40, 71],
"layers": [[480, 0]]
}
},
"gfx": {
"RANK": [492, 162, 16, 16, 0, 0],
"WANT": [402, 162, 32, 32, 0, 0],
"MMAP": [582, 162, 12, 12, 0, 0]
},
"sfx": {
"GL": "/gloat.ogg",
"WI": "/win.ogg",
"LS": "/lose.ogg",
"SL": "/slow.ogg",
"H1": "/hurt1.ogg",
"H2": "/hurt2.ogg",
"A1": "/attack1.ogg",
"A2": "/attack2.ogg",
"B1": "/boost1.ogg",
"B2": "/boost2.ogg",
"HT": "/hitconfirm.ogg"
}
}
\ No newline at end of file
File added
KC_example/sprites.png

39.2 KiB

File added
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program 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; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but 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 received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
File added
cd src
gcc lump.c lodepng.c main.c cJSON.c -o kartmaker -lm
cd ..
copy src\kartmaker.exe .\kartmaker.exe
\ No newline at end of file
Kartmaker, by fickleheart
HOW TO USE:
- Copy one of the KC_example/ folders and rename it (your WAD will be named after this folder)
- Edit the top of "properties.txt" to set various kart stats for your racer, and adjust the RGB colors that the
converter considers transparent pixels if you want
- Create or paste your racer's sprites into the template provided (if you're pasting, make sure to erase the wheel
shine from the sprites so that the converter can apply the proper shine for each frame!)
- Replace the sound files in the folder with OGG sounds that you want your racer to have (this program does not convert
or add echo for you)
- Drag the folder onto kartmaker.exe, or run kartmaker.exe and pass the folder as an argument
- The WAD will be placed next to your character's source folder, ready to play
Ignore build.bat and the src/ folder for standard use. This is a compile script and source files. You can use it if you
want to modify the program (you need GCC installed). I make no guarantees that the program compiles on other setups.
Licensed under the GPL.
\ No newline at end of file
This diff is collapsed.
/*
Copyright (c) 2009 Dave Gamble
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef cJSON__h
#define cJSON__h
#ifdef __cplusplus
extern "C"
{
#endif
/* cJSON Types: */
#define cJSON_False 0
#define cJSON_True 1
#define cJSON_NULL 2
#define cJSON_Number 3
#define cJSON_String 4
#define cJSON_Array 5
#define cJSON_Object 6
#define cJSON_IsReference 256
#define cJSON_StringIsConst 512
/* The cJSON structure: */
typedef struct cJSON {
struct cJSON *next,*prev; /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */
struct cJSON *child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */
int type; /* The type of the item, as above. */
char *valuestring; /* The item's string, if type==cJSON_String */
int valueint; /* The item's number, if type==cJSON_Number */
double valuedouble; /* The item's number, if type==cJSON_Number */
char *string; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */
} cJSON;
typedef struct cJSON_Hooks {
void *(*malloc_fn)(size_t sz);
void (*free_fn)(void *ptr);
} cJSON_Hooks;
/* Supply malloc, realloc and free functions to cJSON */
extern void cJSON_InitHooks(cJSON_Hooks* hooks);
/* Supply a block of JSON, and this returns a cJSON object you can interrogate. Call cJSON_Delete when finished. */
extern cJSON *cJSON_Parse(const char *value);
/* Render a cJSON entity to text for transfer/storage. Free the char* when finished. */
extern char *cJSON_Print(cJSON *item);
/* Render a cJSON entity to text for transfer/storage without any formatting. Free the char* when finished. */
extern char *cJSON_PrintUnformatted(cJSON *item);
/* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */
extern char *cJSON_PrintBuffered(cJSON *item,int prebuffer,int fmt);
/* Delete a cJSON entity and all subentities. */
extern void cJSON_Delete(cJSON *c);
/* Returns the number of items in an array (or object). */
extern int cJSON_GetArraySize(cJSON *array);
/* Retrieve item number "item" from array "array". Returns NULL if unsuccessful. */
extern cJSON *cJSON_GetArrayItem(cJSON *array,int item);
/* Get item "string" from object. Case insensitive. */
extern cJSON *cJSON_GetObjectItem(cJSON *object,const char *string);
/* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */
extern const char *cJSON_GetErrorPtr(void);
/* These calls create a cJSON item of the appropriate type. */
extern cJSON *cJSON_CreateNull(void);
extern cJSON *cJSON_CreateTrue(void);
extern cJSON *cJSON_CreateFalse(void);
extern cJSON *cJSON_CreateBool(int b);
extern cJSON *cJSON_CreateNumber(double num);
extern cJSON *cJSON_CreateString(const char *string);
extern cJSON *cJSON_CreateArray(void);
extern cJSON *cJSON_CreateObject(void);
/* These utilities create an Array of count items. */
extern cJSON *cJSON_CreateIntArray(const int *numbers,int count);
extern cJSON *cJSON_CreateFloatArray(const float *numbers,int count);
extern cJSON *cJSON_CreateDoubleArray(const double *numbers,int count);
extern cJSON *cJSON_CreateStringArray(const char **strings,int count);
/* Append item to the specified array/object. */
extern void cJSON_AddItemToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemToObject(cJSON *object,const char *string,cJSON *item);
extern void cJSON_AddItemToObjectCS(cJSON *object,const char *string,cJSON *item); /* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object */
/* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */
extern void cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item);
extern void cJSON_AddItemReferenceToObject(cJSON *object,const char *string,cJSON *item);
/* Remove/Detatch items from Arrays/Objects. */
extern cJSON *cJSON_DetachItemFromArray(cJSON *array,int which);
extern void cJSON_DeleteItemFromArray(cJSON *array,int which);
extern cJSON *cJSON_DetachItemFromObject(cJSON *object,const char *string);
extern void cJSON_DeleteItemFromObject(cJSON *object,const char *string);
/* Update array items. */
extern void cJSON_InsertItemInArray(cJSON *array,int which,cJSON *newitem); /* Shifts pre-existing items to the right. */
extern void cJSON_ReplaceItemInArray(cJSON *array,int which,cJSON *newitem);
extern void cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem);
/* Duplicate a cJSON item */
extern cJSON *cJSON_Duplicate(cJSON *item,int recurse);
/* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will
need to be released. With recurse!=0, it will duplicate any children connected to the item.
The item->next and ->prev pointers are always zero on return from Duplicate. */
/* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */
extern cJSON *cJSON_ParseWithOpts(const char *value,const char **return_parse_end,int require_null_terminated);
extern void cJSON_Minify(char *json);
/* Macros for creating things quickly. */
#define cJSON_AddNullToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateNull())
#define cJSON_AddTrueToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateTrue())
#define cJSON_AddFalseToObject(object,name) cJSON_AddItemToObject(object, name, cJSON_CreateFalse())
#define cJSON_AddBoolToObject(object,name,b) cJSON_AddItemToObject(object, name, cJSON_CreateBool(b))
#define cJSON_AddNumberToObject(object,name,n) cJSON_AddItemToObject(object, name, cJSON_CreateNumber(n))
#define cJSON_AddStringToObject(object,name,s) cJSON_AddItemToObject(object, name, cJSON_CreateString(s))
/* When assigning an integer value, it needs to be propagated to valuedouble too. */
#define cJSON_SetIntValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val))
#define cJSON_SetNumberValue(object,val) ((object)?(object)->valueint=(object)->valuedouble=(val):(val))
#ifdef __cplusplus
}
#endif
#endif
This diff is collapsed.
This diff is collapsed.
/*
LumpMod v0.2.1, a command-line utility for working with lumps in wad
files.
Copyright (C) 2003 Thunder Palace Entertainment.
This program 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; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but 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 received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
lump.c: Provides functions for dealing with lumps
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "lump.h"
/* Read contents of a wad file and store them in memory.
* fpoint is the file to read, opened with "rb" mode.
* A pointer to a new wadfile struct will be returned, or NULL on error.
*/
struct wadfile *read_wadfile(FILE *fpoint) {
struct wadfile *wfptr;
struct lumplist *curlump;
long diroffset, filelen;
unsigned long count;
/* Allocate memory for wadfile struct */
wfptr = malloc(sizeof(struct wadfile));
if(wfptr == NULL) return NULL;
/* Read first four characters (PWAD or IWAD) */
if(fread(wfptr->id, 4, 1, fpoint) < 1) {
free(wfptr);
return NULL;
}
/* Read number of lumps */
if(fread(&(wfptr->numlumps), 4, 1, fpoint) < 1) {
free(wfptr);
return NULL;
}
/* If number of lumps is zero, nothing more needs to be done */
if(wfptr->numlumps == 0) {
wfptr->head = NULL;
return wfptr;
}
/* Read offset of directory */
if(fread(&diroffset, 4, 1, fpoint) < 1) {
free(wfptr);
return NULL;
}
/* Verify that the directory as long as it needs to be */
fseek(fpoint, 0, SEEK_END);
filelen = ftell(fpoint);
if((filelen - diroffset) / DIRENTRYLEN < wfptr->numlumps) {
free(wfptr);
return NULL;
}
/* Allocate memory for head lumplist item and set head pointer */
curlump = malloc(sizeof(struct lumplist));
if(curlump == NULL) {
free(wfptr);
return NULL;
}
wfptr->head = curlump;
curlump->cl = NULL;
/* Read directory entries and lumps */
for(count = 0; count < wfptr->numlumps; count++) {
long lumpdataoffset;
/* Advance to a new list item */
curlump->next = malloc(sizeof(struct lumplist));
if(curlump->next == NULL) {
free_wadfile(wfptr);
return NULL;
}
curlump = curlump->next;
curlump->next = NULL;
/* Allocate memory for the lump info */
curlump->cl = malloc(sizeof(struct lump));
if(curlump->cl == NULL) {
free_wadfile(wfptr);
return NULL;
}
/* Seek to the proper position in the file */
if(fseek(fpoint, diroffset + (count * DIRENTRYLEN), SEEK_SET) != 0) {
free_wadfile(wfptr);
return NULL;
}
/* Read offset of lump data */
if(fread(&lumpdataoffset, 4, 1, fpoint) < 1) {
free_wadfile(wfptr);
return NULL;
}
/* Read size of lump in bytes */
if(fread(&(curlump->cl->len), 4, 1, fpoint) < 1) {
free_wadfile(wfptr);
return NULL;
}
/* Read lump name */
if(fread(curlump->cl->name, 8, 1, fpoint) < 1) {
free_wadfile(wfptr);
return NULL;
}
/* Read actual lump data, unless lump size is 0 */
if(curlump->cl->len > 0) {
if(fseek(fpoint, lumpdataoffset, SEEK_SET) != 0) {
free_wadfile(wfptr);
return NULL;
}
/* Allocate memory for data */
curlump->cl->data = malloc(curlump->cl->len);
if(curlump->cl->data == NULL) {
free_wadfile(wfptr);
return NULL;
}
/* Fill the data buffer */
if(fread(curlump->cl->data, curlump->cl->len, 1, fpoint) < 1) {
free_wadfile(wfptr);
return NULL;
}
} else curlump->cl->data = NULL;
} /* End of directory reading loop */
return wfptr;
}
/* Free a wadfile from memory as well as all related structures.
*/
void free_wadfile(struct wadfile *wfptr) {
struct lumplist *curlump, *nextlump;
if(wfptr == NULL) return;
curlump = wfptr->head;
/* Free items in the lump list */
while(curlump != NULL) {
/* Free the actual lump and its data, if necessary */
if(curlump->cl != NULL) {
if(curlump->cl->data != NULL) free(curlump->cl->data);
free(curlump->cl);
}
/* Advance to next lump and free this one */
nextlump = curlump->next;
free(curlump);
curlump = nextlump;
}
free(wfptr);
}
/* Write complete wadfile to a file stream, opened with "wb" mode.
* fpoint is the stream to write to.
* wfptr is a pointer to the wadfile structure to use.
* Return zero on success, nonzero on failure.
*/
int write_wadfile(FILE *fpoint, struct wadfile *wfptr) {
struct lumplist *curlump;
long lumpdataoffset, diroffset;
if(wfptr == NULL) return 1;
/* Write four-character ID ("PWAD" or "IWAD") */
if(fwrite(wfptr->id, 4, 1, fpoint) < 1) return 2;
/* Write number of lumps */
if(fwrite(&(wfptr->numlumps), 4, 1, fpoint) < 1) return 3;
/* Offset of directory is not known yet. For now, write number of lumps
* again, just to fill the space.
*/
if(fwrite(&(wfptr->numlumps), 4, 1, fpoint) < 1) return 4;
/* Loop through lump list, writing lump data */
for(curlump = wfptr->head; curlump != NULL; curlump = curlump->next) {
/* Don't write anything for the head of the lump list or for lumps of
zero length */
if(curlump->cl == NULL || curlump->cl->data == NULL) continue;
/* Write the data */
if(fwrite(curlump->cl->data, curlump->cl->len, 1, fpoint) < 1)
return 5;
}
/* Current position is where directory will start */
diroffset = ftell(fpoint);
/* Offset for the first lump's data is always 12 */
lumpdataoffset = 12;
/* Loop through lump list again, this time writing directory entries */
for(curlump = wfptr->head; curlump != NULL; curlump = curlump->next) {
/* Don't write anything for the head of the lump list */
if(curlump->cl == NULL) continue;
/* Write offset for lump data */
if(fwrite(&lumpdataoffset, 4, 1, fpoint) < 1) return 6;
/* Write size of lump data */
if(fwrite(&(curlump->cl->len), 4, 1, fpoint) < 1) return 7;
/* Write lump name */
if(fwrite(curlump->cl->name, 8, 1, fpoint) < 1) return 8;
/* Increment lumpdataoffset variable as appropriate */
lumpdataoffset += curlump->cl->len;
}
/* Go back to header and write the proper directory offset */
fseek(fpoint, 8, SEEK_SET);
if(fwrite(&diroffset, 4, 1, fpoint) < 1) return 9;
return 0;
}
/* Get the name of a lump, as a null-terminated string.
* item is a pointer to the lump (not lumplist) whose name will be obtained.
* Return NULL on error.
*/
char *get_lump_name(struct lump *item) {
char convname[9], *retname;
if(item == NULL) return NULL;
memcpy(convname, item->name, 8);
convname[8] = '\0';
retname = malloc(strlen(convname) + 1);
if(retname != NULL) strcpy(retname, convname);
return retname;
}
/* Find the lump after start and before end having a certain name.
* Return a pointer to the list item for that lump, or return NULL if no lump
* by that name is found or lumpname is too long.
* lumpname is a null-terminated string.
* If end parameter is NULL, search to the end of the entire list.
*/
struct lumplist *find_previous_lump(struct lumplist *start, struct lumplist
*end, char *lumpname) {
struct lumplist *curlump, *lastlump;
char *curname;
int found = 0;
/* Verify that parameters are valid */
if(start==NULL || start==end || lumpname==NULL || strlen(lumpname) > 8)
return NULL;
/* Loop through the list from start parameter */
lastlump = start;
for(curlump = start->next; curlump != end && curlump != NULL;
curlump = curlump->next) {
/* Skip header lump */
if(curlump->cl == NULL) continue;
/* Find name of this lump */
curname = get_lump_name(curlump->cl);
if(curname == NULL) continue;
/* Compare names to see if this is the lump we want */
if(strcmp(curname, lumpname) == 0) {
found = 1;
break;
}
/* Free memory allocated to curname */
free(curname);
lastlump = curlump;
}
if(found) return lastlump;
return NULL;
}
/* Remove a lump from the list, free it, and free its data.
* before is the lump immediately preceding the lump to be removed.
* wfptr is a pointer to the wadfile structure to which the removed lump
* belongs, so that numlumps can be decreased.
*/
void remove_next_lump(struct wadfile *wfptr, struct lumplist *before) {
struct lumplist *removed;
/* Verify that parameters are valid */
if(before == NULL || before->next == NULL || wfptr == NULL) return;
/* Update linked list to omit removed lump */
removed = before->next;
before->next = removed->next;
/* Free lump info and data if necessary */
if(removed->cl != NULL) {
if(removed->cl->data != NULL) free(removed->cl->data);
free(removed->cl);
}
free(removed);
/* Decrement numlumps */
wfptr->numlumps--;
}
/* Add a lump.
* The lump will follow prev in the list and be named name, with a data size
* of len.
* A copy will be made of the data.
* Return zero on success or nonzero on failure.
*/
int add_lump(struct wadfile *wfptr, struct lumplist *prev, char *name, long
len, unsigned char *data) {
struct lump *newlump;
struct lumplist *newlumplist;
unsigned char *copydata;
/* Verify that parameters are valid */
if(wfptr == NULL || name == NULL || strlen(name) > 8)
return 1;
/* Allocate space for newlump and newlumplist */
newlump = malloc(sizeof(struct lump));
newlumplist = malloc(sizeof(struct lumplist));
if(newlump == NULL || newlumplist == NULL) return 2;
/* Copy lump data and set up newlump */
if(len == 0 || data == NULL) {
newlump->len = 0;
newlump->data = NULL;
} else {
newlump->len = len;
copydata = malloc(len);
if(copydata == NULL) return 3;
memcpy(copydata, data, len);
newlump->data = copydata;
}
/* Set name of newlump */
memset(newlump->name, '\0', 8);
if(strlen(name) == 8) memcpy(newlump->name, name, 8);
else strcpy(newlump->name, name);
/* Set up newlumplist and alter prev appropriately */
newlumplist->cl = newlump;
if (prev == NULL) {
// Add lump to beginning of file
newlumplist->next = wfptr->head;
wfptr->head = newlumplist;
} else {
// Add lump after previous
newlumplist->next = prev->next;
prev->next = newlumplist;
}
/* Increment numlumps */
wfptr->numlumps++;
return 0;
}
/* Rename a lump.
* renamed is a pointer to the lump (not lumplist) that needs renaming.
* newname is a null-terminated string with the new name.
* Return zero on success or nonzero on failure.
*/
int rename_lump(struct lump *renamed, char *newname) {
/* Verify that parameters are valid. */
if(newname == NULL || renamed == NULL || strlen(newname) > 8) return 1;
/* Do the renaming. */
memset(renamed->name, '\0', 8);
if(strlen(newname) == 8) memcpy(renamed->name, newname, 8);
else strcpy(renamed->name, newname);
return 0;
}
/* Find the last lump in a wadfile structure.
* Return this lump or NULL on failure.
*/
struct lumplist *find_last_lump(struct wadfile *wfptr) {
struct lumplist *curlump;
if(wfptr == NULL || wfptr->head == NULL) return NULL;
curlump = wfptr->head;
while(curlump->next != NULL) curlump = curlump->next;
return curlump;
}
/* Find the last lump between start and end.
* Return this lump or NULL on failure.
*/
struct lumplist *find_last_lump_between(struct lumplist *start, struct
lumplist *end) {
struct lumplist *curlump;
if(start == NULL) return NULL;
curlump = start;
while(curlump->next != end) {
curlump = curlump->next;
if(curlump == NULL) break;
}
return curlump;
}
/* Find the next section lump. A section lump is MAPxx (0 <= x <= 9), ExMy
* (0 <= x <= 9, 0 <= y <= 9), or any lump whose name ends in _START or _END.
* Return NULL if there are no section lumps after start.
*/
struct lumplist *find_next_section_lump(struct lumplist *start) {
struct lumplist *curlump, *found = NULL;
char *curname;
/* Verify that parameter is valid */
if(start == NULL || start->next == NULL) return NULL;
/* Loop through the list from start parameter */
for(curlump = start->next; curlump != NULL && found == NULL;
curlump = curlump->next) {
/* Skip header lump */
if(curlump->cl == NULL) continue;
/* Find name of this lump */
curname = get_lump_name(curlump->cl);
if(curname == NULL) continue;
/* Check to see if this is a section lump */
if(strlen(curname) == 5 && strncmp("MAP", curname, 3) == 0 &&
isdigit(curname[3]) && isdigit(curname[4]))
found = curlump;
else if(strlen(curname) == 4 && curname[0] == 'E' && curname[2] ==
'M' && isdigit(curname[1]) && isdigit(curname[3]))
found = curlump;
else if(strlen(curname) == 7 && strcmp("_START", &curname[1]) == 0)
found = curlump;
else if(strlen(curname) == 8 && strcmp("_START", &curname[2]) == 0)
found = curlump;
else if(strlen(curname) == 5 && strcmp("_END", &curname[1]) == 0)
found = curlump;
else if(strlen(curname) == 6 && strcmp("_END", &curname[2]) == 0)
found = curlump;
/* Free memory allocated to curname */
free(curname);
}
return found;
}
/*
LumpMod v0.2.1, a command-line utility for working with lumps in wad
files.
Copyright (C) 2003 Thunder Palace Entertainment.
This program 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; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but 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 received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
lump.h: Defines constants, structures, and functions used in lump.c
*/
#ifndef __LUMP_H
#define __LUMP_H
/* Entries in the wadfile directory are 16 bytes */
#define DIRENTRYLEN 16
/* Lumps and associated info */
struct lump {
long len;
unsigned char *data;
char name[8];
};
/* Linked list of lumps */
struct lumplist {
struct lump *cl; /* actual content of the lump */
struct lumplist *next;
};
/* Structure to contain all wadfile data */
struct wadfile {
char id[4]; /* IWAD or PWAD */
long numlumps; /* 32-bit integer */
struct lumplist *head; /* points to first entry */
};
/* Function declarations */
struct wadfile *read_wadfile(FILE *);
void free_wadfile(struct wadfile *);
int write_wadfile(FILE *, struct wadfile *);
char *get_lump_name(struct lump *);
struct lumplist *find_previous_lump(struct lumplist *, struct lumplist *, char *);
void remove_next_lump(struct wadfile *, struct lumplist *);
int add_lump(struct wadfile *, struct lumplist *, char *, long, unsigned char *);
int rename_lump(struct lump *, char *);
struct lumplist *find_last_lump(struct wadfile *);
struct lumplist *find_last_lump_between(struct lumplist *, struct lumplist *);
struct lumplist *find_next_section_lump(struct lumplist *);
#endif
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment