Difference between revisions of "MLlib"

From WiiBrew
Jump to navigation Jump to search
(Release 1.1.5)
(MLlib Release 1.1.5b)
Line 4: Line 4:
 
| type = framework library
 
| type = framework library
 
| author = [[User:Minishlink|Minishlink]]
 
| author = [[User:Minishlink|Minishlink]]
| version = 1.1.5
+
| version = 1.1.5b
 
| 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 = http://wiibrew.org/wiki/Talk:MLlib
 
}}
 
}}
  
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 ! ;)
  
[OPTIONAL] Then, '''libpng''' for Wii must be installed '''if you want to change library only''' !
+
[OPTIONAL] Then, '''libpng''' for Wii must be installed. ('''if you want to re-code the library only''' !)
# 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 !
Line 47: Line 47:
 
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 ! ;)
  
[OPTIONAL] Then, '''libpng''' for Wii must be installed '''if you want to change library only''' !
+
[OPTIONAL] Then, '''libpng''' for Wii must be installed. ('''if you want to re-code the library only''' !)
# 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 !
Line 136: Line 136:
  
 
==Update History==
 
==Update History==
 +
 +
===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===
 
===1.1.5 - September 05, 2009===

Revision as of 13:16, 14 October 2009

MLlib
MLlib 2 175x175.png
General
Author(s)Minishlink
TypeFramework library
Version1.1.5b
Links
Download
Website
Discussion
Source

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...

Features

  • Proper code so that it's nice to see;
  • Easy for all;
  • Friendly functions;
  • Handles drawing;
  • Sprite system;
  • Handles PNG images;
  • Special effects;
  • Write graphically text;
  • MP3 system;
  • MOD system;
  • Input (Wiimote, Nunchuk, and extensions...) system;
  • And much more...

How to install ?

On Windows

First you need to have the lastest devKitPro installed. Go install it ! ;)

[OPTIONAL] Then, libpng for Wii must be installed. (if you want to re-code the library only !)

  1. Download it at my FTP or elsewhere.
  2. Extract it and place the .a in "devkitpro\libogc\lib\wii" and the folder "png" in "devkitpro\libogc\include".
  3. It's done !

Now the MLlib.

  1. Download the MLlib on the Google Code MLlib page
  2. Extract the archive and place the folder (recommended in C:\devkitPro)
  3. Examples, documentation and more are in the "MLlib_Others_XXXXXX.zip" package.
  4. 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.
  5. It should be done ! Go explore examples ! :D (test if it works via an example)

On Linux

First you need to have devKitPro installed. Go install it ! ;)

[OPTIONAL] Then, libpng for Wii must be installed. (if you want to re-code the library only !)

  1. Download it at my FTP or elsewhere.
  2. Extract it and place the .a in "devkitpro/libogc/lib/wii" and the folder "png" in "devkitpro/libogc/include".
  3. It's done !

Now the MLlib.

  1. Download the MLlib on the Google Code MLlib page
  2. Extract the archive and place the folder where you want (recommended in /home/user/devkitpro)
  3. Examples, documentation and more are in the "MLlib_Others_XXXXXX.zip" package.
  4. 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:
export MLPATH=/path/to/MLlib


It should be done ! Go explore examples ! :D (test if it works via an example)

On Mac OS X

You should be able to do it if you read Windows/Linux instructions. Updated tutorial will coming soon though, with Mac OS X ;)

Notes

Quickstart

For a quickstart, see the section How to install ? and go see the examples in the "MLlib_Others_XXXXXX.zip" package ! ;)

Tutorials and Wiki

Some tutorials and more info are available at the MLlib Wiki.

Documentation

Online documentation is available here. Or in the "MLlib_Others_XXXXXX.zip" package.

"MLlib_Others_XXXXXX.zip" package

It can be downloaded on 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

Code Dump when loading an image ?

Make sure your file is a multiple of 4 and is a 32bits png image with transparency enabled.

Makefile & Commands

Editing Makefile

In order to use the MOD part of the MLlib, you need to uncomment the line "USE_MOD" at the top of the Makefile. It's the same thing when you need to compile code that uses MP3 or FAT.

Make

Compiles the project.

Make clean

Cleans the project, it destroys dependancies too.

Make run

It sends the app/game previously compiled to the Wii via the wiiload program. It's quiet useful because you don't need to type "wiiload projectXYZ.dol", "make run" is faster ! 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 here or in the Hackmii Installer (beta 3 or newer).

Make all

It cleans the project, then compiles and then sends to the Wii.

Bugs & Suggestions

If you have any bugs or suggestions, feel free to report them on Google Code.

See also

Special Thanks

  • Chaosteil
  • Cid2Mizard
  • Crayon
  • Dhewg
  • Dykam
  • EvilSpoon
  • Feesh
  • Mollusk
  • Morukutsu
  • NoNameNo
  • Svpe
  • T4ils
  • WntrMute
  • Zeblackos

and these communities :

  • www.dev-fr.org + IRC Channel #dev-fr
  • www.nintendomax.com
  • www.wiibrew.org + IRC Channel #wiidev
  • www.wiigen.fr

Update History

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

  • New method of programming. It uses seriously very less memory now. ML_Image, ML_Sprite, ML_Background.
  • added : ML_Screenshot(filename)
  • added : ML_IsSpriteVisible(sprite)
  • added : ML_AnimateSpriteEx(sprite, enabled, waitForXRefreshBetweenFrames, from, to)
  • added : ML_TextBox(ML_Sprite *sprite, x, y, x2, y2, const char *text, ...)
  • added : ML_DrawRect(int x, int y, u16 width, u16 height, u32 rgba)
  • added : ML_Debug(text)
  • added : ML_CloneImage(image1, image2)
  • added : ML_DrawSpriteTextLimit(sprite, x, y, text, limit)
  • added : ML_FlipImageX(image)
  • added : ML_FlipImageY(image)
  • added : ML_InvertImageColors(image)
  • added : ML_ApplyGrayscaleToImage(image)
  • added : ML_FlushImage(image)
  • modified : Input is now finished
  • modified : ML_GetPixelColor
  • modified : ML_SetPixelColor
  • modified : ML_SplashScreen
  • modified : ML_Cursor, so that it draws your cursor/sprite with the center of the image, and then modifies the sprite.x and sprite.y so that if you point to the left-up edge of the screen it gives you 0, 0.
  • fixes and optimizations

1.0 - May 31, 2009

  • First public release