Changes

Jump to navigation Jump to search
6,812 bytes added ,  19:27, 3 March 2011
no edit summary
Line 4: Line 4:  
| type = framework library
 
| type = framework library
 
| author = [[User:Minishlink|Minishlink]]
 
| author = [[User:Minishlink|Minishlink]]
| version = 1.1
+
| version = 1.3
 
| website = http://louislagrange.free.fr/MLlib/
 
| website = http://louislagrange.free.fr/MLlib/
 
| download = http://code.google.com/p/mllib/downloads/
 
| download = http://code.google.com/p/mllib/downloads/
 
| source = http://code.google.com/p/mllib/source/checkout
 
| source = http://code.google.com/p/mllib/source/checkout
| discussion = http://www.dev-fr.org
+
| discussion = Talk:MLlib
 
}}
 
}}
   −
The '''MLlib''' (or Minishlink's Library) is a simple library to develop on Nintendo Wii. Technically, it's a wrapper of libogc and others librairies. Coding with this lib on Wii is way easier and faster now ! :-) I created this because I needed a library with I could code with easy functions. It uses [[GX]] for drawing, [[libpng]] for handling PNG, and libs of [[libogc]]...
+
The '''MLlib''' (or Minishlink's Library) is an easy but powerful library that allows you to develop great games quickly for Nintendo Wii. Technically, it's a wrapper of libogc and others librairies. Coding with this lib on Wii is way easier and faster now ! :-) I created this because I needed a library with I could code with easy functions, and quickly. It uses [[GX]] for drawing, [http://en.wikipedia.org/wiki/Libpng libpng] for handling PNG, [[FreeTypeGX]] for TTF fonts (I needed to recode it in C) and libs of [[libogc]].
    
==Features==
 
==Features==
Line 17: Line 17:  
* Easy for all;
 
* Easy for all;
 
* Friendly functions;
 
* Friendly functions;
* Handles drawing (lol);
+
* Handles drawing;
 
* Sprite system;
 
* Sprite system;
 
* Handles PNG images;
 
* Handles PNG images;
 
* Special effects;
 
* Special effects;
* Write graphically text;
+
* Write graphically text (TTF font support);
 
* MP3 system;
 
* MP3 system;
 
* MOD system;
 
* MOD system;
Line 29: Line 29:  
==How to install ?==
 
==How to install ?==
 
===On Windows===
 
===On Windows===
First you need to have '''devKitPro''' installed. Go [[Devkitppc setup (Windows)|install]] it ! ;)
+
First you need to have the lastest '''devkitPro''' installed. Go [[Devkitppc setup (Windows)|install]] it ! ;)
   −
Then, '''libpng''' for Wii must be installed.  
+
Then, '''libpng''' for Wii must be installed.
# Download it at [http://louislagrange.free.fr/MLlib/downloads/libpng_wii.zip my FTP].  
+
# Download it at [http://louislagrange.free.fr/MLlib/downloads/libpng_wii.zip my FTP] or elsewhere.  
 
# Extract it and place the .a in "devkitpro\libogc\lib\wii" and the folder "png" in "devkitpro\libogc\include".
 
# Extract it and place the .a in "devkitpro\libogc\lib\wii" and the folder "png" in "devkitpro\libogc\include".
 
# It's done !
 
# It's done !
   −
Now the '''MLlib'''.  
+
'''libz''' has to be installed also.
 +
# Download it at [http://louislagrange.free.fr/MLlib/downloads/libz_wii.zip my FTP] or elsewhere.
 +
# Extract it and place the .a in "devkitpro\libogc\lib\wii" and the two files .h in "devkitpro\libogc\include".
 +
# It's done !
 +
 
 +
You will need '''FreeType-PPC''' to compile your code.
 +
# Download it [[Media:FreeType-PPC.rar|here]].
 +
# Extract it and place the .a in "devkitproc\libogc\lib\wii" and the folder "freetype" and the file "ft2build.h" in "devkitpro\libogc\include".
 +
# It's done !
 +
 
 +
