forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OSLib Save data

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
homemister



Joined: 24 Mar 2008
Posts: 25

PostPosted: Fri Aug 08, 2008 5:39 pm    Post subject: OSLib Save data Reply with quote

hey all,
I am having dome trouble saving an image loaded from oslib to a savedata file.

Code:
int end = 0;
char gameTitle[50] = "LPHMv2";

char gameID[10] = "HM";

char saveName[10] = "HM";

char nameList[][20] =   // End list with ""

{

 "0000",

 "0001",

 "0002",

 "0003",

 "0004",
 "0005",

 "0006",

 "0007",

 "0008",

 "0009",
 "0010",

 ""

};

char data[256] = "someData: 50";

struct oslSaveLoad saveLoadData;

    int type = OSL_DIALOG_NONE;

    int skip = 0;

    char message[256] = "";

    char loadedData[256] = "";
    OSL_IMAGE *img = oslLoadImageFilePNG("ms0:/test.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888);
    memset(&saveLoadData, 0, sizeof(saveLoadData));

    strcpy(saveLoadData.gameTitle, gameTitle);

    strcpy(saveLoadData.gameID, gameID);

    strcpy(saveLoadData.saveName, saveName);

    saveLoadData.nameList = nameList;
    saveLoadData.pic1 = (unsigned char *)img->data;

    saveLoadData.size_pic1 = img->totalSize;

    saveLoadData.data = data;

    saveLoadData.dataSize = 256;

    oslInitSaveDialog(&saveLoadData);

    memset(message, 0, sizeof(message));

    while(end == 0){

   type = oslGetSaveLoadType();

   if (!skip){

            oslStartDrawing();

            if (type != OSL_DIALOG_NONE){

                oslDrawSaveLoad();

                if (oslGetLoadSaveStatus() == PSP_UTILITY_DIALOG_NONE){

                    if (oslSaveLoadGetResult() == OSL_SAVELOAD_CANCEL)

                        sprintf(message, "Cancel");

                    else if (type == OSL_DIALOG_SAVE)

                        sprintf(message, "%s", (char *)saveLoadData.data);

                    oslEndSaveLoadDialog();
          end = 1;

                }

            }

            oslEndDrawing();

        }

        oslEndFrame();

        skip = oslSyncFrame();

    }


could anyone help?
regards
Homemister
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group