]> 4ch.mooo.com Git - 16.git/blobdiff - src/lib/16_timer.c
fix bizarre near/far sprintf problem when gv->pee not initialized by just replacing the
[16.git] / src / lib / 16_timer.c
index 9b73b887f22f5db05b65a39efcdd121e05ad9092..4ce497099cebb25424d5e575c92120a89313299f 100755 (executable)
@@ -29,8 +29,8 @@ clock_t start_timer(global_game_variables_t *gv)
        gv->kurokku.clock_start = *clockw;\r
        gv->kurokku.clock = clockw;\r
        //gv->kurokku.frames_per_second = 60;\r
-       gv->pee = _nmalloc(sizeof(byte)*16);\r
-       //turn this off if XT\r
+\r
+    //turn this off if XT\r
        switch(detectcpu())\r
        {\r
                case 0:\r
@@ -63,6 +63,9 @@ double time_in_seconds(global_game_variables_t *gv)
        return (gv->kurokku.t) / CLOCKS_PER_SEC;\r
 }\r
 \r
+// big global status text buffer\r
+char global_temp_status_text[512];\r
+\r
 /*double time_in_seconds(time_t in_t)\r
 {\r
        return (in_t) / CLOCKS_PER_SEC;\r
@@ -75,8 +78,8 @@ void shinkutxt(global_game_variables_t *gv)
        if(elapsed_timer(gv) >= (1.0 / gv->kurokku.frames_per_second))\r
        {\r
                //t=(((*(gv->clock))-gv->clock_start) /18.2);\r
-               sprintf(gv->pee, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv));\r
-               fprintf(stderr, "%s\n", gv->pee);\r
+               sprintf(global_temp_status_text, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv));\r
+               fprintf(stderr, "%s\n", global_temp_status_text);\r
                //(gv->clock_start)=*(gv->clock);\r
                gv->kurokku.tiku=0;\r
        }\r