Results 1 to 5 of 5

Thread: about save data

  1. #1
    Lesser Knight
    Join Date
    Oct 2007
    Posts
    57

    Default about save data

    Because I can't operate the XML file,so have another method to save player's
    data,I should use CL_? Somebody have try it,give me some advice,thanks in advance.

    my xml:

    <?xml version="1.0" encoding="iso-8859-1"?>
    <resources>
    <integer name="width" value="640"/>
    <integer name="height" value="480"/>
    <string name="name" value="The name of the game"/>
    </resources>

    now,I want modify value="640"->value="800",Please help me,my project have broken,I'm a indie game developer,please help me ,anybody here ???
    Last edited by DavinciZhe; 01-21-2008 at 03:15 PM.

  2. #2
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    In my opinion, this depends on the type of data to be saved.

    If portability and security of saved data is not an issue, use fopen(), fread(), fwrite() and fclose() on your binary data structure.

    If portability is required, use XML ... else:
    1) Import / Export as text
    2) Use ClanLib 0.9 CL_IODevice's endian conversions (eg file.write_uint16)
    3) Write your own endian routines and use fopen() etc
    But XML is recommended

  3. #3
    Lesser Knight
    Join Date
    Oct 2007
    Posts
    57

    Default

    thanks fopen() can use on Mac X ?Sorry,I never use Mac,but this game need to run on Mac,I decide use fopen().

  4. #4
    ClanLib Developer
    Join Date
    May 2007
    Posts
    1,824

    Default

    Everything should have fopen() ... http://en.wikipedia.org/wiki/Stdio.h

  5. #5
    Lesser Knight
    Join Date
    Oct 2007
    Posts
    57

    Default

    I'm foolish.I saw the 'XML' example,all resolve.Thanks your advice,hope you longevity.

Similar Threads

  1. CL 0.8 pixel data deleter class
    By Trigve in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 10-27-2007, 11:33 AM
  2. How to use the vector data from CL_Raw ?
    By ARme in forum Official ClanLib SDK Forums
    Replies: 0
    Last Post: 12-21-2006, 08:35 PM
  3. I am trying to save nadines girl
    By in forum Dink Smallwood HD
    Replies: 3
    Last Post: 07-02-2005, 12:47 AM
  4. Save feature...?
    By in forum Dungeon Scroll for PC and iPhone
    Replies: 2
    Last Post: 10-22-2004, 01:39 PM
  5. Replies: 3
    Last Post: 08-25-2004, 11:27 PM

Bookmarks

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
  •