There will be described my all finds with ineffective using of memory
field.h:
No need in that var. Priority is used only one time (in drawing function) and never changed. Can be replaced with case in the drawing function.
No need to use int. There’s no “time is stopped when you stopped here”. Use signed word instead.
int age; //The age, or time to live, of the field effect. 0 is permanent.
int halflife; // In turns
For some insane reasons you use negative numbers to show that field is still alive. Rework that part a little to use positive numbers instead. Actually, there’s no so persistant field that require to use int. Use unsigned word.
signed char density; //The density, or intensity (higher is stronger), of the field entry.The same. May be only 1, 2 and 3.
calendar.h
int second;
int minute;
int hour;
int day;
int year;
This shit again.
catacurse.h
int x;//left side of window
int y;//top side of window
int width;//width of the curses window
int height;//height of the curses window
int cursorx;//x location of the cursor
int cursory;//y location of the cursor
unsigned word, please.
computer.h
int security;
Security 2^16-1, lol.
unsigned char.
construction.h
int difficulty; // carpentry skill level required
int time; // time taken to construct, in minutes
unsigned char and unsigned word, please.
creature.h
int str_max, dex_max, per_max, int_max,
str_cur, dex_cur, per_cur, int_cur;
int moves, pain;
unsigned word for str/dex/int/per cur/max and pain
int num_blocks; // base number of blocks/dodges per turn
int num_dodges;
The same.
damage.h
the same.
dialogue.h
the same
effect.h
int duration; int intensity;The same.
faction.h
int good; // A measure of how "good" the value is (naming purposes &c)
int strength;
int sneak;
int crime;
int cult;
Any explanation?
game.h
I always wanter to kill negative amount of enemies.
signed char temperature; // The air temperature
int get_temperature(); // Returns outdoor or indoor temperature of current location
?
int moves_since_last_save;
int item_exchanges_since_save;
As always.
…
Damn, it’s boring. I am gonna sleep. I hope you got my thought.