Snippet for Tileviewer

Snippet for Tileviewer

Postby Sauer2 » 04 Feb 2014, 16:58

Hi,

Context: I earlier asked for an image viewer which shows images as tiles.
Charlie named a few editors with the capability, but that somehow wasn't ideal for my workflow since I mainly use Inkscape. So I created the most minimal tile viewer I could think of, which displays the image as a 5 x 5 grid and thought maybe you could use that C snippet, too, if that fits to your workflow.
You just put the image as the first parameter, which means you can drag and drop an image on the executable symbol, if your desktop supports it.
tv.png

It depends on SDL2 and SDL2_Image.
Using MINGW, you can compile it with:
{l Code}: {l Select All Code}
gcc tiledview.c -I "C:\PATH_TO_SDL_Image\include\SDL2" -I "C:\PATH_TO_SDL\include\SDL2" -L "C:\PATH_TO_SDL_Image\lib" -L "C:\PATH_TO_SDL\lib" -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -Os -Wall -Wextra -mwindows

On Linux it should be basically the same, minus the paths and the Windows/MINGW flags.

Feedback is welcome!
Attachments
tiledview.c
the source code
(4.04 KiB) Downloaded 92 times
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Re: Snippet for Tileviewer

Postby c_xong » 05 Feb 2014, 00:09

Nice utility. Is this mainly for making seamless tiles? If so (and I know this probably isn't easier), for inkscape there's this tutorial on how to get it to display cloned tiles for seamless tile editing: http://verysimpledesigns.com/vectors/in ... terns.html

I think https://gist.github.com/ is also a good place to share snippets like this.
User avatar
c_xong
 
Posts: 234
Joined: 06 Sep 2013, 04:33

Re: Snippet for Tileviewer

Postby Sauer2 » 05 Feb 2014, 05:23

Hi cxong,

you are right, this is for seamless tiles, like the floor tiles in C-Dogs. Problem is, I never know if the borders are acceptable or too bold without checking out.
And while I'm not in the right state to look at complicated tutorials at the moment, I'll have a look at this.
About gists: Is that the pastebin of Github?

Also: I could deliver binaries for Windows on demand.
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Re: Snippet for Tileviewer

Postby acme_pjz » 05 Feb 2014, 06:25

Hi Sauer2,

I think a simple html file with tiled background is better than a C program :)
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 639
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Snippet for Tileviewer

Postby Sauer2 » 05 Feb 2014, 06:31

Hi, acme_pjz,

while this is true, you can't drag and drop \images into HTML pages/ without some programming/typing work.
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Re: Snippet for Tileviewer

Postby Sauer2 » 05 Feb 2014, 11:02

User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Re: Snippet for Tileviewer

Postby Sauer2 » 11 Feb 2014, 17:43

Update: You can now control the grid size with the arrow keys.
Attachments
tiledview.c
updated version
(5.71 KiB) Downloaded 89 times
User avatar
Sauer2
 
Posts: 430
Joined: 19 Jan 2010, 14:02

Who is online

Users browsing this forum: No registered users and 1 guest