Jump to content

Roland

Members
  • Posts

    2,953
  • Joined

  • Last visited

Posts posted by Roland

  1. When writing to a file using FileSystem/Stream the content is not flushed to disk directly when the filehandler is set to nil. A close() or flush() function would be a solution to this. Here is my test

     

    -- FILE IO TEST
    local fw = FileSystem:WriteFile("test.bin")
    if fw ~= nil then
    System:Print( "*** FILE WRITE" )
    fw:WriteInt(12345)
    fw = nil
    end
    
    local fr = FileSystem:ReadFile("test.bin")
    if fr ~= nil then
    local value = fr:ReadInt()
    System:Print("*** FILE READ = " .. value )
    fr = nil
    end

     

    The result

     

    =====================================================

    *** FILE WRITE

    *** FILE READ = 0

    =====================================================

     

     

    After the program has finished the content is 12345 as it should be.

     

    Here is the same with LUA io-operations which works

     

    --- FILE IO TEST
    local fw = io.open("test.bin", "wb")
    if fw ~= nil then
    System:Print( "*** FILE WRITE" )
    fw:write(12345)
    fw:close()
    end
    
    local fr = io.open("test.bin", "rb")
    if fr ~= nil then
    local value = fr:read()
    System:Print("*** FILE READ = " .. value )
    fr:close()
    end

     

    and the correct result

     

     

    =====================================================

    *** FILE WRITE

    *** FILE READ = 12345

    =====================================================

  2. In the current version of Leadwerks, you can disable the console window by putting this in main.cpp:

     

    // This will remove the cmd window from showing up with our window.
    #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
    

    That was a nice one. I always have replaced the main with WinMain, changed the subsystem and fixed the argv stuff. This is far better. Great

    • Upvote 1
  3. In what I'm working I have an inventory showing items collected along the way. Those items are collected by picking them (using a raycast for that). Now that works great. Currently I have made an icon image for each item that can be picked and added to the inventory. The inventory then show a list of those icons.

     

    Even if that works I would really prefer to have some automation here.

     

    What I would like to do is to render the item picked to an icon image (32x32) and then use that image as icon. This way I wouldn't have to go through the trouble of making icons for every object that can be picked and added to the inventory.

     

    The render would also have to zoom in so the entity fills the image. Anyone have done such a thing or at least have some hints on how to do that?

  4. Thanks all for the input. It makes it a bit clearer what the difference between the two callbacks are. As I have it now I have mouse-smoothing and such in UpdateWorld, seems that it would be better to have that in UpdatePhysics if I understand this correctly. Same for updating animations I guess.

  5. No reason why you would need Josh to create the project file. You could start from the Linux codeblocks project file and add an additional build target. Don't forget to configure the compiler settings for MSVC first.

    You are missing the point. I personally have no problem doing that. It's more a question about what's official supported.

    • Upvote 1
  6. Hmm. I've never used CodeBlocks. Not sure if you've ever considered the advantages of Visual Studio over it, if any.

    There are now direct advantages other than you don't need to have two sets of project files if you are making your game for both Linux and Windows (and ..maybe later om MAC). The idea and advantage is to have one IDE and project for all platforms. Josh would also gain from that as he wouldn't have to keep track of project templates for several different IDE's.

  7. Why not make life more easy and go for CodeBlocks on Windows as in Linux. One IDE for both environments. Saves time for the user and for you Josh. One IDE to support instead of two. And when the day for MAC comes CodeBlocks will work there also. Better for us users and better for you Josh as you don't have to jump between different IDE's not to talk about the maintenance of project files.

  8. I would not recommend changing anything in the Leadwerks header to solve a local compilation problem. There is nothing wrong with the Leadwerks headers. The problem is local to your installation. Solve the path-include problems instead of editing the headers.

     

    Maybe you should give a re-installation of Leadwerks a try as the problems you describe should simply not exist in a fresh installation on Windows. If that doesn't work you could always post you project file here or PM me. Two files are of interest "projectname".vcxproj and PropertySheet.props, where "projectname" is the name of you project.

×
×
  • Create New...