src/strings.cpp
changeset 10695 95e0154da7a0
parent 10429 1b99254f9607
child 10707 81a4013a7680
--- a/src/strings.cpp	Sun May 25 11:18:57 2008 +0000
+++ b/src/strings.cpp	Sun May 25 12:57:39 2008 +0000
@@ -546,7 +546,7 @@
  */
 uint ConvertSpeedToDisplaySpeed(uint speed)
 {
- return (speed * units[_opt_ptr->units].s_m) >> units[_opt_ptr->units].s_s;
+ return (speed * units[_opt.units].s_m) >> units[_opt.units].s_s;
 }
 
 /**
@@ -556,7 +556,7 @@
  */
 uint ConvertDisplaySpeedToSpeed(uint speed)
 {
-	return ((speed << units[_opt_ptr->units].s_s) + units[_opt_ptr->units].s_m / 2) / units[_opt_ptr->units].s_m;
+	return ((speed << units[_opt.units].s_s) + units[_opt.units].s_m / 2) / units[_opt.units].s_m;
 }
 
 static char* FormatString(char* buff, const char* str, const int64* argv, uint casei, const char* last)
@@ -602,9 +602,9 @@
 
 			case SCC_VELOCITY: {// {VELOCITY}
 				int64 args[1];
-				assert(_opt_ptr->units < lengthof(units));
+				assert(_opt.units < lengthof(units));
 				args[0] = ConvertSpeedToDisplaySpeed(GetInt32(&argv));
-				buff = FormatString(buff, GetStringPtr(units[_opt_ptr->units].velocity), args, modifier >> 24, last);
+				buff = FormatString(buff, GetStringPtr(units[_opt.units].velocity), args, modifier >> 24, last);
 				modifier = 0;
 				break;
 			}
