Skip to content

Commit

Permalink
Remove undesired external symbols
Browse files Browse the repository at this point in the history
Completely remove the DirectDrawSurface export methods, opengx is not an
imaging library and does not need these methods itself.

Mark a bunch of internally used functions as static.

Rename the only needed external function to have the `_ogx_` prefix, in
order to avoid collisions with the application's code.

Afther these changes, the symbols exported by libopengx.a (except all
those starting with `gl*`) are the following:

- ogx_initialize (which is meant to be public)
- _ogx_log_level (internal variable)
- _ogx_state (internal variable)
- _ogx_convert_rgb_image_to_DXT1 (internal function)
  • Loading branch information
mardy authored and WinterMute committed May 13, 2024
1 parent 2fa2312 commit ae5b142
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 425 deletions.
13 changes: 8 additions & 5 deletions src/gc_gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ static void conv_rgba_to_luminance_alpha(unsigned char *src, void *dst, const un
static void scramble_2b(unsigned short *src, void *dst, const unsigned int width, const unsigned int height);
static void scramble_4b(unsigned char *src, void *dst, const unsigned int width, const unsigned int height);

void scale_internal(int components, int widthin, int heightin, const unsigned char *datain,
int widthout, int heightout, unsigned char *dataout);
static void scale_internal(int components, int widthin, int heightin,
const unsigned char *datain,
int widthout, int heightout, unsigned char *dataout);

static void draw_arrays_pos_normal_texc(float *ptr_pos, float *ptr_texc, float *ptr_normal,
int count, bool loop);
Expand Down Expand Up @@ -1456,7 +1457,8 @@ void glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei widt
unsigned char *dst_addr = currtex->data;
dst_addr += offset;

convert_rgb_image_to_DXT1((unsigned char *)data, dst_addr, width, height, needswap);
_ogx_convert_rgb_image_to_DXT1((unsigned char *)data, dst_addr,
width, height, needswap);

DCFlushRange(dst_addr, calc_memory(width, height, bytesperpixelinternal));
}
Expand Down Expand Up @@ -2759,8 +2761,9 @@ static void swap_rgb565(unsigned short *pixels, int num_pixels)

//// Image scaling for arbitrary size taken from Mesa 3D and adapted by davidgf ////

void scale_internal(int components, int widthin, int heightin, const unsigned char *datain,
int widthout, int heightout, unsigned char *dataout)
static void scale_internal(int components, int widthin, int heightin,
const unsigned char *datain,
int widthout, int heightout, unsigned char *dataout)
{
float x, lowx, highx, convx, halfconvx;
float y, lowy, highy, convy, halfconvy;
Expand Down
Loading

0 comments on commit ae5b142

Please sign in to comment.