Skip to content

Commit 32043a9

Browse files
committed
Initial commit: version 0.1.0 prerelease
0 parents  commit 32043a9

File tree

224 files changed

+40576
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+40576
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# No newline conversion
2+
* -text

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# output directory
2+
bin/
3+
4+
# working directory
5+
tmp/
6+
7+
# no binaries
8+
*.exe
9+
10+
# no libraries
11+
*.lib
12+
*.a
13+
lib/*
14+
!lib/fltk-1.3.5-mod.zip
15+
16+
# no IDE files
17+
*.sdf
18+
*.opensdf
19+
*.suo
20+
*.aps

INSTALL.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Install Guide
2+
3+
## Windows
4+
5+
**To install Tilemap Studio:**
6+
7+
1. Download **install.bat** and **tilemapstudio.exe** from [the latest release](https://github.com/Rangi42/tilemap-studio/releases).
8+
2. Hold down Shift, right-click **install.bat**, and click "**Run as administrator**". This will install Tilemap Studio to your account and create a shortcut on your Desktop.
9+
3. Now you can delete the two downloaded files.
10+
4. Double-click **Tilemap Studio** on your Desktop to open it. If you get an error that "mscvrt120.dll is missing", you need to install the [Microsoft Visual C++ 2013 Redistributable](https://www.microsoft.com/en-us/download/details.aspx?id=40784). You may need the x64 version as well as the x86 version, at least for Windows 10.
11+
12+
If you have Microsoft Visual Studio, you can build Tilemap Studio yourself:
13+
14+
1. On GitHub, click the green "**Clone or download**" button and click "**Download ZIP**". This will download **tilemap-studio-master.zip**.
15+
2. Unzip tilemap-studio-master.zip. This will create the **tilemap-studio-master** folder.
16+
3. Navigate to the tilemap-studio-master folder in Explorer.
17+
4. Unzip lib/fltk-1.3.5-mod.zip. This will create the lib/**fltk-1.3.5-mod** folder.
18+
5. Open lib/fltk-1.3.5-mod/ide/VisualC2010/fltk.sln in Visual Studio 2013. (Other versions may or may not work, I haven't tried.)
19+
6. A dialog "Upgrade VS++ Compiler and Libraries" will open, since fltk.sln was made for Visual Studio 2008. Click OK.
20+
7. Go to **Build → Batch Build…**, check the projects **fltk**, **fltkimages**, **fltkpng**, **fltkjpeg**, and **fltkzlib** in the Release configuration, and click the **Build** button.
21+
8. Move the .lib files from lib/fltk-1.3.5-mod/lib to lib.
22+
9. Open ide/tilemap-studio.sln in Visual Studio 2013.
23+
10. If the Solution Configuration dropdown on the toolbar says Debug, set it to **Release**.
24+
11. Go to **Build → Build Solution** or press F7 to build the project. This will create bin/Release/**tilemapstudio.exe**.
25+
12. Hold down Shift, right-click **install.bat**, and click "**Run as administrator**". This will install Tilemap Studio to your account and create a shortcut on your Desktop.
26+
27+
28+
## Linux
29+
30+
Run the following commands:
31+
32+
```bash
33+
# Install dependencies
34+
# (you need at least g++ 4.9 for <regex> support)
35+
sudo apt-get install make g++ git unzip
36+
sudo apt-get install zlib1g-dev libpng-dev libxpm-dev libx11-dev libxft-dev libxinerama-dev libfontconfig1-dev x11proto-xext-dev libxrender-dev libxfixes-dev
37+
38+
# Clone Tilemap Studio
39+
git clone https://github.com/Rangi42/tilemap-studio.git
40+
cd tilemap-studio
41+
42+
# Build modified FLTK 1.3.5 with the latest ABI enabled
43+
# (even if you already have libfltk1.3-dev installed)
44+
pushd lib
45+
unzip fltk-1.3.5-mod.zip
46+
cd fltk-1.3.5-mod
47+
chmod +x configure
48+
./configure --prefix="$PWD/.." --with-abiversion=10305
49+
make
50+
make install
51+
popd
52+
53+
# Build Tilemap Studio
54+
# ("export PATH" is needed if fltk-config is not already in your PATH)
55+
export PATH="$PWD/lib/bin:$PATH"
56+
make
57+
58+
# Install Tilemap Studio
59+
# (tested on Ubuntu and Ubuntu derivatives only; it just copies bin/tilemapstudio
60+
# and res/app.xpm to system directories)
61+
sudo make install
62+
```

LICENSE.md

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
### GNU LESSER GENERAL PUBLIC LICENSE
2+
3+
Version 3, 29 June 2007
4+
5+
Copyright (C) 2007 Free Software Foundation, Inc.
6+
<https://fsf.org/>
7+
8+
Everyone is permitted to copy and distribute verbatim copies of this
9+
license document, but changing it is not allowed.
10+
11+
This version of the GNU Lesser General Public License incorporates the
12+
terms and conditions of version 3 of the GNU General Public License,
13+
supplemented by the additional permissions listed below.
14+
15+
#### 0. Additional Definitions.
16+
17+
As used herein, "this License" refers to version 3 of the GNU Lesser
18+
General Public License, and the "GNU GPL" refers to version 3 of the
19+
GNU General Public License.
20+
21+
"The Library" refers to a covered work governed by this License, other
22+
than an Application or a Combined Work as defined below.
23+
24+
An "Application" is any work that makes use of an interface provided
25+
by the Library, but which is not otherwise based on the Library.
26+
Defining a subclass of a class defined by the Library is deemed a mode
27+
of using an interface provided by the Library.
28+
29+
A "Combined Work" is a work produced by combining or linking an
30+
Application with the Library. The particular version of the Library
31+
with which the Combined Work was made is also called the "Linked
32+
Version".
33+
34+
The "Minimal Corresponding Source" for a Combined Work means the
35+
Corresponding Source for the Combined Work, excluding any source code
36+
for portions of the Combined Work that, considered in isolation, are
37+
based on the Application, and not on the Linked Version.
38+
39+
The "Corresponding Application Code" for a Combined Work means the
40+
object code and/or source code for the Application, including any data
41+
and utility programs needed for reproducing the Combined Work from the
42+
Application, but excluding the System Libraries of the Combined Work.
43+
44+
#### 1. Exception to Section 3 of the GNU GPL.
45+
46+
You may convey a covered work under sections 3 and 4 of this License
47+
without being bound by section 3 of the GNU GPL.
48+
49+
#### 2. Conveying Modified Versions.
50+
51+
If you modify a copy of the Library, and, in your modifications, a
52+
facility refers to a function or data to be supplied by an Application
53+
that uses the facility (other than as an argument passed when the
54+
facility is invoked), then you may convey a copy of the modified
55+
version:
56+
57+
- a) under this License, provided that you make a good faith effort
58+
to ensure that, in the event an Application does not supply the
59+
function or data, the facility still operates, and performs
60+
whatever part of its purpose remains meaningful, or
61+
- b) under the GNU GPL, with none of the additional permissions of
62+
this License applicable to that copy.
63+
64+
#### 3. Object Code Incorporating Material from Library Header Files.
65+
66+
The object code form of an Application may incorporate material from a
67+
header file that is part of the Library. You may convey such object
68+
code under terms of your choice, provided that, if the incorporated
69+
material is not limited to numerical parameters, data structure
70+
layouts and accessors, or small macros, inline functions and templates
71+
(ten or fewer lines in length), you do both of the following:
72+
73+
- a) Give prominent notice with each copy of the object code that
74+
the Library is used in it and that the Library and its use are
75+
covered by this License.
76+
- b) Accompany the object code with a copy of the GNU GPL and this
77+
license document.
78+
79+
#### 4. Combined Works.
80+
81+
You may convey a Combined Work under terms of your choice that, taken
82+
together, effectively do not restrict modification of the portions of
83+
the Library contained in the Combined Work and reverse engineering for
84+
debugging such modifications, if you also do each of the following:
85+
86+
- a) Give prominent notice with each copy of the Combined Work that
87+
the Library is used in it and that the Library and its use are
88+
covered by this License.
89+
- b) Accompany the Combined Work with a copy of the GNU GPL and this
90+
license document.
91+
- c) For a Combined Work that displays copyright notices during
92+
execution, include the copyright notice for the Library among
93+
these notices, as well as a reference directing the user to the
94+
copies of the GNU GPL and this license document.
95+
- d) Do one of the following:
96+
- 0) Convey the Minimal Corresponding Source under the terms of
97+
this License, and the Corresponding Application Code in a form
98+
suitable for, and under terms that permit, the user to
99+
recombine or relink the Application with a modified version of
100+
the Linked Version to produce a modified Combined Work, in the
101+
manner specified by section 6 of the GNU GPL for conveying
102+
Corresponding Source.
103+
- 1) Use a suitable shared library mechanism for linking with
104+
the Library. A suitable mechanism is one that (a) uses at run
105+
time a copy of the Library already present on the user's
106+
computer system, and (b) will operate properly with a modified
107+
version of the Library that is interface-compatible with the
108+
Linked Version.
109+
- e) Provide Installation Information, but only if you would
110+
otherwise be required to provide such information under section 6
111+
of the GNU GPL, and only to the extent that such information is
112+
necessary to install and execute a modified version of the
113+
Combined Work produced by recombining or relinking the Application
114+
with a modified version of the Linked Version. (If you use option
115+
4d0, the Installation Information must accompany the Minimal
116+
Corresponding Source and Corresponding Application Code. If you
117+
use option 4d1, you must provide the Installation Information in
118+
the manner specified by section 6 of the GNU GPL for conveying
119+
Corresponding Source.)
120+
121+
#### 5. Combined Libraries.
122+
123+
You may place library facilities that are a work based on the Library
124+
side by side in a single library together with other library
125+
facilities that are not Applications and are not covered by this
126+
License, and convey such a combined library under terms of your
127+
choice, if you do both of the following:
128+
129+
- a) Accompany the combined library with a copy of the same work
130+
based on the Library, uncombined with any other library
131+
facilities, conveyed under the terms of this License.
132+
- b) Give prominent notice with the combined library that part of it
133+
is a work based on the Library, and explaining where to find the
134+
accompanying uncombined form of the same work.
135+
136+
#### 6. Revised Versions of the GNU Lesser General Public License.
137+
138+
The Free Software Foundation may publish revised and/or new versions
139+
of the GNU Lesser General Public License from time to time. Such new
140+
versions will be similar in spirit to the present version, but may
141+
differ in detail to address new problems or concerns.
142+
143+
Each version is given a distinguishing version number. If the Library
144+
as you received it specifies that a certain numbered version of the
145+
GNU Lesser General Public License "or any later version" applies to
146+
it, you have the option of following the terms and conditions either
147+
of that published version or of any later version published by the
148+
Free Software Foundation. If the Library as you received it does not
149+
specify a version number of the GNU Lesser General Public License, you
150+
may choose any version of the GNU Lesser General Public License ever
151+
published by the Free Software Foundation.
152+
153+
If the Library as you received it specifies that a proxy can decide
154+
whether future versions of the GNU Lesser General Public License shall
155+
apply, that proxy's public statement of acceptance of any version is
156+
permanent authorization for you to choose that version for the
157+
Library.

Makefile

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
DESTDIR =
2+
PREFIX = /usr/local
3+
4+
tilemapstudio = tilemapstudio
5+
tilemapstudiod = tilemapstudiod
6+
7+
CXX ?= g++
8+
LD = $(CXX)
9+
RM = rm -rf
10+
11+
srcdir = src
12+
resdir = res
13+
tmpdir = tmp
14+
debugdir = tmp/debug
15+
bindir = bin
16+
17+
CXXFLAGS = -std=c++11 -I$(srcdir) -I$(resdir) $(shell fltk-config --use-images --cxxflags)
18+
LDFLAGS = $(shell fltk-config --use-images --ldflags) $(shell pkg-config --libs libpng xpm)
19+
20+
RELEASEFLAGS = -DNDEBUG -O3 -flto -march=native
21+
DEBUGFLAGS = -DDEBUG -D_DEBUG -O0 -g -ggdb3 -Wall -Wextra -pedantic -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter
22+
23+
COMMON = $(wildcard $(srcdir)/*.h) $(wildcard $(resdir)/*.xpm)
24+
SOURCES = $(wildcard $(srcdir)/*.cpp)
25+
OBJECTS = $(SOURCES:$(srcdir)/%.cpp=$(tmpdir)/%.o)
26+
DEBUGOBJECTS = $(SOURCES:$(srcdir)/%.cpp=$(debugdir)/%.o)
27+
TARGET = $(bindir)/$(tilemapstudio)
28+
DEBUGTARGET = $(bindir)/$(tilemapstudiod)
29+
DESKTOP = "$(DESTDIR)$(PREFIX)/share/applications/Tilemap Studio.desktop"
30+
31+
.PHONY: all $(tilemapstudio) $(tilemapstudiod) release debug clean install uninstall
32+
33+
.SUFFIXES: .o .cpp
34+
35+
all: $(tilemapstudio)
36+
37+
$(tilemapstudio): release
38+
$(tilemapstudiod): debug
39+
40+
release: CXXFLAGS += $(RELEASEFLAGS)
41+
release: $(TARGET)
42+
43+
debug: CXXFLAGS += $(DEBUGFLAGS)
44+
debug: $(DEBUGTARGET)
45+
46+
$(TARGET): $(OBJECTS)
47+
@mkdir -p $(@D)
48+
$(LD) -o $@ $^ $(LDFLAGS)
49+
50+
$(DEBUGTARGET): $(DEBUGOBJECTS)
51+
@mkdir -p $(@D)
52+
$(LD) -o $@ $^ $(LDFLAGS)
53+
54+
$(tmpdir)/%.o: $(srcdir)/%.cpp $(COMMON)
55+
@mkdir -p $(@D)
56+
$(CXX) -c $(CXXFLAGS) -o $@ $<
57+
58+
$(debugdir)/%.o: $(srcdir)/%.cpp $(COMMON)
59+
@mkdir -p $(@D)
60+
$(CXX) -c $(CXXFLAGS) -o $@ $<
61+
62+
clean:
63+
$(RM) $(TARGET) $(DEBUGTARGET) $(OBJECTS) $(DEBUGOBJECTS)
64+
65+
install: release
66+
mkdir -p $(DESTDIR)$(PREFIX)/bin
67+
cp $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(tilemapstudio)
68+
mkdir -p $(DESTDIR)$(PREFIX)/share/pixmaps
69+
cp $(resdir)/app.xpm $(DESTDIR)$(PREFIX)/share/pixmaps/tilemapstudio48.xpm
70+
cp $(resdir)/app-icon.xpm $(DESTDIR)$(PREFIX)/share/pixmaps/tilemapstudio16.xpm
71+
mkdir -p $(DESTDIR)$(PREFIX)/share/applications
72+
echo "[Desktop Entry]" > $(DESKTOP)
73+
echo "Name=Tilemap Studio" >> $(DESKTOP)
74+
echo "Comment=Edit pokered and pokecrystal tilemaps" >> $(DESKTOP)
75+
echo "Icon=$(PREFIX)/share/pixmaps/tilemapstudio48.xpm" >> $(DESKTOP)
76+
echo "Exec=$(PREFIX)/bin/$(tilemapstudio)" >> $(DESKTOP)
77+
echo "Type=Application" >> $(DESKTOP)
78+
echo "Terminal=false" >> $(DESKTOP)
79+
80+
uninstall:
81+
rm -f $(DESTDIR)$(PREFIX)/bin/$(tilemapstudio)
82+
rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/tilemapstudio48.xpm
83+
rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/tilemapstudio16.xpm
84+
rm -f $(DESKTOP)

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Tilemap Studio
2+
3+
A tilemap editor for [pokecrystal](https://github.com/pret/pokecrystal), [pokered](https://github.com/pret/pokered), and hacks including [Polished Crystal v2](https://github.com/Rangi42/polishedcrystal/tree/v2.2.0), [Red++ v3](https://github.com/TheFakeMateo/rpp-backup), [Orange](https://github.com/PiaCarrot/pokeorange), [Prism](https://www.reddit.com/r/PokemonPrism), and many more.
4+
5+
Inspired by [GSC Town Map Editor](https://hax.iimarckus.org/topic/97/) and Karteneditor, but implemented with C++ and [FLTK](http://www.fltk.org/), and with support for tilemaps beyond the Town Map.
6+
7+
Latest prerelease: [**0.1.0**](https://github.com/Rangi42/polished-map/releases/tag/v0.1.0)
8+
9+
Follow the steps in [INSTALL.md](INSTALL.md) to install the release copy of Tilemap Studio, or the longer instructions to build it yourself from source.
10+
11+
The [example/](example/) directory contains tilemaps and tileset graphics for three different kinds of Town Map. Each one uses a different format: **pokered/town_map.rle** is an RBY Town Map, **pokecrystal/\*.bin** are GSC Town Maps, and **polishedcrystal/\*.bin** are PC Town Maps.
12+
13+
![Screenshot](screenshot.png)

TODO.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To Do
2+
3+
## Features
4+
5+
* **Print tilemap screenshots**
6+
* **Load tileset graphics** (support PNG, BMP, 1BPP, 2BPP, and LZ-compressed BPP)
7+
* **Generate tilemaps and tilesets from images**
8+
* Native-looking build on Mac OS X (involves publishing an app bundle release, and using the system menu bar)
9+
* Scale the UI for high-DPI displays
10+
* Generate tilemap images from the command line
11+
* Allow undo/redo for resize operations

example/pokecrystal/johto.bin

361 Bytes
Binary file not shown.

example/pokecrystal/kanto.bin

361 Bytes
Binary file not shown.

example/pokecrystal/town_map.png

660 Bytes
Loading

0 commit comments

Comments
 (0)