Novum / vkQuake

Vulkan Quake port based on QuakeSpasm
GNU General Public License v2.0
1.8k stars 220 forks source link

Unsuitable type for shirt/pants member of gltexture_t #145

Closed stass closed 6 years ago

stass commented 6 years ago

Hi!

vkquake uses char for the pants/shirt members of the gltexture_t. This works well on x86, but does not work well on arm, where char is unsigned (so the comparison with -1 elsewhere in the code will always succeed). This should probably be changed to int8_t instead (or signed char).

        unsigned short          source_crc; //generated by source data before modifications
        char                          shirt; //0-13 shirt color, or -1 if never colormapped
        char                          pants; //0-13 pants color, or -1 if never colormapped
//used for rendering
        VkImage                         image;
        VkImageView                     image_view;
        VkImageView                     target_image_view;
        struct glheap_s *       heap;
        struct glheapnode_s *   heap_node;
        VkDescriptorSet         descriptor_set;
        VkFramebuffer           frame_buffer;
        VkDescriptorSet         warp_write_descriptor_set;
        int                     visframe; //matches r_framecount if texture was bound this frame
} gltexture_t;
Novum commented 6 years ago

Forwarding this to Quakespasm: https://sourceforge.net/p/quakespasm/bugs/28/

sezero commented 6 years ago

Fixed by changing types to signed char; thanks. https://sourceforge.net/p/quakespasm/code/1588/

Novum commented 6 years ago

c9bff6fcf5d3c51d5b26a50071fd90db75dfcc93