Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en:packed_sheets [2017/01/30 09:52] – created osquallo | en:packed_sheets [2021/12/03 18:19] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Ryzom Data ====== | ||
| <WRAP info> | <WRAP info> | ||
| I am not sure those infos are already on the wiki and since i guess it can help to have it in french I also put this here. | I am not sure those infos are already on the wiki and since i guess it can help to have it in french I also put this here. | ||
| Line 9: | Line 8: | ||
| ====== Packed sheet ====== | ====== Packed sheet ====== | ||
| - | Packed Sheets | ||
| - | Summary | ||
| A packed sheet is a way of storing multiple Georges sheets in a binary format. What a packed sheet does is load all of the sheets/ | A packed sheet is a way of storing multiple Georges sheets in a binary format. What a packed sheet does is load all of the sheets/ | ||
| Line 17: | Line 14: | ||
| For packed sheets, you must declare a class that will be used by the form packer: | For packed sheets, you must declare a class that will be used by the form packer: | ||
| - | 1 - Create a class (or struct) that is needed to conform to the following interface: | + | ===== Create a class (or struct) that is needed to conform to the following interface: |
| + | <code cpp> | ||
| struct TMyLoader | struct TMyLoader | ||
| Line 69: | Line 67: | ||
| }; | }; | ||
| + | </ | ||
| Loader Structure/ | Loader Structure/ | ||
| Line 80: | Line 79: | ||
| Now that you have your class that conforms to the requirements of the packer and loader you have to create a container for the form loader to populate with sheets. This must always be like a map similar to the one below. | Now that you have your class that conforms to the requirements of the packer and loader you have to create a container for the form loader to populate with sheets. This must always be like a map similar to the one below. | ||
| - | 2 - Declare a container for all the loaded sheets: | + | ===== Declare a container for all the loaded sheets: |
| - | std:: | + | <code cpp>std:: |
| Usually Nevrax declares this globally but there is no constraint about that. It is used for a single call to loadForm (which is described below) and not for all sheets in an application. This method loads all of the sheets into the container. | Usually Nevrax declares this globally but there is no constraint about that. It is used for a single call to loadForm (which is described below) and not for all sheets in an application. This method loads all of the sheets into the container. | ||
| - | 3 - Call the packed sheet loader: | + | ===== Call the packed sheet loader: |
| - | loadForm( " | + | <code cpp>loadForm( " |
| Essentially what loadForm does is if told to go through the files with my_extension for an extension and check if there are newer ones than in the packed sheet, new ones period, or if some have been removed and marks these files appropriately in memory. It then loads all of the forms and puts them into cached lists and removes any files it found missing from the packed sheet. If it changed the container at all (added new files, updated changed files, or removed old files) it saves the file back out as the file passed in the parameter, which is packed_sheet_file_name.packed_sheets in the above example. In the process your map will be populated either via serialization (unchanged sheets) or by the readGeorges method (added or updated sheets.) | Essentially what loadForm does is if told to go through the files with my_extension for an extension and check if there are newer ones than in the packed sheet, new ones period, or if some have been removed and marks these files appropriately in memory. It then loads all of the forms and puts them into cached lists and removes any files it found missing from the packed sheet. If it changed the container at all (added new files, updated changed files, or removed old files) it saves the file back out as the file passed in the parameter, which is packed_sheet_file_name.packed_sheets in the above example. In the process your map will be populated either via serialization (unchanged sheets) or by the readGeorges method (added or updated sheets.) | ||
| Loading Notes | Loading Notes | ||
| - | | + | The packed sheet form loader requires that the file extension be .packed_sheets - however the logic lets you get away with .packed_sheetsbar for example. As a matter of practice though the packed sheet extension should stay with the standard. |
| - | The above function actually converts " | + | The above function actually converts " |
| + | <code cpp> | ||
| void loadForm (const std:: | void loadForm (const std:: | ||
| + | </ | ||
| - | | + | loadForm is a template function, as seen above it will deduce it's argument from the '' |
| Summary / Details | Summary / Details | ||
| Line 116: | Line 117: | ||
| It has to be in your search path, then you call the init method in CSheetId (or somethink near that) | It has to be in your search path, then you call the init method in CSheetId (or somethink near that) | ||
| + | <code cpp> | ||
| CSheetId:: | CSheetId:: | ||
| + | </ | ||
| Source: [[http:// | Source: [[http:// | ||
| {{tag> | {{tag> | ||





