android
  #1  
Old 11-27-2011, 03:45 PM
delirius delirius is offline
Member
 
Join Date: Feb 2010
Posts: 131
Default multiplatform compatibility framework update 1.1.1

Love compatibility framework for zen x-fi2 lua
by Delirius
current version 1.1.1
How to use:

1)
copy dir "loveCompatibility" and file "conf.lua" to your app dir.

2)
To include and initialize love compatibility,
at the beginning of main.lua add:
require "loveCompatibility.load";
main = function()

And at the end of main.lua add:
end;
if(love) then
love.run = main;
else
main();
end;

As seen in example main bundled with this release.

3)
change settings in "conf.lua"
what you should change:
- t.console
- t.title
- t.author
- t.screen.width
- t.screen.height
(fullscreen doesn't work)

Buttons:
home button is mapped to escape.
power button is mapped to f1.

File operations:

In love framework you can't write to application source folder.
Every write operation is done into application data folder
(on winsows7 it is "C:\Users\User\AppData\Roaming"). More information
can be found in "http://love2d.org/wiki/love.filesystem".
loveCompatibility copies all read and written files
from source folder and all new files to data folder.
Files can be deleted only in data folder, so if you have
copy of file in your source folder, you can never get rid of it.

Image resources bins:
As with zen you can use images packed into resource bins. For packing and unpacking use ThievingSix's X-Fi2 Resource Compiler/Decompiler. When resource bin is used to load image, its contents are unpacked to data directory into _ResBin_ directory. Btw. Zen resource bins aren't compressed.

Implementation:
working functions "http://en.wikipedia.org/wiki/User:Thieving6/X-FI_2_Lua"

Usable tables:
- string
- package
- image
- os
- button
- touch
- control
- screen
- color
- text (need original font)
- io
- coroutine (maybe)
- math
- table
- coroutine
- debug
- audio
- wav
+ most misc functions

Missing tables:
- accelerometer (i have no idea, how to implement it)

Functions which doesn't work properly:
- screen.backlight (obviously)
- screen.orientation (to be done)
- image.setbg (who knows what it does anyway?)
- image.fill (never used it anyway)
- os.rename (does someone use it anyway?)
- io.popen (zen x-fi2 lua doesn't have this function working)
- io.popen (zen x-fi2 lua doesn't have this function working)
- io.tmpfile
- io.output
- io.input
- io.stdin
- io.stdout
- io.stderr
- print (on love works differently)

History:

1.1.1
- fix: touch messages

1.1.0
- made compatible with Love2d 0.8.0
- compatibility with Love2d 0.7.2 is lost
- fix: text color works

1.0.1
- fix: loading image

1.0
- wav table
- audio table
- image.setresource

0.8 initial public release

To run example in Love2d simply change extension from zip to love.
Added second Zip with new updated version for compatibility with Lova2d 0.8.0
Attached Images
File Type: png luave.png (6.3 KB, 108 views)
Attached Files
File Type: zip Luave_release (1.0.1).zip (20.3 KB, 51 views)
File Type: zip Luave(1.1.1)_for_love2d(0.8).zip (33.4 KB, 14 views)

Last edited by delirius; 08-21-2012 at 03:39 AM. Reason: update 1.1.1
Reply With Quote

Advertisement [Remove Advertisement]

  #2  
Old 11-27-2011, 06:06 PM
Kalle Kula Kalle Kula is offline
Junior Member
 
Join Date: May 2010
Posts: 39
Default

greate thinking... but what of a enviorment are we using..?
Quote:
With this framework included in your app, you can run it on zen x-fi2 and Love.
I have to install löve and lua libs and run the app from a command-line?

Last edited by Kalle Kula; 11-28-2011 at 03:16 AM.
Reply With Quote

  #3  
Old 11-28-2011, 04:37 AM
delirius delirius is offline
Member
 
Join Date: Feb 2010
Posts: 131
Default

Quote:
Originally Posted by Kalle Kula View Post
greate thinking... but what of a enviorment are we using..?

I have to install löve and lua libs and run the app from a command-line?
You can install love only. Or make executable for your platform (for win, linux or osx). More information can be found here.

I have added download links
Reply With Quote

  #4  
Old 11-30-2011, 05:36 AM
Kalle Kula Kalle Kula is offline
Junior Member
 
Join Date: May 2010
Posts: 39
Thumb Up Standalone App

I have been able to do a love-version of my chess app and the speed improvements compared to the ADK simulator is amazing.

The standalone app fails and maybe It's not necessary to have that, anyway if you got some clue how to solve it.
I get the same errors in Linux, Linux-Wine and Windows XP:

Quote:
[toti@koket Dokument]$ ./ChessX
Warning, quality setting failed! (Result: buffers: 0, samples: 0)
Error: [string "loveCompatibility/io2.lua"]:57: Could not set write directory.
stack traceback:
[C]: in function 'open'
[string "loveCompatibility/io2.lua"]:57: in function '_copyLoveFile'
[string "loveCompatibility/io2.lua"]:109: in function 'open'
[string "main.lua"]:618: in function 'RestoreFromFile'
[string "main.lua"]:643: in main chunk
[C]: in function 'require'
[string "boot.lua"]:1: in function <[string "boot.lua"]:1>
[C]: in function 'xpcall'
[toti@koket Dokument]$
Quote:
function RestoreFromFile()
local f = io.open("fen.fen","r")
if f ~= nil then
local s = f:read("*all")
if s ~= nil and string.len(s) > 0 then
InitializeFromFen(s)
c_usebook = false
end
f:close()
end
end
And as I said the love-version working fine.
Reply With Quote

  #5  
Old 11-30-2011, 05:34 PM
delirius delirius is offline
Member
 
Join Date: Feb 2010
Posts: 131
Default

Try running it as admin. Or sudo if i am not mistaken on Linux (not expert there .
I seems it failed to create file or dir in user space. Could you send it to me? I will look at it tomorrow.

Btw. do you have all necessary libs with standalone binary of your game?
Reply With Quote

  #6  
Old 12-02-2011, 06:01 AM
Kalle Kula Kalle Kula is offline
Junior Member
 
Join Date: May 2010
Posts: 39
Default

Quote:
Try running it as admin. Or sudo if i am not mistaken on Linux (not expert there) .
As admin/sudo,get the same error.
Quote:
I seems it failed to create file or dir in user space. Could you send it to me? I will look at it tomorrow.
I try to send it to you if the message-system aloud me(the zip file is 640kb).
Quote:
Btw. do you have all necessary libs with standalone binary of your game?
Yes 2 tries, I put the exe in the same folder as your working app (love-0.7.2-win-x86) and a second try with making a folder with the exe and copy the libs from C:\Program\Love.

I guess the only reason to do a stand-alone app is that you don't have to update it if the Löve or the dependent libs gets updated.

So don't spend so much time and effort on that(as it can be hard to detect ugliness of character-sets/path/case/name-mangling/... between Löve/Lua/Linux/Windows and DOS?).
the ("copy /b love.exe+game.love game.exe") looks like DOS (not expert there), did you use that for your example-app

I rather see that you try to get the wave/audio implemented.
Reply With Quote

  #7  
Old 12-05-2011, 05:53 PM
delirius delirius is offline
Member
 
Join Date: Feb 2010
Posts: 131
Default

new version with tables:
- audio
- wav
and resource bin support for loading images
Reply With Quote

  #8  
Old 12-05-2011, 06:22 PM
delirius delirius is offline
Member
 
Join Date: Feb 2010
Posts: 131
Default

Quote:
Originally Posted by Kalle Kula View Post
I have been able to do a love-version of my chess app and the speed improvements compared to the ADK simulator is amazing.

The standalone app fails and maybe It's not necessary to have that, anyway if you got some clue how to solve it.
I get the same errors in Linux, Linux-Wine and Windows XP:

And as I said the love-version working fine.
Found solution on love forum.
When you want to distribute app as exe you have to manually set identity in conf.lua. I tested it and it works.
Reply With Quote

  #9  
Old 02-01-2012, 05:16 AM
Kalle Kula Kalle Kula is offline
Junior Member
 
Join Date: May 2010
Posts: 39
Default

I do a repost in the right thread. My original question was this:
Quote:
Have you tested your app on the player?
I hear no sound from your app on my player. I have done som tries to get my app working with sounds and löve and have got the sounds work on player but not in löve ?!
And found a solution for your app by changing the call to wav.play()
Code:
if love then
wav.play(0)
else
wav.play()
end
And also resampling the click.wav from 24 bit mono to 16 bit stereo or else the player do a hardcrash (rebuilding).
And this things also solves things for my app
Reply With Quote

  #10  
Old 02-05-2012, 09:53 AM
delirius delirius is offline
Member
 
Join Date: Feb 2010
Posts: 131
Default

i did some changes so you dont have to longer do:
Quote:
if love then wav.play(0) else wav.play() end
But i have problem converting click.wav. Audacity crashes every time.
Could you please send me converted wav. Thank you in advance.
Reply With Quote

  #11  
Old 02-06-2012, 06:31 AM
Kalle Kula Kalle Kula is offline
Junior Member
 
Join Date: May 2010
Posts: 39
Default

The message system don't aloud me to send a wav file. I guess you could use any short sound from apps in Application folder. If you have my BC Forest you can use the on.wav in the snd folder, Laserstrike also have a click sound. Using your app on the player the sound fades away slowly(volume gets lower with every click). See: http://www.anythingbutipod.com/forum...ghlight=volume Another quick and dirty solution is; as you have os.wait(200); in the while loop
Code:
mysound:close();
mysound = wav.load(wavFile);
mysound:play()
In love, using windows(minimize/maximize), I think developer have to do a full screen redraw in some short cycle as you have done.
Reply With Quote

  #12  
Old 08-07-2012, 04:50 PM
delirius delirius is offline
Member
 
Join Date: Feb 2010
Posts: 131
Default

Added second Zip with new updated version for compatibility with Lova2d 0.8.0.
Thanks to new version of love2d i have solved redrawing screen problem caused by buffering.
Reply With Quote

  #13  
Old 08-16-2012, 03:33 AM
Kalle Kula Kalle Kula is offline
Junior Member
 
Join Date: May 2010
Posts: 39
Default touch messages

I have tested your work and it seems to handle touch messages differently.
No touch move or hold and always get a click message then the mouse has moved.

I have used the creatives TouchDemo that is included in the simulator download for testing.
Reply With Quote

  #14  
Old 08-16-2012, 07:15 AM
delirius delirius is offline
Member
 
Join Date: Feb 2010
Posts: 131
Default

Quote:
Originally Posted by Kalle Kula View Post
I have tested your work and it seems to handle touch messages differently.
No touch move or hold and always get a click message then the mouse has moved.

I have used the creatives TouchDemo that is included in the simulator download for testing.
I will look into it. Have you used previous version of this lib? Is it different?
Reply With Quote

  #15  
Old 08-16-2012, 11:06 AM
Kalle Kula Kalle Kula is offline
Junior Member
 
Join Date: May 2010
Posts: 39
Default

Using the same TouchDemo app with Love 0.7.2 and your earlier lib working fine (tested with Windows Vista). The new lib was tested using Windows XP and linux-fedora
Reply With Quote

  #16  
Old 08-18-2012, 03:11 AM
delirius delirius is offline
Member
 
Join Date: Feb 2010
Posts: 131
Default

update uploaded (version 1.1.1)
I hope i fixed move and hold messages. It works for me now.
Reply With Quote

  #17  
Old 09-06-2012, 05:46 AM
Kalle Kula Kalle Kula is offline
Junior Member
 
Join Date: May 2010
Posts: 39
Default button.hold()

Touch messages working fine. Would be nice if you can do the same with button messages. I always get a button.click() and no button.hold()
Reply With Quote

  #18  
Old 09-16-2012, 03:59 PM
delirius delirius is offline
Member
 
Join Date: Feb 2010
Posts: 131
Default

Quote:
Originally Posted by Kalle Kula View Post
Touch messages working fine. Would be nice if you can do the same with button messages. I always get a button.click() and no button.hold()
ok, i will look into that.
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 03:30 PM.