Fix various warnings

This commit is contained in:
Andrei Alexeyev 2020-03-19 05:04:11 +02:00
parent c6f75c07ea
commit 02eb72608e
No known key found for this signature in database
GPG key ID: 363707CD4C7FE8A4
12 changed files with 17 additions and 19 deletions

View file

@ -374,7 +374,7 @@ void dialog_draw(Dialog *dialog) {
text_draw_wrapped(dialog->text.fading_out->text, dialog_bg_rect.w, &(TextParams) {
.shader = "text_dialog",
.aux_textures = { get_tex("cell_noise") },
.aux_textures = { r_texture_get("cell_noise") },
.shader_params = &(ShaderCustomParams) {{ o * (1.0 - (0.2 + 0.8 * (1 - dialog->text.fading_out->opacity))), 1 }},
.color = &clr,
.pos = { VIEWPORT_W/2, VIEWPORT_H-110 + font_get_lineskip(font) },
@ -390,7 +390,7 @@ void dialog_draw(Dialog *dialog) {
text_draw_wrapped(dialog->text.current->text, dialog_bg_rect.w, &(TextParams) {
.shader = "text_dialog",
.aux_textures = { get_tex("cell_noise") },
.aux_textures = { r_texture_get("cell_noise") },
.shader_params = &(ShaderCustomParams) {{ o * dialog->text.current->opacity, 0 }},
.color = &clr,
.pos = { VIEWPORT_W/2, VIEWPORT_H-110 + font_get_lineskip(font) },

View file

@ -765,7 +765,7 @@ HT_DECLARE_FUNC(void, destroy, (HT_BASETYPE *ht)) {
HT_DECLARE_PRIV_FUNC(HT_TYPE(element)*, find_element, (HT_BASETYPE *ht, HT_TYPE(const_key) key, hash_t hash)) {
hash_t hash_mask = ht->hash_mask;
ht_size_t i = hash & hash_mask;
ht_size_t zero_idx = i;
ht_size_t attr_unused zero_idx = i;
ht_size_t probe_len = 0;
ht_size_t max_probe_len = ht->max_psl;
hash |= HT_HASH_LIVE_BIT;

View file

@ -200,8 +200,8 @@ static void marisa_laser_renderer_visual(Enemy *renderer, int t, bool render) {
Uniform *u_clr_freq = r_shader_uniform(shader, "color_freq");
Uniform *u_alpha = r_shader_uniform(shader, "alphamod");
Uniform *u_length = r_shader_uniform(shader, "laser_length");
Texture *tex0 = get_tex("part/marisa_laser0");
Texture *tex1 = get_tex("part/marisa_laser1");
Texture *tex0 = r_texture_get("part/marisa_laser0");
Texture *tex1 = r_texture_get("part/marisa_laser1");
FBPair *fbp_aux = stage_get_fbpair(FBPAIR_FG_AUX);
Framebuffer *target_fb = r_framebuffer_current();

View file

@ -42,8 +42,8 @@ INLINE void rng_lock(RandomState *rng) { rng->locked = true; }
INLINE void rng_unlock(RandomState *rng) { rng->locked = false; }
INLINE bool rng_is_locked(RandomState *rng) { return rng->locked; }
#else
#define rng_lock(rng) (rng, (void)0)
#define rng_unlock(rng) (rng, (void)0)
#define rng_lock(rng) ((void)(rng), (void)0)
#define rng_unlock(rng) ((void)(rng), (void)0)
#define rng_is_locked(rng) (false)
#endif

View file

@ -826,11 +826,6 @@ Texture* r_texture_get(const char *name) {
return get_resource_data(RES_TEXTURE, name, RESF_DEFAULT | RESF_UNSAFE);
}
attr_deprecated("Use r_texture_get")
INLINE Texture *get_tex(const char *name) {
return r_texture_get(name);
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated"

View file

@ -48,6 +48,7 @@ static PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEANGLEPROC glad_glDrawArraysInstancedB
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEANGLEPROC)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance);
static PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEANGLEPROC glad_glDrawElementsInstancedBaseVertexBaseInstanceANGLE;
APIENTRY
static void glad_glDrawElementsInstancedBaseInstanceANGLE(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLuint baseinstance) {
// shim
glad_glDrawElementsInstancedBaseVertexBaseInstanceANGLE(mode, count, type, indices, instancecount, 0, baseinstance);

View file

@ -570,7 +570,7 @@ void end_draw_texture(void) {
}
void fill_viewport(float xoff, float yoff, float ratio, const char *name) {
fill_viewport_p(xoff, yoff, ratio, 1, 0, get_tex(name));
fill_viewport_p(xoff, yoff, ratio, 1, 0, r_texture_get(name));
}
void fill_viewport_p(float xoff, float yoff, float ratio, float aspect, float angle, Texture *tex) {
@ -626,7 +626,7 @@ void fill_viewport_p(float xoff, float yoff, float ratio, float aspect, float an
}
void fill_screen(const char *name) {
fill_screen_p(get_tex(name));
fill_screen_p(r_texture_get(name));
}
void fill_screen_p(Texture *tex) {
@ -660,5 +660,5 @@ void loop_tex_line_p(cmplx a, cmplx b, float w, float t, Texture *texture) {
}
void loop_tex_line(cmplx a, cmplx b, float w, float t, const char *texture) {
loop_tex_line_p(a, b, w, t, get_tex(texture));
loop_tex_line_p(a, b, w, t, r_texture_get(texture));
}

View file

@ -13,6 +13,8 @@
#include "global.h"
#include "common_tasks.h"
DIAGNOSTIC(ignored "-Wunused-variable")
TASK(laserproj_death, { Projectile *p; }) {
spawn_projectile_clear_effect(ARGS.p);
}

View file

@ -419,7 +419,7 @@ static void extra_begin(void) {
draw_data.codetex_num_segments = strtol(buf, NULL, 0);
SDL_RWclose(stream);
Texture *tex_code = get_tex("stageex/code");
Texture *tex_code = r_texture_get("stageex/code");
uint w, h;
r_texture_get_size(tex_code, 0, &w, &h);

View file

@ -303,7 +303,7 @@ static void stage1_waterplants_draw(vec3 pos) {
Sprite spr = { 0 };
spr.w = spr.h = 1;
spr.tex = get_tex("stage1/waterplants");
spr.tex = r_texture_get("stage1/waterplants");
uint tw, th;
r_texture_get_size(spr.tex, 0, &tw, &th);
spr.tex_area.w = tw * 0.5;

View file

@ -1230,7 +1230,7 @@ static void kurumi_extra_drainer_draw(Projectile *p, int time, ProjDrawRuleArgs
cmplx org = p->pos;
cmplx targ = p->args[1];
double a = 0.5 * creal(p->args[2]);
Texture *tex = get_tex("part/sinewave");
Texture *tex = r_texture_get("part/sinewave");
r_shader_standard();

View file

@ -104,7 +104,7 @@ static void stagetext_draw_single(StageText *txt) {
params.blend = BLEND_PREMUL_ALPHA;
params.shader_ptr = r_shader_get("text_stagetext");
params.shader_params = &(ShaderCustomParams){{ 1 - f }},
params.aux_textures[0] = get_tex("titletransition");
params.aux_textures[0] = r_texture_get("titletransition");
params.pos.x = creal(txt->pos) + ofs_x;
params.pos.y = cimag(txt->pos) + ofs_y;
params.color = &txt->color;