Skip to content

Commit

Permalink
Initial commit: version 0.1.0 prerelease
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 committed Aug 2, 2019
0 parents commit 32043a9
Show file tree
Hide file tree
Showing 224 changed files with 40,576 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# No newline conversion
* -text
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# output directory
bin/

# working directory
tmp/

# no binaries
*.exe

# no libraries
*.lib
*.a
lib/*
!lib/fltk-1.3.5-mod.zip

# no IDE files
*.sdf
*.opensdf
*.suo
*.aps
62 changes: 62 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Install Guide

## Windows

**To install Tilemap Studio:**

1. Download **install.bat** and **tilemapstudio.exe** from [the latest release](https://github.com/Rangi42/tilemap-studio/releases).
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.
3. Now you can delete the two downloaded files.
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.

If you have Microsoft Visual Studio, you can build Tilemap Studio yourself:

1. On GitHub, click the green "**Clone or download**" button and click "**Download ZIP**". This will download **tilemap-studio-master.zip**.
2. Unzip tilemap-studio-master.zip. This will create the **tilemap-studio-master** folder.
3. Navigate to the tilemap-studio-master folder in Explorer.
4. Unzip lib/fltk-1.3.5-mod.zip. This will create the lib/**fltk-1.3.5-mod** folder.
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.)
6. A dialog "Upgrade VS++ Compiler and Libraries" will open, since fltk.sln was made for Visual Studio 2008. Click OK.
7. Go to **Build → Batch Build…**, check the projects **fltk**, **fltkimages**, **fltkpng**, **fltkjpeg**, and **fltkzlib** in the Release configuration, and click the **Build** button.
8. Move the .lib files from lib/fltk-1.3.5-mod/lib to lib.
9. Open ide/tilemap-studio.sln in Visual Studio 2013.
10. If the Solution Configuration dropdown on the toolbar says Debug, set it to **Release**.
11. Go to **Build → Build Solution** or press F7 to build the project. This will create bin/Release/**tilemapstudio.exe**.
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.


## Linux

Run the following commands:

```bash
# Install dependencies
# (you need at least g++ 4.9 for <regex> support)
sudo apt-get install make g++ git unzip
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

# Clone Tilemap Studio
git clone https://github.com/Rangi42/tilemap-studio.git
cd tilemap-studio

# Build modified FLTK 1.3.5 with the latest ABI enabled
# (even if you already have libfltk1.3-dev installed)
pushd lib
unzip fltk-1.3.5-mod.zip
cd fltk-1.3.5-mod
chmod +x configure
./configure --prefix="$PWD/.." --with-abiversion=10305
make
make install
popd

# Build Tilemap Studio
# ("export PATH" is needed if fltk-config is not already in your PATH)
export PATH="$PWD/lib/bin:$PATH"
make

# Install Tilemap Studio
# (tested on Ubuntu and Ubuntu derivatives only; it just copies bin/tilemapstudio
# and res/app.xpm to system directories)
sudo make install
```
157 changes: 157 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
### GNU LESSER GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc.
<https://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.

This version of the GNU Lesser General Public License incorporates the
terms and conditions of version 3 of the GNU General Public License,
supplemented by the additional permissions listed below.

#### 0. Additional Definitions.

As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the
GNU General Public License.

"The Library" refers to a covered work governed by this License, other
than an Application or a Combined Work as defined below.

An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.

A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".

The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.

The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.

#### 1. Exception to Section 3 of the GNU GPL.

You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.

#### 2. Conveying Modified Versions.

If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:

- a) under this License, provided that you make a good faith effort
to ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
- b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.

#### 3. Object Code Incorporating Material from Library Header Files.

The object code form of an Application may incorporate material from a
header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:

- a) Give prominent notice with each copy of the object code that
the Library is used in it and that the Library and its use are
covered by this License.
- b) Accompany the object code with a copy of the GNU GPL and this
license document.

#### 4. Combined Works.

You may convey a Combined Work under terms of your choice that, taken
together, effectively do not restrict modification of the portions of
the Library contained in the Combined Work and reverse engineering for
debugging such modifications, if you also do each of the following:

- a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
- b) Accompany the Combined Work with a copy of the GNU GPL and this
license document.
- c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
- d) Do one of the following:
- 0) Convey the Minimal Corresponding Source under the terms of
this License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
- 1) Use a suitable shared library mechanism for linking with
the Library. A suitable mechanism is one that (a) uses at run
time a copy of the Library already present on the user's
computer system, and (b) will operate properly with a modified
version of the Library that is interface-compatible with the
Linked Version.
- e) Provide Installation Information, but only if you would
otherwise be required to provide such information under section 6
of the GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the Application
with a modified version of the Linked Version. (If you use option
4d0, the Installation Information must accompany the Minimal
Corresponding Source and Corresponding Application Code. If you
use option 4d1, you must provide the Installation Information in
the manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.)

#### 5. Combined Libraries.

You may place library facilities that are a work based on the Library
side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:

- a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities, conveyed under the terms of this License.
- b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.

#### 6. Revised Versions of the GNU Lesser General Public License.

The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser 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 Library
as you received it specifies that a certain numbered version of the
GNU Lesser General Public License "or any later version" applies to
it, you have the option of following the terms and conditions either
of that published version or of any later version published by the
Free Software Foundation. If the Library as you received it does not
specify a version number of the GNU Lesser General Public License, you
may choose any version of the GNU Lesser General Public License ever
published by the Free Software Foundation.

If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
84 changes: 84 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
DESTDIR =
PREFIX = /usr/local

tilemapstudio = tilemapstudio
tilemapstudiod = tilemapstudiod

CXX ?= g++
LD = $(CXX)
RM = rm -rf

srcdir = src
resdir = res
tmpdir = tmp
debugdir = tmp/debug
bindir = bin

CXXFLAGS = -std=c++11 -I$(srcdir) -I$(resdir) $(shell fltk-config --use-images --cxxflags)
LDFLAGS = $(shell fltk-config --use-images --ldflags) $(shell pkg-config --libs libpng xpm)

RELEASEFLAGS = -DNDEBUG -O3 -flto -march=native
DEBUGFLAGS = -DDEBUG -D_DEBUG -O0 -g -ggdb3 -Wall -Wextra -pedantic -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter

COMMON = $(wildcard $(srcdir)/*.h) $(wildcard $(resdir)/*.xpm)
SOURCES = $(wildcard $(srcdir)/*.cpp)
OBJECTS = $(SOURCES:$(srcdir)/%.cpp=$(tmpdir)/%.o)
DEBUGOBJECTS = $(SOURCES:$(srcdir)/%.cpp=$(debugdir)/%.o)
TARGET = $(bindir)/$(tilemapstudio)
DEBUGTARGET = $(bindir)/$(tilemapstudiod)
DESKTOP = "$(DESTDIR)$(PREFIX)/share/applications/Tilemap Studio.desktop"

.PHONY: all $(tilemapstudio) $(tilemapstudiod) release debug clean install uninstall

.SUFFIXES: .o .cpp

all: $(tilemapstudio)

$(tilemapstudio): release
$(tilemapstudiod): debug

release: CXXFLAGS += $(RELEASEFLAGS)
release: $(TARGET)

debug: CXXFLAGS += $(DEBUGFLAGS)
debug: $(DEBUGTARGET)

$(TARGET): $(OBJECTS)
@mkdir -p $(@D)
$(LD) -o $@ $^ $(LDFLAGS)

$(DEBUGTARGET): $(DEBUGOBJECTS)
@mkdir -p $(@D)
$(LD) -o $@ $^ $(LDFLAGS)

$(tmpdir)/%.o: $(srcdir)/%.cpp $(COMMON)
@mkdir -p $(@D)
$(CXX) -c $(CXXFLAGS) -o $@ $<

$(debugdir)/%.o: $(srcdir)/%.cpp $(COMMON)
@mkdir -p $(@D)
$(CXX) -c $(CXXFLAGS) -o $@ $<

clean:
$(RM) $(TARGET) $(DEBUGTARGET) $(OBJECTS) $(DEBUGOBJECTS)

install: release
mkdir -p $(DESTDIR)$(PREFIX)/bin
cp $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(tilemapstudio)
mkdir -p $(DESTDIR)$(PREFIX)/share/pixmaps
cp $(resdir)/app.xpm $(DESTDIR)$(PREFIX)/share/pixmaps/tilemapstudio48.xpm
cp $(resdir)/app-icon.xpm $(DESTDIR)$(PREFIX)/share/pixmaps/tilemapstudio16.xpm
mkdir -p $(DESTDIR)$(PREFIX)/share/applications
echo "[Desktop Entry]" > $(DESKTOP)
echo "Name=Tilemap Studio" >> $(DESKTOP)
echo "Comment=Edit pokered and pokecrystal tilemaps" >> $(DESKTOP)
echo "Icon=$(PREFIX)/share/pixmaps/tilemapstudio48.xpm" >> $(DESKTOP)
echo "Exec=$(PREFIX)/bin/$(tilemapstudio)" >> $(DESKTOP)
echo "Type=Application" >> $(DESKTOP)
echo "Terminal=false" >> $(DESKTOP)

uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/$(tilemapstudio)
rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/tilemapstudio48.xpm
rm -f $(DESTDIR)$(PREFIX)/share/pixmaps/tilemapstudio16.xpm
rm -f $(DESKTOP)
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Tilemap Studio

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.

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.

Latest prerelease: [**0.1.0**](https://github.com/Rangi42/polished-map/releases/tag/v0.1.0)

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.

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.

![Screenshot](screenshot.png)
11 changes: 11 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To Do

## Features

* **Print tilemap screenshots**
* **Load tileset graphics** (support PNG, BMP, 1BPP, 2BPP, and LZ-compressed BPP)
* **Generate tilemaps and tilesets from images**
* Native-looking build on Mac OS X (involves publishing an app bundle release, and using the system menu bar)
* Scale the UI for high-DPI displays
* Generate tilemap images from the command line
* Allow undo/redo for resize operations
Binary file added example/pokecrystal/johto.bin
Binary file not shown.
Binary file added example/pokecrystal/kanto.bin
Binary file not shown.
Binary file added example/pokecrystal/town_map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/pokered/town_map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added example/pokered/town_map.rle
Binary file not shown.
Binary file added example/polishedcrystal/johto.bin
Binary file not shown.
Binary file added example/polishedcrystal/kanto.bin
Binary file not shown.
Binary file added example/polishedcrystal/town_map.2bpp.lz
Binary file not shown.
Binary file added ide/tilemap-studio.rc
Binary file not shown.
22 changes: 22 additions & 0 deletions ide/tilemap-studio.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tilemap Studio", "tilemap-studio.vcxproj", "{A96E1028-F96F-4519-B9DA-24C86DA2AD0D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A96E1028-F96F-4519-B9DA-24C86DA2AD0D}.Debug|Win32.ActiveCfg = Debug|Win32
{A96E1028-F96F-4519-B9DA-24C86DA2AD0D}.Debug|Win32.Build.0 = Debug|Win32
{A96E1028-F96F-4519-B9DA-24C86DA2AD0D}.Release|Win32.ActiveCfg = Release|Win32
{A96E1028-F96F-4519-B9DA-24C86DA2AD0D}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Loading

0 comments on commit 32043a9

Please sign in to comment.