Advertisement
Guest User

Untitled

a guest
Sep 30th, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.19 KB | None | 0 0
  1. typedef struct
  2. {
  3.     float32 wall_vertex[2][2];
  4.  
  5.     int8 wall_texture_id[4];
  6.     int16 wall_lightmap_id[4];
  7.  
  8.     int8 flat_texture_id[2];
  9.     int16 flat_lightmap_id[2];
  10.  
  11.     int8 cell_type;
  12.  
  13.     int8 was_floor_negative;
  14.     int8 was_ceil_negative;
  15.  
  16.     int8 is_lightmapped;
  17.  
  18. } sLV_Cell__File_Only;
  19.  
  20. typedef struct
  21. {
  22.     sLV_Cell__File_Only map[LV_MAP_CELLS_COUNT];
  23.  
  24.     char wall_texture_filename[128][IO_MAX_STRING_TEX_FILENAME];
  25.     char flat_texture_filename[128][IO_MAX_STRING_TEX_FILENAME];
  26.  
  27.     char title_01[IO_MAX_STRING_TITLE];
  28.     char title_02[IO_MAX_STRING_TITLE];
  29.  
  30.     int16 wall_lightmaps_count;
  31.     int16 flat_lightmaps_count;
  32.  
  33.     int8 wall_textures_count;
  34.     int8 flat_textures_count;
  35.  
  36.     int8 player_starting_cell_x;
  37.     int8 player_starting_cell_y;
  38.  
  39.     int8 player_starting_angle;
  40.  
  41. } sLV_Level__File_Only;
  42.  
  43.  
  44. // WCZYTYWANIE
  45.     FILE* file_in;
  46.     file_in = fopen(level_filename, "rb");
  47.  
  48.     if (file_in == NULL)
  49.         return 0;
  50.  
  51.     fread(&LV_Level__File_Only, sizeof(sLV_Level__File_Only), 1, file_in);
  52.     fclose(file_in);
  53.  
  54. // ZAPIS
  55.     FILE* file_out;
  56.     file_out = _wfopen(APP_filename, L"wb");
  57.     int result = (int)fwrite(&APP_level_file, sizeof(sLV_Level__File_Only), 1, file_out);
  58.     fclose(file_out);
  59.  
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement