123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- #include <grass/display.h>
- #include "graphics.h"
- #include <stdio.h>
- #define GETEM if (notgotem) getem()
- static int notgotem = 1;
- static int wind_top;
- static int wind_bot;
- static int wind_rite;
- static int wind_left;
- static int getem(void);
- int get_wind_bot(void)
- {
- GETEM;
- return (wind_bot);
- }
- int get_wind_top(void)
- {
- GETEM;
- return (wind_top);
- }
- int get_wind_rite(void)
- {
- GETEM;
- return (wind_rite);
- }
- int get_wind_left(void)
- {
- GETEM;
- return (wind_left);
- }
- int get_map_bot(void)
- {
- GETEM;
- return (wind_bot);
- }
- int get_map_top(void)
- {
- register float tmp1, tmp2, tmp3;
- GETEM;
- if (notgotem) {
- getem();
- notgotem = 0;
- }
- tmp1 = (float)wind_bot;
- tmp2 = (float)wind_top;
- tmp3 = tmp1 + WINDOW_PROP_SCREEN_Y * (tmp2 - tmp1);
- return ((int)tmp3);
- }
- int get_map_left(void)
- {
- register float tmp1, tmp2, tmp3;
- GETEM;
- tmp1 = (float)wind_left;
- tmp2 = (float)wind_rite;
- tmp3 = tmp2 - WINDOW_PROP_SCREEN_X * (tmp2 - tmp1);
- return ((int)tmp3);
- }
- int get_map_rite(void)
- {
- GETEM;
- return (wind_rite);
- }
- int get_wind_y_pos(float position)
- {
- register float tmp1, tmp2, tmp3;
- GETEM;
- tmp1 = (float)wind_top;
- tmp2 = (float)wind_bot;
- tmp3 = tmp1 + position * (tmp2 - tmp1);
- return ((int)tmp3);
- }
- int get_wind_x_pos(float position)
- {
- register float tmp1, tmp2, tmp3;
- GETEM;
- tmp1 = (float)wind_left;
- tmp2 = (float)wind_rite;
- tmp3 = tmp1 + position * (tmp2 - tmp1);
- return ((int)tmp3);
- }
- static int getem(void)
- {
- D_get_screen_window(&wind_top, &wind_bot, &wind_left, &wind_rite);
- notgotem = 0;
- return 0;
- }
|