Changeset 18
- Timestamp:
- Nov 10, 2005, 9:44:53 PM (18 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/include/objects.hpp
r16 r18 28 28 29 29 30 #define RC_ C031 #define RC_ S132 #define RC_ L230 #define RC_8 0 31 #define RC_16 1 32 #define RC_32 2 33 33 34 34 -
abuse/trunk/src/level.cpp
r17 r18 918 918 fp->seek(se->offset,0); 919 919 last=NULL; 920 if (fp->read_uint8()==RC_ S) // read type array, this should be type RC_S920 if (fp->read_uint8()==RC_16) // read type array, this should be type RC_16 921 921 { 922 922 for (i=0;i<total_objs;i++) … … 934 934 { 935 935 fp->seek(se->offset,0); 936 if (fp->read_uint8()==RC_ S) // read state array, this should be type RC_S936 if (fp->read_uint8()==RC_16) // read state array, this should be type RC_16 937 937 { 938 938 game_object *l=first; … … 974 974 switch (t) 975 975 { 976 case RC_ C: f->set_var(j,fp->read_uint8()); break;977 case RC_ S: f->set_var(j,fp->read_uint16()); break;978 case RC_ L: f->set_var(j,fp->read_uint32()); break;976 case RC_8 : f->set_var(j,fp->read_uint8()); break; 977 case RC_16 : f->set_var(j,fp->read_uint16()); break; 978 case RC_32 : f->set_var(j,fp->read_uint32()); break; 979 979 } 980 980 … … 1129 1129 fp->seek(se->offset,0); 1130 1130 last=NULL; 1131 if (fp->read_uint8()==RC_ S) // read type array, this should be type RC_S1131 if (fp->read_uint8()==RC_16) // read type array, this should be type RC_16 1132 1132 { 1133 1133 int i=0; … … 1145 1145 { 1146 1146 fp->seek(se->offset,0); 1147 if (fp->read_uint8()==RC_ S) // read state array, this should be type RC_S1147 if (fp->read_uint8()==RC_16) // read state array, this should be type RC_16 1148 1148 { 1149 1149 game_object *l=first; … … 1177 1177 for (;k<ot;k++) 1178 1178 { 1179 if (fp->read_uint8()!=RC_ L) abort=1;1179 if (fp->read_uint8()!=RC_32) abort=1; 1180 1180 else 1181 1181 { … … 1217 1217 switch (t) 1218 1218 { 1219 case RC_ C:1219 case RC_8 : 1220 1220 { f->set_var(j,fp->read_uint8()); } break; 1221 case RC_ S:1221 case RC_16 : 1222 1222 { f->set_var(j,fp->read_uint16()); } break; 1223 case RC_ L:1223 case RC_32 : 1224 1224 { f->set_var(j,fp->read_uint32()); } break; 1225 1225 } … … 1667 1667 for (;i<tv;i++) 1668 1668 { 1669 fp->write_uint8(RC_ L);1669 fp->write_uint8(RC_32); 1670 1670 for (v=player_list;v;v=v->next) 1671 1671 fp->write_uint32(v->get_view_var_value(i)); 1672 1672 } 1673 1673 1674 fp->write_uint8(RC_ L);1674 fp->write_uint8(RC_32); 1675 1675 fp->write_uint32(rand_on); 1676 1676 1677 fp->write_uint8(RC_ L);1677 fp->write_uint8(RC_32); 1678 1678 fp->write_uint32(total_weapons); 1679 1679 for (v=player_list;v;v=v->next) … … 1750 1750 { 1751 1751 fp->seek(se->offset,0); 1752 if (fp->read_uint8()==RC_ L)1752 if (fp->read_uint8()==RC_32) 1753 1753 { 1754 1754 for (v=player_list;v;v=v->next) … … 1766 1766 { 1767 1767 fp->seek(se->offset,0); 1768 if (fp->read_uint8()==RC_ L)1768 if (fp->read_uint8()==RC_32) 1769 1769 rand_on=fp->read_uint32(); 1770 1770 } else rand_on=0; … … 1774 1774 { 1775 1775 fp->seek(se->offset,0); 1776 if (fp->read_uint8()==RC_ L)1776 if (fp->read_uint8()==RC_32) 1777 1777 { 1778 1778 int32_t m=fp->read_uint32(); // read how many weapons exsisted when last saved … … 1909 1909 1910 1910 1911 fp->write_uint8(RC_ S); // save type info for each record1911 fp->write_uint8(RC_16); // save type info for each record 1912 1912 for (o=save_list;o;o=o->next) fp->write_uint16(o->me->type()); 1913 1913 1914 fp->write_uint8(RC_ S); // save state info for each record1914 fp->write_uint8(RC_16); // save state info for each record 1915 1915 for (o=save_list;o;o=o->next) fp->write_uint16(o->me->reduced_state()); 1916 1916 … … 1920 1920 for (i=0;i<figures[o->me->otype]->tv;i++) 1921 1921 { 1922 fp->write_uint8(RC_ L); // for now the only type allowed is int32_t1922 fp->write_uint8(RC_32); // for now the only type allowed is int32_t 1923 1923 fp->write_uint32(o->me->lvars[i]); 1924 1924 } … … 1933 1933 switch (t) 1934 1934 { 1935 case RC_ C:1935 case RC_8 : 1936 1936 { fp->write_uint8(o->me->get_var(i)); } break; 1937 case RC_ S:1937 case RC_16 : 1938 1938 { fp->write_uint16(o->me->get_var(i)); } break; 1939 case RC_ L:1939 case RC_32 : 1940 1940 { fp->write_uint32(o->me->get_var(i)); } break; 1941 1941 } … … 1963 1963 void level::write_links(bFILE *fp, object_node *save_list, object_node *exclude_list) 1964 1964 { 1965 fp->write_uint8(RC_ L);1965 fp->write_uint8(RC_32); 1966 1966 fp->write_uint32(total_object_links(save_list)); 1967 1967 … … 1983 1983 } 1984 1984 1985 fp->write_uint8(RC_ L);1985 fp->write_uint8(RC_32); 1986 1986 fp->write_uint32(total_light_links(save_list)); 1987 1987 … … 2007 2007 { 2008 2008 fp->seek(se->offset,0); 2009 if (fp->read_uint8()==RC_ L)2009 if (fp->read_uint8()==RC_32) 2010 2010 { 2011 2011 int32_t t=fp->read_uint32(); … … 2032 2032 { 2033 2033 fp->seek(se->offset,0); 2034 if (fp->read_uint8()==RC_ L)2034 if (fp->read_uint8()==RC_32) 2035 2035 { 2036 2036 int32_t t=fp->read_uint32(); … … 2054 2054 { 2055 2055 // save background scroll rate 2056 fp->write_uint8(RC_ L);2056 fp->write_uint8(RC_32); 2057 2057 fp->write_uint32(bg_xmul); 2058 2058 fp->write_uint32(bg_xdiv); … … 2060 2060 fp->write_uint32(bg_ydiv); 2061 2061 2062 fp->write_uint8(RC_ L);2062 fp->write_uint8(RC_32); 2063 2063 int ta=0; 2064 2064 area_controller *a=area_list; … … 2080 2080 fp->write_uint32(a->view_yoff_speed); 2081 2081 } 2082 fp->write_uint8(RC_ L);2082 fp->write_uint8(RC_32); 2083 2083 fp->write_uint32(tick_counter()); 2084 2084 } … … 2090 2090 { 2091 2091 fp->seek(se->offset,0); 2092 if (fp->read_uint8()!=RC_ L)2092 if (fp->read_uint8()!=RC_32) 2093 2093 { bg_xmul=bg_ymul=1; bg_xdiv=bg_ydiv=8; } 2094 2094 else … … 2105 2105 { 2106 2106 fp->seek(se->offset,0); 2107 if (fp->read_uint8()==RC_ L)2107 if (fp->read_uint8()==RC_32) 2108 2108 { 2109 2109 area_controller *l=NULL,*p; … … 2136 2136 { 2137 2137 fp->seek(se->offset,0); 2138 if (fp->read_uint8()==RC_ L)2138 if (fp->read_uint8()==RC_32) 2139 2139 set_tick_counter(fp->read_uint32()); 2140 2140 else set_tick_counter(0); -
abuse/trunk/src/objects.cpp
r16 r18 46 46 47 47 obj_desc object_descriptions[TOTAL_OBJECT_VARS]={ 48 {"fade_dir", RC_ C},49 {"frame_dir", RC_ C},50 {"direction", RC_ C},51 {"gravity_on", RC_ C},52 {"fade_count", RC_ C},53 54 {"fade_max", RC_ C},55 {"active", RC_ C},56 {"flags", RC_ C},57 {"aitype", RC_ C},58 {"xvel", RC_ L},59 60 {"fxvel", RC_ C},61 {"yvel", RC_ L},62 {"fyvel", RC_ C},63 {"xacel", RC_ L},64 {"fxacel", RC_ C},65 66 {"yacel", RC_ L},67 {"fyacel", RC_ C},68 {"x", RC_ L},69 {"fx", RC_ C},70 {"y", RC_ L},71 72 {"fy", RC_ C},73 {"hp", RC_ S},74 {"mp", RC_ S},75 {"fmp", RC_ S},76 {"cur_frame", RC_ S},77 78 {"aistate", RC_ S},79 {"aistate_time", RC_ S},80 {"targetable", RC_ C}48 {"fade_dir", RC_8 }, 49 {"frame_dir", RC_8 }, 50 {"direction", RC_8 }, 51 {"gravity_on", RC_8 }, 52 {"fade_count", RC_8 }, 53 54 {"fade_max", RC_8 }, 55 {"active", RC_8 }, 56 {"flags", RC_8 }, 57 {"aitype", RC_8 }, 58 {"xvel", RC_32 }, 59 60 {"fxvel", RC_8 }, 61 {"yvel", RC_32 }, 62 {"fyvel", RC_8 }, 63 {"xacel", RC_32 }, 64 {"fxacel", RC_8 }, 65 66 {"yacel", RC_32 }, 67 {"fyacel", RC_8 }, 68 {"x", RC_32 }, 69 {"fx", RC_8 }, 70 {"y", RC_32 }, 71 72 {"fy", RC_8 }, 73 {"hp", RC_16 }, 74 {"mp", RC_16 }, 75 {"fmp", RC_16 }, 76 {"cur_frame", RC_16 }, 77 78 {"aistate", RC_16 }, 79 {"aistate_time", RC_16 }, 80 {"targetable", RC_8 } 81 81 82 82 }; … … 234 234 switch (type) 235 235 { 236 case RC_ C:236 case RC_8 : 237 237 { return 1; } break; 238 case RC_ S:238 case RC_16 : 239 239 { return 2; } break; 240 case RC_ L:240 case RC_32 : 241 241 { return 4; } break; 242 242 }
Note: See TracChangeset
for help on using the changeset viewer.