You'll also need to set the '''environment variable''' of the library.
 +
# Right-Click on My Computer and select Properties.
 +
# Go to advanced settings and click Environment Variables at the bottom.
 +
# Verify that the DEVKITPRO and DEVKITPPC are already in there.
 +
# Add that variable : "MLPATH" and its value "/path/to/MLlib" (It should be "/c/devkitpro/MLlib")
 +
 
 +
Now the '''MLlib''' it self.  
 
# Download the MLlib on the [http://code.google.com/p/mllib/downloads/list Google Code MLlib page]
 
# Download the MLlib on the [http://code.google.com/p/mllib/downloads/list Google Code MLlib page]
 
# Extract the archive and place the folder (recommended in C:\devkitPro)
 
# Extract the archive and place the folder (recommended in C:\devkitPro)
 
# Examples, documentation and more are in the "MLlib_Others_XXXXXX.zip" package.
 
# Examples, documentation and more are in the "MLlib_Others_XXXXXX.zip" package.
# Set the environment variable "MLPATH" to your path to the MLlib. (eg. "/c/devkitPro/MLlib" because it must be linux-style) To do that, open the Start menu, right-click on Computer -> Properties, then go to the advanced settings -> environments variables. Set it there. It's recommended to restart the computer.
+
# Verify that you've set the environment variable. If compiling an example doesn't work, restart the computer and try again to compile. If you still can't, go to the forums or contact me ! ;) (Twitter or email)
 
# It should be done ! Go explore examples ! :D (test if it works via an example)
 
# It should be done ! Go explore examples ! :D (test if it works via an example)
    
===On Linux===
 
===On Linux===
   −
First you need to have '''devKitPro''' installed. Go [[Devkitppc setup (Linux)|install]] it ! ;)
+
First you need to have '''devkitPro''' installed. Go [[Devkitppc setup (Linux)|install]] it ! ;)
   −
Then, '''libpng''' for Wii must be installed.  
+
Then, '''libpng''' for Wii must be installed.
# Download it at [http://louislagrange.free.fr/MLlib/downloads/libpng_wii.zip my FTP].  
+
# Download it at [http://louislagrange.free.fr/MLlib/downloads/libpng_wii.zip my FTP] or elsewhere.  
 
# Extract it and place the .a in "devkitpro/libogc/lib/wii" and the folder "png" in "devkitpro/libogc/include".
 
# Extract it and place the .a in "devkitpro/libogc/lib/wii" and the folder "png" in "devkitpro/libogc/include".
 
# It's done !
 
# It's done !
 +
 +
'''libz''' has to be installed also.
 +
# Download it at [http://louislagrange.free.fr/MLlib/downloads/libz_wii.zip my FTP] or elsewhere.
 +
# Extract it and place the .a in "devkitpro/libogc/lib/wii" and the two files .h in "devkitpro/libogc/include".
 +
# It's done !
 +
 +
You will need '''FreeType-PPC''' to compile your code.
 +
# Download it [[Media:FreeType-PPC.rar|here]].
 +
# Extract it and place the .a in "devkitpro/libogc/lib/wii" and the folder "freetype" and the file "ft2build.h" in "devkitpro/libogc/include".
 +
# It's done !
 +
 +
You'll also need to set the '''environment variable''' of the MLlib.
 +
# Edit the file "/etc/environment" in root mode (sudo gedit /etc/environment)
 +
# Add these lines if they're not already in the file : DEVKITPRO="/path/to/devkitpro" DEVKITPPC="/path/to/devkitpro/devkitPPC"
 +
# Add : MLPATH="/path/to/devkitpro/MLlib"
 +
# Save and close the editor.
 +
# Type "source /etc/environment" in the console or reboot.
    
Now the '''MLlib'''.  
 
Now the '''MLlib'''.  
Line 56: Line 89:  
# Extract the archive and place the folder where you want (recommended in /home/user/devkitpro)
 
# Extract the archive and place the folder where you want (recommended in /home/user/devkitpro)
 
# Examples, documentation and more are in the "MLlib_Others_XXXXXX.zip" package.
 
# Examples, documentation and more are in the "MLlib_Others_XXXXXX.zip" package.
# Set the environment variable "MLPATH" to your path to the MLlib. (eg. "/home/username/devkitpro/MLlib") To do that, open and type in a new console:
+
# Verify that you've set the environment variable. If compiling an example doesn't work, restart the computer and try again to compile. If you still can't, go to the forums or contact me ! ;) (Twitter or email)
export MLPATH=/path/to/MLlib
+
# It should be done ! Go explore examples ! :D (test if it works via an example)
 
  −
 
  −
It should be done ! Go explore examples ! :D
  −
(test if it works via an example)
      
===On Mac OS X===
 
===On Mac OS X===
Line 80: Line 109:  
==="MLlib_Others_XXXXXX.zip" package===
 
==="MLlib_Others_XXXXXX.zip" package===
 
It can be downloaded on [http://code.google.com/p/mllib/downloads/list Google Code] !
 
It can be downloaded on [http://code.google.com/p/mllib/downloads/list Google Code] !
  −
===Error when compiling the template/examples ?===
  −
To test correctly the examples and the template, make sure you have done a "make clean" before, because it will give you the error
  −
make[1]: *** No rule to make target `/home/minishlink/devkitpro/MLlib_Others/template/source/main.c', needed by `main.o'. Stop.
  −
if you don't do this ! :p
      
===Makefile & Commands===
 
===Makefile & Commands===
Line 100: Line 124:  
You have to put the original [[Wiiload]] program (eg. the command-line program, which is provided with Twilight Hack or HBC) in the system folder of your OS. Example : "C:\Windows\System32" for Windows ; "/usr/bin" for Linux ; "??? #FixIt" for MaxOSX.
 
You have to put the original [[Wiiload]] program (eg. the command-line program, which is provided with Twilight Hack or HBC) in the system folder of your OS. Example : "C:\Windows\System32" for Windows ; "/usr/bin" for Linux ; "??? #FixIt" for MaxOSX.
   −
Wiiload program can be downloaded [http://louislagrange.free.fr/downloads/wiiload.tar.gz here] or in the [[Hackmii Installer]] (beta 3 or newer).
+
Wiiload program can be downloaded [http://bootmii.org/download here]. (in the HackMii Installer package)
    
====Make all====
 
====Make all====
 
It cleans the project, then compiles and then sends to the Wii.
 
It cleans the project, then compiles and then sends to the Wii.
 +
 +
== FAQ ==
 +
 +
===I got an error when I compile your examples...===
 +
To test correctly the examples and the template, make sure you have done a "make clean" before, because it will give you the error
 +
make[1]: *** No rule to make target `/home/minishlink/devkitpro/MLlib_Others/template/source/main.c', needed by `main.o'. Stop.
 +
if you don't do this ! :p
 +
 +
===I got a code dump when it loads my image...===
 +
Make sure your file is a multiple of 4 and is a 32bits png image with transparency enabled.
 +
 +
===I got some multiple definition errors when I compile...===
 +
This can happen sometimes, I don't know why. (for me it compiles well) But the solution is [http://code.google.com/p/mllib/issues/detail?id=1 there]. :)
 +
 +
===I got "undefined reference to 'FT_Done_FreeType'" when I compile...===
 +
If you're upgrading to 1.2 or newer, you could have this error. In order to compile your project you'll need to install FreeType-PPC, check how to do it [[MLlib#How to install ?|here]] in the '''FreeType-PPC''' section. :)
    
==Bugs & Suggestions==
 
==Bugs & Suggestions==
Line 133: Line 173:     
==Update History==
 
==Update History==
 +
 +
===1.3 - January 19, 2011===
 +
Compatible with DevkitPPc r22, libogc 1.8.6 and libfat 1.0.8.
 +
* FreeTypeGX updated (0.3.1)
 +
* Metaphrasis updated (0.1.2)
 +
* uthash updated (1.9.1)
 +
* fixed: ML_AnimateSpriteEx & ML_AnimateSpriteEx2
 +
* added: ML_EnableTextureAntiAliasing() (AA is disabled by default)
 +
* added: ML_DisableTextureAntiAliasing()
 +
* modified: ML_DrawRect() now can be filled or not (and bug with color fixed)
 +
* added: ML_DrawCircle(x, y, radius, rgba, filled)
 +
* fixed:  Issue #1  (finally! :D).
 +
* fixed: possible buffer overflow with sprite texts.
 +
* fixed: sprite texts were not at the right y coordinate.
 +
* fixed: no more skipped characters with sprite texts when auto jumping lines. (and textBox)
 +
* improved: TTF text speed-up
 +
* fixed: Underline and strike now applying well when jumping lines with TTF fonts
 +
* fixed: Jumping lines correctly with TTF fonts.
 +
* fixed: anti-aliasing with modified textures
 +
* added: u32 ML_ElapsedTime()
 +
* added: ML_Wait(ms)
 +
* fixed: possible code dump with ML_DrawRect() (forgot GX_End, lol)
 +
* fixed: ML_ElapsedTime() now returns the true elapsed time since the app launch (not since Wii launch)
 +
* modified: ML_DrawText -> You can now use arguments !
 +
* modified: ML_DrawText -> Use \n and \t instead of %n and %t, also use #cX instead of %cX
 +
* updated: template Makefile, now type "make emu" and if you have Dolphin Emulator installed, the dol will load immediately ! :)
 +
* fixed: Code dump when using ML_DrawText(), you have to use #n and #t instead of \n and \t, sorry.
 +
* fixed: possible weird things happening on the screen
 +
* Added strucutre ML_TextInfo to store infos about a text to be drawn (width, height, numbers of characters that will be printed) returned by ML_GetTextInfo()
 +
* documentation update
 +
* optimizations
 +
 +
===1.2 - December 24, 2009===
 +
Compatible with DevkitPPC r19 and libogc 1.8.1. Go update them ! :)
 +
TTF Font support, at last ! :)
 +
Collisions detection functions ! :)
 +
* added: float ML_Distance(x1, y1, x2, y2)
 +
* added: float ML_TrueDistance(x1, y1, x2, y2)
 +
* added: bool ML_IsCollisionSpriteRect(sprite, x, y, width, height)
 +
* added: bool ML_IsCollisionSpriteCircle(sprite, centerX, centerY, radius)
 +
* added: bool ML_IsCollisionRectRect(x1, y1, width1, height1, x2, y2, width2, height2)
 +
* added: bool ML_IsCollisionCircleCircle(centerX1, centerY1, radius1, centerX2, centerY2, radius2)
 +
* added: bool ML_IsCollisionRectCircle(x, y, width, height, centerX, centerY, radius)
 +
* added: ML_Font structure
 +
* added: ML_InitFont()
 +
* added: ML_QuitFont()
 +
* added: ML_DeleteFont(ML_Font *font)
 +
* added: ML_LoadFontFromBuffer(ML_Font *font, const uint8_t *filename, FT_Long bufferSize, FT_UInt pointSize)
 +
* added: ML_LoadFontFromFile(ML_Font *font, const char *filename, FT_UInt pointSize)
 +
* added: ML_DrawText(ML_Font *font, int x, int y, char *text, ...) (arguments are not currently working though)
 +
* fixed: relative paths now working
 +
* fixed: ML_ShutdownWii() now freeing like ML_Exit()
 +
* fixed: ML_ReturnToWii() now freeing like ML_Exit()
 +
 +
===1.1.5b - October 14, 2009===
 +
Now compatible with DevkitPPC r18 and libogc 1.8.0. Go update them ! :)
 +
* added: ML_GetFPS()
 +
* added: ML_AnimateSpriteEx2(ML_Sprite *sprite, bool enabled, u8 waitForXRefreshBetweenFrames, u8 from, u8 to, u8 timesLooped)
 +
* fixed: bug when you had more than one Wiimote
 +
* fixed: bug when using ML_Cursor with animated or tiled sprite
 +
* fixed: ML_AnimateSpriteEx wasn't doing his job properly, skipping one frame.
 +
 +
===1.1.5 - September 05, 2009===
 +
* added: ML_InitRand()
 +
* added: ML_Rand(min, max)
 +
* added: Wiimote[x].IR.Angle
 +
* added: New sprite flipping system (ML_FlipSpriteX, ML_FlipSpriteY,
 +
ML_FlipSpriteXY)
 +
* added: ML_EnableClipping(), ML_DisableClipping
 +
* added: ML_IsWiimoteInSpriteEx()
 +
* modified: ML_SplashScreen(), there's a fadeIn and a fadeOut now.
 +
* fixed: ML_FadeIn() and ML_FadeOut().
 +
* fixed: ML_IsWiimoteInSprite, it's now working well. Don't use ML_IsCollision
 +
and ML_IsCollisionEx for collision between sprite cursor and another sprite. Use
 +
ML_IsWiimoteInSprite instead - and that's logical.
 +
* fixed: ML_IsCollision and ML_IsCollisionEx, there was a bug with tiled or
 +
animated sprites.
 +
* removed: ML_FlipImageX, ML_FlipImageY
 +
 
===1.1 - June 20, 2009===
 
===1.1 - June 20, 2009===
 
* New method of programming. It uses seriously very less memory now. ML_Image, ML_Sprite, ML_Background.
 
* New method of programming. It uses seriously very less memory now. ML_Image, ML_Sprite, ML_Background.
Line 157: Line 276:  
===1.0 - May 31, 2009===
 
===1.0 - May 31, 2009===
 
* First public release
 
* First public release
 +
 +
[[Category:Open_source_homebrew]]
 
[[Category:Homebrew using GRRLib]]
 
[[Category:Homebrew using GRRLib]]
 +
[[Category:Homebrew using FreeTypeGX]]
172

edits

Navigation menu