Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Lua help

                  
   
  1. #1
    PSP Coder benh's Avatar
    Join Date
    Mar 2006
    Location
    linclonshire, England
    Posts
    362
    Rep Power
    71

    Unhappy Lua help

    Hi all

    I am helping make a lua app and i keep getting this error Image.load: error loading image now i dont think it can be a memoy leak because i have loadfile commands and not dofile commands and the script looks spotless!

    Please help!
    Benh = Coder, main language C other language LUA

    Check out my first C app Super - flasher here

    visit my dev site where you can download all of my coding projects - http://benh-pspdev.bravehost.com/



    Please visit my site www.pspfanatic.bravehost.com
    and join the forums

  2. #2
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    87

    Default

    Try loading a different image in the same place. Check if you have enough memory to actually load the image first. Check if the file path is correct.

  3. #3
    PSP Coder benh's Avatar
    Join Date
    Mar 2006
    Location
    linclonshire, England
    Posts
    362
    Rep Power
    71

    Default

    sorry heres the code

    black = Color.new(0, 0, 0)

    background = Image.load("backgrounds/1.png")
    loadA = loadfile("index2.lua")

    while true do

    pad = Controls.read()
    screen:blit(0, 0, background)

    if pad:cross() then
    loadA()
    end

    screen.waitVblankStart()
    screen:flip()
    end

    Edit - iv tried all those things you said
    Benh = Coder, main language C other language LUA

    Check out my first C app Super - flasher here

    visit my dev site where you can download all of my coding projects - http://benh-pspdev.bravehost.com/



    Please visit my site www.pspfanatic.bravehost.com
    and join the forums

  4. #4
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    87

    Default

    Try loading a different image in the same place. Check if you have enough memory to actually load the image first. Check if the file path is correct. Check if the image is valid. Check that the image exists.

  5. #5
    PSP Coder benh's Avatar
    Join Date
    Mar 2006
    Location
    linclonshire, England
    Posts
    362
    Rep Power
    71

    Default

    how do you check if you have enough memory and if i havnt how do i free up memory
    Benh = Coder, main language C other language LUA

    Check out my first C app Super - flasher here

    visit my dev site where you can download all of my coding projects - http://benh-pspdev.bravehost.com/



    Please visit my site www.pspfanatic.bravehost.com
    and join the forums

  6. #6
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    87

    Default

    Use the LuaPlayer function to check for free system memory. TO free up memory, you let the variable fall out of scope and garbarge collection takes care of the rest.

  7. #7
    PSP Coder benh's Avatar
    Join Date
    Mar 2006
    Location
    linclonshire, England
    Posts
    362
    Rep Power
    71

    Default

    could you give me the garbage collection code please and tell me where to put in the script
    Benh = Coder, main language C other language LUA

    Check out my first C app Super - flasher here

    visit my dev site where you can download all of my coding projects - http://benh-pspdev.bravehost.com/



    Please visit my site www.pspfanatic.bravehost.com
    and join the forums

  8. #8
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    87

    Default

    Garbarge Collection that exists in the languages available are automatic. Eg Java, C#.

    eg
    if true then
    local blah -- memory is allocated and the variable/reference is onto pushed the stack
    end
    -- blah is no longer in scope and is popped off the stack and garbarge collection frees the memory allocated for it since there is no reference to it anymore

  9. #9
    PSP Coder benh's Avatar
    Join Date
    Mar 2006
    Location
    linclonshire, England
    Posts
    362
    Rep Power
    71

    Default

    i still dont get it, what is the garbage collection code
    Benh = Coder, main language C other language LUA

    Check out my first C app Super - flasher here

    visit my dev site where you can download all of my coding projects - http://benh-pspdev.bravehost.com/



    Please visit my site www.pspfanatic.bravehost.com
    and join the forums

  10. #10
    GP2X Coder/Moderator
    Join Date
    Jan 2006
    Posts
    1,678
    Rep Power
    87

    Default

    There is no garbarge collection code. It is AUTOMATIC and part of the language feature.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •