]> 4ch.mooo.com Git - 16.git/commitdiff
ca_t added
authorsparky4 <sparky4@cock.li>
Fri, 2 Sep 2016 18:22:24 +0000 (13:22 -0500)
committersparky4 <sparky4@cock.li>
Fri, 2 Sep 2016 18:22:24 +0000 (13:22 -0500)
src/lib/16_ca.c
src/lib/16_ca.h
src/lib/typdefst.h

index f5893d8110a0ffd572081ede1dfc1aff4dcb66ca..d9dc6a1f5a1e8d5736614be435e604717b1a87ad 100755 (executable)
@@ -1713,7 +1713,7 @@ void CA_CacheGrChunk (int chunk)
        byte    far *source;\r
        int             next;\r
 \r
-       grneeded[chunk] |= ca_levelbit;         // make sure it doesn't get removed\r
+       gvar->video.grneeded[chunk] |= ca_levelbit;             // make sure it doesn't get removed\r
        if (grsegs[chunk])\r
        {\r
                MM_SetPurge (&grsegs[chunk],0);\r
@@ -1937,15 +1937,13 @@ void CA_DownLevel (void)
 =\r
 ======================\r
 */\r
-/*\r
-void CA_ClearMarks (void)\r
+void CA_ClearMarks (global_game_variables_t *gvar)\r
 {\r
        int i;\r
 \r
        for (i=0;i<NUMCHUNKS;i++)\r
-               grneeded[i]&=~ca_levelbit;\r
+               gvar->video.grneeded[i]&=~gvar->ca.ca_levelbit;\r
 }\r
-*/\r
 \r
 //===========================================================================\r
 \r
@@ -1958,14 +1956,12 @@ void CA_ClearMarks (void)
 =\r
 ======================\r
 */\r
-/*\r
-void CA_ClearAllMarks (void)\r
+void CA_ClearAllMarks (global_game_variables_t *gvar)\r
 {\r
-       _fmemset (grneeded,0,sizeof(grneeded));\r
-       ca_levelbit = 1;\r
-       ca_levelnum = 0;\r
+       _fmemset (gvar->video.grneeded,0,sizeof(gvar->video.grneeded));\r
+       gvar->ca.ca_levelbit = 1;\r
+       gvar->ca.ca_levelnum = 0;\r
 }\r
-*/\r
 \r
 //===========================================================================\r
 \r
@@ -2192,7 +2188,7 @@ void CA_CacheMarks (char *title)
 // go through and make everything not needed purgable\r
 //\r
        for (i=0;i<NUMCHUNKS;i++)\r
-               if (grneeded[i]&ca_levelbit)\r
+               if (gvar->video.grneeded[i]&ca_levelbit)\r
                {\r
                        if (grsegs[i])                                  // its allready in memory, make\r
                                MM_SetPurge(&grsegs[i],0);      // sure it stays there!\r
@@ -2231,7 +2227,7 @@ void CA_CacheMarks (char *title)
        bufferstart = bufferend = 0;            // nothing good in buffer now\r
 \r
        for (i=0;i<NUMCHUNKS;i++)\r
-               if ( (grneeded[i]&ca_levelbit) && !grsegs[i])\r
+               if ( (gvar->video.grneeded[i]&ca_levelbit) && !grsegs[i])\r
                {\r
 //\r
 // update thermometer\r
@@ -2265,7 +2261,7 @@ void CA_CacheMarks (char *title)
                                        while ( next < NUMCHUNKS )\r
                                        {\r
                                                while (next < NUMCHUNKS &&\r
-                                               !(grneeded[next]&ca_levelbit && !grsegs[next]))\r
+                                               !(gvar->video.grneeded[next]&ca_levelbit && !grsegs[next]))\r
                                                        next++;\r
                                                if (next == NUMCHUNKS)\r
                                                        continue;\r
index a5c016d27e69a7b3741f716dc76525dd74944a2a..a193a645775f5539a9f0b3e0d3a3984b2154d423 100755 (executable)
@@ -104,12 +104,12 @@ void CA_Shutdown (global_game_variables_t *gvar);
 void CA_DownLevel (void);\r
 \r
 void CA_SetGrPurge (void);\r
-void CA_SetAllPurge (void);\r
+void CA_SetAllPurge (void);*/\r
 \r
-void CA_ClearMarks (void);\r
-void CA_ClearAllMarks (void);\r
+void CA_ClearMarks (global_game_variables_t *gvar);\r
+void CA_ClearAllMarks (global_game_variables_t *gvar);\r
 \r
-#define CA_MarkGrChunk(chunk)  grneeded[chunk]|=ca_levelbit\r
+/*#define CA_MarkGrChunk(chunk)        grneeded[chunk]|=ca_levelbit\r
 \r
 void CA_CacheGrChunk (int chunk);\r
 void CA_CacheMap (int mapnum);\r
index 18e5700959f62ebc2041ed089f0b84caea656789..5be1ab60351454395d4797680ea0cec550b90393 100755 (executable)
@@ -120,9 +120,13 @@ typedef struct
        word    pn;\r
 } pan_t;\r
 \r
+//video\r
+#define NUMCHUNKS      3016    //keen\r
+\r
 typedef struct\r
 {\r
        char old_mode;          //old video mode before game!\r
+       byte grneeded[NUMCHUNKS];\r
        page_t page[MAXPAGE];           //pointer to root page[0]\r
        word vmem_remain;       //remaining video memory\r
        byte num_of_pages;      //number of actual pages\r
@@ -177,10 +181,17 @@ typedef struct
 \r
 //==========================================================================\r
 \r
+//16_ca.h\r
+typedef struct\r
+{\r
+       byte            ca_levelbit,ca_levelnum;\r
+} ca_t;\r
+\r
 //actual global game varables!\r
 typedef struct\r
 {\r
-       video_t video;  // video settings variable\r
+       video_t video;  // video settings variable\r
+       ca_t            ca;     // ca stuff\r
        byte *pee;              // message for fps\r
        handle_t handle;        //handles for file logging\r
        kurokku_t kurokku;      //clock struct\r