<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>how do you read a few pixels from an image..</title>
<description> how to read one singel block in this image?
</description><link>http://forum.wiibrew.org/read.php?11,71709,71709#msg-71709</link><lastBuildDate>Tue, 17 Mar 2026 01:27:03 +0100</lastBuildDate>
<generator>Phorum 5.2.23</generator>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,72026#msg-72026</guid>
<title>Re: how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,72026#msg-72026</link><description><![CDATA[ for now i get it work by have one image for every block. but i will look into the problem later =)]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Fri, 07 Dec 2012 22:55:14 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,72011#msg-72011</guid>
<title>Re: how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,72011#msg-72011</link><description><![CDATA[ Filfat is using this for his Minecraft clone, meaning he is applying the texture to 3D objects. GRRLIB_DrawTileQuad is only for 2D objects.<br /><br />I would recommend handling textures yourself instead of GRRLIB, because GRRLIB does not handle mipmaps and texture filtering (which causes flickering/aliasing for distant objects).]]></description>
<dc:creator>antibyte</dc:creator>
<category>Coding</category><pubDate>Thu, 06 Dec 2012 12:04:00 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,72010#msg-72010</guid>
<title>Re: how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,72010#msg-72010</link><description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>filfat</strong><br />how to read one singel block in this image?</div></blockquote>
That&#039;s a perfectly nice 16 by 16 texture palette, just draw quads (or two triangles) with the right texture coordinates.<br />See GRRLIB_DrawTileQuad for the math (or just call it directly if you are using GRRLIB). Pseudocode:<br /><pre class="bbcode">
texture = GRRLIB_LoadTextureFromFile (filename);
GRRLIB_InitTileSet (texture, 16, 16, 0);
GRRLIB_DrawTileQuad (theQuad, texture, color, frame);</pre>
I wonder why GRRLIB doesn&#039;t load textures in the Wii&#039;s native format as produced by <a href="http://wiibrew.org/wiki/Gxtexconv" rel="nofollow">gxtexconv</a>. (There&#039;s no reason to convert from PNG to GX native texture format on every load instead of once when building)]]></description>
<dc:creator>dekarl</dc:creator>
<category>Coding</category><pubDate>Thu, 06 Dec 2012 09:07:12 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,71887#msg-71887</guid>
<title>Re: how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,71887#msg-71887</link><description><![CDATA[ I&#039;d imagine using both GRRLIB and SDL would be a very complex thing to do, and also quite pointless. I *think* you are getting this error; "multiple definition of `xfb&#039;" because you are using both of them and both try to connect with libogcs framebuffer. I also *think* you are getting this error; "undefined reference to `SDL_main&#039;" and the other two below it because you are not linking with SDL. (Which would be done in the makefile with the -lsdl option (or something similar to that).<br /><br />Not to discourage you or anything, but I think you are throwing yourself into very complex stuff without konwing the basics particularily well. I still suggest getting SDL to work on PC first and switching to the Wii. SDL is well documented and, there&#039;s really a lot of good tutorials out there.]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Sat, 24 Nov 2012 17:25:25 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,71886#msg-71886</guid>
<title>Re: how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,71886#msg-71886</link><description><![CDATA[ here is the error:<br /><pre class="bbcode">
&gt; "make" 
main.cpp
c:/Users/Filiph/wiicraft-code/source/main.cpp: In function &#039;int SDL_main()&#039;:
c:/Users/Filiph/wiicraft-code/source/main.cpp:179:9: warning: unused variable &#039;version&#039; [-Wunused-variable]
c:/Users/Filiph/wiicraft-code/source/main.cpp:180:6: warning: unused variable &#039;xb&#039; [-Wunused-variable]
c:/Users/Filiph/wiicraft-code/source/main.cpp:181:9: warning: unused variable &#039;yb&#039; [-Wunused-variable]
linking ... wiicraft-code.elf
c:/devkitPro/libogc/lib/wii\libgrrlib.a(GRRLIB_core.o):(.sbss.xfb+0x0): multiple definition of `xfb&#039;
c:/devkitPro/libogc/lib/wii\libSDL.a(SDL_wiivideo.o):c:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/video/wii/SDL_wiivideo.c:279: first defined here
c:/devkitPro/libogc/lib/wii\libSDL.a(SDL_wii_main.o): In function `main&#039;:
c:\Users\Daryl\Desktop\Projects\sdl-wii\SDL/src/main/wii/SDL_wii_main.c:78: undefined reference to `SDL_main&#039;
c:/devkitPro/libogc/lib/wii\libSDL.a(SDL_wiivideo.o): In function `WII_InitVideoSystem&#039;:
SDL_wiivideo.c:(.text.WII_InitVideoSystem+0x42): undefined reference to `TVPal574IntDfScale&#039;
SDL_wiivideo.c:(.text.WII_InitVideoSystem+0x4a): undefined reference to `TVPal574IntDfScale&#039;
collect2: ld returned 1 exit status
make[1]: *** [/c/Users/Filiph/wiicraft-code/wiicraft-code.elf] Error 1
"make": *** [build] Error 2

