Use uint8_t* instead of void* for texture data

NOTE: In texture_setimage, I had to move variables to the top of the
scope because microsoft's C compiler will give the legacy C90 error of:
'illegal use of this type as an expression'.

To sum it up, microsoft's C compiler is still utter garbage.
This commit is contained in:
jp9000
2014-06-27 21:29:06 -07:00
parent 9478624b22
commit 7b12133af3
15 changed files with 55 additions and 53 deletions

View File

@@ -20,10 +20,10 @@
bool gl_init_face(GLenum target, GLenum type, uint32_t num_levels,
GLenum format, GLint internal_format, bool compressed,
uint32_t width, uint32_t height, uint32_t size,
const void ***p_data)
const uint8_t ***p_data)
{
bool success = true;
const void **data = p_data ? *p_data : NULL;
const uint8_t **data = p_data ? *p_data : NULL;
uint32_t i;
for (i = 0; i < num_levels; i++) {

View File

@@ -146,7 +146,7 @@ static inline bool gl_get_integer_v(GLenum pname, GLint *params)
extern bool gl_init_face(GLenum target, GLenum type, uint32_t num_levels,
GLenum format, GLint internal_format, bool compressed,
uint32_t width, uint32_t height, uint32_t size,
const void ***p_data);
const uint8_t ***p_data);
extern bool gl_copy_texture(struct gs_device *device,
GLuint dst, GLenum dst_target, uint32_t dst_x, uint32_t dst_y,

View File

@@ -269,7 +269,7 @@ uint32_t device_getheight(device_t device)
texture_t device_create_volumetexture(device_t device, uint32_t width,
uint32_t height, uint32_t depth,
enum gs_color_format color_format, uint32_t levels,
const void **data, uint32_t flags)
const uint8_t **data, uint32_t flags)
{
/* TODO */
UNUSED_PARAMETER(device);

View File

@@ -17,7 +17,7 @@
#include "gl-subsystem.h"
static bool upload_texture_2d(struct gs_texture_2d *tex, const void **data)
static bool upload_texture_2d(struct gs_texture_2d *tex, const uint8_t **data)
{
uint32_t row_size = tex->width * gs_get_format_bpp(tex->base.format);
uint32_t tex_size = tex->height * row_size / 8;
@@ -76,7 +76,7 @@ static bool create_pixel_unpack_buffer(struct gs_texture_2d *tex)
texture_t device_create_texture(device_t device, uint32_t width,
uint32_t height, enum gs_color_format color_format,
uint32_t levels, const void **data, uint32_t flags)
uint32_t levels, const uint8_t **data, uint32_t flags)
{
struct gs_texture_2d *tex = bzalloc(sizeof(struct gs_texture_2d));
tex->base.device = device;
@@ -164,7 +164,7 @@ enum gs_color_format texture_getcolorformat(texture_t tex)
return tex->format;
}
bool texture_map(texture_t tex, void **ptr, uint32_t *linesize)
bool texture_map(texture_t tex, uint8_t **ptr, uint32_t *linesize)
{
struct gs_texture_2d *tex2d = (struct gs_texture_2d*)tex;

View File

@@ -18,7 +18,7 @@
#include "gl-subsystem.h"
static inline bool upload_texture_cube(struct gs_texture_cube *tex,
const void **data)
const uint8_t **data)
{
uint32_t row_size = tex->size * gs_get_format_bpp(tex->base.format);
uint32_t tex_size = tex->size * row_size / 8;
@@ -60,7 +60,7 @@ static inline bool upload_texture_cube(struct gs_texture_cube *tex,
texture_t device_create_cubetexture(device_t device, uint32_t size,
enum gs_color_format color_format, uint32_t levels,
const void **data, uint32_t flags)
const uint8_t **data, uint32_t flags)
{
struct gs_texture_cube *tex = bzalloc(sizeof(struct gs_texture_cube));
tex->base.device = device;