@@ -625,18 +625,18 @@
 				switch (cargo_str) {
 					case STR_TONS: {
 						int64 args[1];
-						assert(_opt_ptr->units < lengthof(units));
-						args[0] = GetInt32(&argv) * units[_opt_ptr->units].w_m >> units[_opt_ptr->units].w_s;
-						buff = FormatString(buff, GetStringPtr(units[_opt_ptr->units].l_weight), args, modifier >> 24, last);
+						assert(_opt.units < lengthof(units));
+						args[0] = GetInt32(&argv) * units[_opt.units].w_m >> units[_opt.units].w_s;
+						buff = FormatString(buff, GetStringPtr(units[_opt.units].l_weight), args, modifier >> 24, last);
 						modifier = 0;
 						break;
 					}
 
 					case STR_LITERS: {
 						int64 args[1];
-						assert(_opt_ptr->units < lengthof(units));
-						args[0] = GetInt32(&argv) * units[_opt_ptr->units].v_m >> units[_opt_ptr->units].v_s;
-						buff = FormatString(buff, GetStringPtr(units[_opt_ptr->units].l_volume), args, modifier >> 24, last);
+						assert(_opt.units < lengthof(units));
+						args[0] = GetInt32(&argv) * units[_opt.units].v_m >> units[_opt.units].v_s;
+						buff = FormatString(buff, GetStringPtr(units[_opt.units].l_volume), args, modifier >> 24, last);
 						modifier = 0;
 						break;
 					}
@@ -718,9 +718,9 @@
 
 			case SCC_VOLUME: { // {VOLUME}
 				int64 args[1];
-				assert(_opt_ptr->units < lengthof(units));
-				args[0] = GetInt32(&argv) * units[_opt_ptr->units].v_m >> units[_opt_ptr->units].v_s;
-				buff = FormatString(buff, GetStringPtr(units[_opt_ptr->units].l_volume), args, modifier >> 24, last);
+				assert(_opt.units < lengthof(units));
+				args[0] = GetInt32(&argv) * units[_opt.units].v_m >> units[_opt.units].v_s;
+				buff = FormatString(buff, GetStringPtr(units[_opt.units].l_volume), args, modifier >> 24, last);
 				modifier = 0;
 				break;
 			}
@@ -763,45 +763,45 @@
 
 			case SCC_POWER: { // {POWER}
 				int64 args[1];
-				assert(_opt_ptr->units < lengthof(units));
-				args[0] = GetInt32(&argv) * units[_opt_ptr->units].p_m >> units[_opt_ptr->units].p_s;
-				buff = FormatString(buff, GetStringPtr(units[_opt_ptr->units].power), args, modifier >> 24, last);
+				assert(_opt.units < lengthof(units));
+				args[0] = GetInt32(&argv) * units[_opt.units].p_m >> units[_opt.units].p_s;
+				buff = FormatString(buff, GetStringPtr(units[_opt.units].power), args, modifier >> 24, last);
 				modifier = 0;
 				break;
 			}
 
 			case SCC_VOLUME_SHORT: { // {VOLUME_S}
 				int64 args[1];
-				assert(_opt_ptr->units < lengthof(units));
-				args[0] = GetInt32(&argv) * units[_opt_ptr->units].v_m >> units[_opt_ptr->units].v_s;
-				buff = FormatString(buff, GetStringPtr(units[_opt_ptr->units].s_volume), args, modifier >> 24, last);
+				assert(_opt.units < lengthof(units));
+				args[0] = GetInt32(&argv) * units[_opt.units].v_m >> units[_opt.units].v_s;
+				buff = FormatString(buff, GetStringPtr(units[_opt.units].s_volume), args, modifier >> 24, last);
 				modifier = 0;
 				break;
 			}
 
 			case SCC_WEIGHT: { // {WEIGHT}
 				int64 args[1];
-				assert(_opt_ptr->units < lengthof(units));
-				args[0] = GetInt32(&argv) * units[_opt_ptr->units].w_m >> units[_opt_ptr->units].w_s;
-				buff = FormatString(buff, GetStringPtr(units[_opt_ptr->units].l_weight), args, modifier >> 24, last);
+				assert(_opt.units < lengthof(units));
+				args[0] = GetInt32(&argv) * units[_opt.units].w_m >> units[_opt.units].w_s;
+				buff = FormatString(buff, GetStringPtr(units[_opt.units].l_weight), args, modifier >> 24, last);
 				modifier = 0;
 				break;
 			}
 
 			case SCC_WEIGHT_SHORT: { // {WEIGHT_S}
 				int64 args[1];
-				assert(_opt_ptr->units < lengthof(units));
-				args[0] = GetInt32(&argv) * units[_opt_ptr->units].w_m >> units[_opt_ptr->units].w_s;
-				buff = FormatString(buff, GetStringPtr(units[_opt_ptr->units].s_weight), args, modifier >> 24, last);
+				assert(_opt.units < lengthof(units));
+				args[0] = GetInt32(&argv) * units[_opt.units].w_m >> units[_opt.units].w_s;
+				buff = FormatString(buff, GetStringPtr(units[_opt.units].s_weight), args, modifier >> 24, last);
 				modifier = 0;
 				break;
 			}
 
 			case SCC_FORCE: { // {FORCE}
 				int64 args[1];
-				assert(_opt_ptr->units < lengthof(units));
-				args[0] = GetInt32(&argv) * units[_opt_ptr->units].f_m >> units[_opt_ptr->units].f_s;
-				buff = FormatString(buff, GetStringPtr(units[_opt_ptr->units].force), args, modifier >> 24, last);
+				assert(_opt.units < lengthof(units));
+				args[0] = GetInt32(&argv) * units[_opt.units].f_m >> units[_opt.units].f_s;
+				buff = FormatString(buff, GetStringPtr(units[_opt.units].force), args, modifier >> 24, last);
 				modifier = 0;
 				break;
 			}
@@ -1137,7 +1137,7 @@
 	const char* const* base;
 	uint num;
 
-	if (_opt_ptr->landscape == LT_TOYLAND) {
+	if (_opt.landscape == LT_TOYLAND) {
 		base = _silly_surname_list;
 		num  = lengthof(_silly_surname_list);
 	} else {
@@ -1167,7 +1167,7 @@
 		buff = strecpy(buff, initial, last);
 	}
 
-	if (_opt_ptr->landscape == LT_TOYLAND) {
+	if (_opt.landscape == LT_TOYLAND) {
 		base = _silly_surname_list;
 		num  = lengthof(_silly_surname_list);
 	} else {