&gt; Process Exit Code: 2
&gt; Time Taken: 00:03
</pre>]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Sat, 24 Nov 2012 13:03:14 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,71885#msg-71885</guid>
<title>Re: how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,71885#msg-71885</link><description><![CDATA[ can i use both GRRlib and SDL? for i use GRRlib por the pointers XD]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Sat, 24 Nov 2012 12:51:54 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,71883#msg-71883</guid>
<title>Re: how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,71883#msg-71883</link><description><![CDATA[ I have try sdl but i only got an error -_- so i will try to use an fresh libogc thanks for the tips =)]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Sat, 24 Nov 2012 12:13:10 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,71882#msg-71882</guid>
<title>Re: how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,71882#msg-71882</link><description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>filfat</strong><br />EDIT2: I realy dont get the GX part!!! any easy 3D/2D libs with Doc best was if it has a video tut. for I realy sucks at GX part -_-</div></blockquote><br />If you want a video tutorial, you could use SDL instead of GRRLIB. SDL is a widely used media library so there are tons of tutorials out there. Also, SDL is for PC which might be more convenient when you want experiment a bit with it. A quick googling for "sdl video tutorial" will take you here: [<a href="http://www.sdltutorials.com/sdl-video-tutorials" rel="nofollow">www.sdltutorials.com</a>].<br /><br />Happy "coading"! :)]]></description>
<dc:creator>profetylen</dc:creator>
<category>Coding</category><pubDate>Sat, 24 Nov 2012 11:09:11 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,71879#msg-71879</guid>
<title>Re: how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,71879#msg-71879</link><description><![CDATA[ GRRlib draw an img like this:<br /><pre class="bbcode">
GRRLIB_DrawImg(<span style="color:#33CCFF">250</span>, <span style="color:#33CCFF">48</span>, terrain, <span style="color:#33CCFF">0</span>, <span style="color:#33CCFF">1</span><span style="color:#00FF00">/*X*/</span>, <span style="color:#33CCFF">1</span><span style="color:#00FF00">/*Y*/</span>, <span style="color:#33CCFF">0xffffffff</span>);
<span style="color:#00FF00">//Scale x multiplies the width by x, same for y. 1 for scale leaves the image at original size.</span></pre>
So i want&#039;s to change the 1, 1 codinaters to show only one block not the whole terrain.png file.<br />and sory for the bad explanation. the best would be if you want&#039;s to help me on Wiicraft/Minecraft Wii Edition Link:<a href="https://sourceforge.net/projects/wiicraft/" rel="nofollow">HERE</a>]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Fri, 23 Nov 2012 23:00:45 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,71878#msg-71878</guid>
<title>Re: how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,71878#msg-71878</link><description><![CDATA[ ok, GRRlib takes in an X and an Y int. so i need to get the X and Y variabels for exemple the stone block. or if you can help me to code an function i can send you the source of the app<br /><br />EDIT: I arent god in Codinaters XD<br /><br />EDIT2: I realy dont get the GX part!!! any easy 3D/2D libs with Doc best was if it has a video tut. for I realy sucks at GX part -_-]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Fri, 23 Nov 2012 22:24:46 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,71868#msg-71868</guid>
<title>Re: how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,71868#msg-71868</link><description><![CDATA[ This particular image is a 32bit png, so you need to decode it in your application first.<br /><br />After that you have an array of 256*256*4 bytes. There are 16x16 blocks in this image. You get the start address of a block like that:<br /><br /><pre class="bbcode">
    unsigned char* pImage = DecodePNG(...whatever arguments needed...);

    // get block in row 12, column 13
    int xb = 13;
    int yb = 12;

    unsigned char* pBlock = GetBlockAt(xb, yb, pImage);
    ...

unsigned char* GetBlockAt(int xb, int yb, unsigned char* pImage)
{
    const int imageSizeX = 256;
    const int blockSizeX = 16;
    const int blockSizeY = 16;
    return pImage + ((blockSizeY * yb * imageSizeX) + (blockSizeX * xb) * 4;
}</pre><br />Is that what you want? You need to be more specific when posting a question, otherwise people will not bother to figure out what you want in the first place.]]></description>
<dc:creator>antibyte</dc:creator>
<category>Coding</category><pubDate>Wed, 21 Nov 2012 09:50:49 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,71857#msg-71857</guid>
<title>Re: how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,71857#msg-71857</link><description><![CDATA[ ???]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Mon, 19 Nov 2012 14:19:12 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,71709#msg-71709</guid>
<title>how do you read a few pixels from an image..</title><link>http://forum.wiibrew.org/read.php?11,71709,71709#msg-71709</link><description><![CDATA[ how to read one singel block in this image?<br /><img src="http://i.imgur.com/K7spO.png" class="bbcode" border="0" />]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Tue, 30 Oct 2012 16:09:41 +0100</pubDate></item>
</channel>
</rss>