diff --git a/common_syms/contest_painting.txt b/common_syms/contest_painting.txt index d8dadccfae..32bb8be161 100644 --- a/common_syms/contest_painting.txt +++ b/common_syms/contest_painting.txt @@ -1,4 +1,4 @@ gContestMonPixels -gContestPaintingContext +gImageProcessingContext gContestPaintingWinner gContestPaintingMonPalette diff --git a/common_syms/contest_painting_effects.txt b/common_syms/image_processing_effects.txt similarity index 100% rename from common_syms/contest_painting_effects.txt rename to common_syms/image_processing_effects.txt diff --git a/data/contest_painting_effects.s b/data/image_processing_effects.s similarity index 100% rename from data/contest_painting_effects.s rename to data/image_processing_effects.s diff --git a/include/contest_painting_effects.h b/include/image_processing_effects.h similarity index 76% rename from include/contest_painting_effects.h rename to include/image_processing_effects.h index 599c381405..f6097d79f9 100755 --- a/include/contest_painting_effects.h +++ b/include/image_processing_effects.h @@ -1,5 +1,5 @@ -#ifndef GUARD_CONTEST_PAINTING_EFFECTS_H -#define GUARD_CONTEST_PAINTING_EFFECTS_H +#ifndef GUARD_IMAGE_PROCESSING_EFFECTS_H +#define GUARD_IMAGE_PROCESSING_EFFECTS_H enum { @@ -27,7 +27,7 @@ enum QUANTIZE_EFFECT_BLACK_WHITE, }; -struct ContestPaintingContext +struct ImageProcessingContext { u8 effect; void *canvasPixels; @@ -46,8 +46,8 @@ struct ContestPaintingContext u8 personality; }; -void ApplyImageProcessingEffects(struct ContestPaintingContext *); -void ApplyImageProcessingQuantization(struct ContestPaintingContext *); -void ConvertImageProcessingToGBA(struct ContestPaintingContext *); +void ApplyImageProcessingEffects(struct ImageProcessingContext *); +void ApplyImageProcessingQuantization(struct ImageProcessingContext *); +void ConvertImageProcessingToGBA(struct ImageProcessingContext *); #endif diff --git a/ld_script.txt b/ld_script.txt index ca59a71a7c..2f61377734 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -204,7 +204,7 @@ SECTIONS { src/dewford_trend.o(.text); src/heal_location.o(.text); src/region_map.o(.text); - src/contest_painting_effects.o(.text); + src/image_processing_effects.o(.text); src/decoration.o(.text); src/slot_machine.o(.text); src/contest_painting.o(.text); @@ -575,8 +575,8 @@ SECTIONS { src/menu_helpers.o(.rodata); src/heal_location.o(.rodata); src/region_map.o(.rodata); - src/contest_painting_effects.o(.rodata); - data/contest_painting_effects.o(.rodata); + src/image_processing_effects.o(.rodata); + data/image_processing_effects.o(.rodata); src/decoration.o(.rodata); src/slot_machine.o(.rodata); data/slot_machine.o(.rodata); diff --git a/src/contest_painting.c b/src/contest_painting.c index 40931d7d15..d5eb395659 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -5,10 +5,10 @@ #include "bg.h" #include "contest.h" #include "contest_painting.h" -#include "contest_painting_effects.h" #include "data.h" #include "decompress.h" #include "gpu_regs.h" +#include "image_processing_effects.h" #include "international_string_util.h" #include "main.h" #include "lilycove_lady.h" @@ -23,7 +23,7 @@ // IWRAM common u16 (*gContestMonPixels)[][32]; -struct ContestPaintingContext gContestPaintingContext; +struct ImageProcessingContext gImageProcessingContext; struct ContestWinner *gContestPaintingWinner; u16 *gContestPaintingMonPalette; @@ -657,38 +657,38 @@ static void AllocPaintingResources(void) static void DoContestPaintingImageProcessing(u8 imageEffect) { - gContestPaintingContext.canvasPixels = gContestMonPixels; - gContestPaintingContext.canvasPalette = gContestPaintingMonPalette; - gContestPaintingContext.paletteStart = 0; - gContestPaintingContext.personality = gContestPaintingWinner->personality % 256; - gContestPaintingContext.columnStart = 0; - gContestPaintingContext.rowStart = 0; - gContestPaintingContext.columnEnd = 64; - gContestPaintingContext.rowEnd = 64; - gContestPaintingContext.canvasWidth = 64; - gContestPaintingContext.canvasHeight = 64; + gImageProcessingContext.canvasPixels = gContestMonPixels; + gImageProcessingContext.canvasPalette = gContestPaintingMonPalette; + gImageProcessingContext.paletteStart = 0; + gImageProcessingContext.personality = gContestPaintingWinner->personality % 256; + gImageProcessingContext.columnStart = 0; + gImageProcessingContext.rowStart = 0; + gImageProcessingContext.columnEnd = 64; + gImageProcessingContext.rowEnd = 64; + gImageProcessingContext.canvasWidth = 64; + gImageProcessingContext.canvasHeight = 64; switch (imageEffect) { case IMAGE_EFFECT_CHARCOAL: case IMAGE_EFFECT_GRAYSCALE_LIGHT: - gContestPaintingContext.quantizeEffect = QUANTIZE_EFFECT_GRAYSCALE; + gImageProcessingContext.quantizeEffect = QUANTIZE_EFFECT_GRAYSCALE; break; case IMAGE_EFFECT_OUTLINE_COLORED: case IMAGE_EFFECT_SHIMMER: case IMAGE_EFFECT_POINTILLISM: default: - gContestPaintingContext.quantizeEffect = QUANTIZE_EFFECT_STANDARD_LIMITED_COLORS; + gImageProcessingContext.quantizeEffect = QUANTIZE_EFFECT_STANDARD_LIMITED_COLORS; break; } - gContestPaintingContext.var_16 = 2; - gContestPaintingContext.effect = imageEffect; - gContestPaintingContext.dest = OBJ_VRAM0; + gImageProcessingContext.var_16 = 2; + gImageProcessingContext.effect = imageEffect; + gImageProcessingContext.dest = OBJ_VRAM0; - ApplyImageProcessingEffects(&gContestPaintingContext); - ApplyImageProcessingQuantization(&gContestPaintingContext); - ConvertImageProcessingToGBA(&gContestPaintingContext); + ApplyImageProcessingEffects(&gImageProcessingContext); + ApplyImageProcessingQuantization(&gImageProcessingContext); + ConvertImageProcessingToGBA(&gImageProcessingContext); LoadPalette(gContestPaintingMonPalette, 0x100, 0x200); } diff --git a/src/contest_painting_effects.c b/src/image_processing_effects.c similarity index 99% rename from src/contest_painting_effects.c rename to src/image_processing_effects.c index f3354c900b..c123054744 100644 --- a/src/contest_painting_effects.c +++ b/src/image_processing_effects.c @@ -1,5 +1,5 @@ #include "global.h" -#include "contest_painting_effects.h" +#include "image_processing_effects.h" #include "contest_painting.h" #include "constants/rgb.h" @@ -53,7 +53,7 @@ static u16 QuantizePixel_PrimaryColors(u16*); extern const u8 gPointillismPoints[][3]; -void ApplyImageProcessingEffects(struct ContestPaintingContext *context) +void ApplyImageProcessingEffects(struct ImageProcessingContext *context) { gCanvasPixels = context->canvasPixels; gCanvasMonPersonality = context->personality; @@ -762,7 +762,7 @@ static u16 QuantizePixel_BlurHard(u16 *prevPixel, u16 *curPixel, u16 *nextPixel) } /* -void ConvertImageProcessingToGBA(struct ContestPaintingContext *arg0) +void ConvertImageProcessingToGBA(struct ImageProcessingContext *arg0) { u16 i, j, k; u8 r5 = arg0->canvasWidth >> 3; @@ -787,7 +787,7 @@ void ConvertImageProcessingToGBA(struct ContestPaintingContext *arg0) */ NAKED -void ConvertImageProcessingToGBA(struct ContestPaintingContext *arg0) +void ConvertImageProcessingToGBA(struct ImageProcessingContext *arg0) { asm_unified("\n\ push {r4-r7,lr}\n\ @@ -968,7 +968,7 @@ _08126194:\n\ bx r0"); } -void ApplyImageProcessingQuantization(struct ContestPaintingContext *context) +void ApplyImageProcessingQuantization(struct ImageProcessingContext *context) { gCanvasPaletteStart = context->paletteStart * 16; gCanvasPalette = &context->canvasPalette[gCanvasPaletteStart]; diff --git a/sym_common.txt b/sym_common.txt index 7c306c61bb..8f08952071 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -51,7 +51,7 @@ gReservedSpritePaletteCount: .include "contest.o" .include "tv.o" .include "mauville_old_man.o" - .include "contest_painting_effects.o" + .include "image_processing_effects.o" .space 0x4