Rename contest_painting_effects to image_processing_effects

This commit is contained in:
Marcus Huderle 2019-11-10 16:29:52 -06:00 committed by huderlem
parent 1ed3af66eb
commit 8e65f0188f
8 changed files with 36 additions and 36 deletions

View File

@ -1,4 +1,4 @@
gContestMonPixels gContestMonPixels
gContestPaintingContext gImageProcessingContext
gContestPaintingWinner gContestPaintingWinner
gContestPaintingMonPalette gContestPaintingMonPalette

View File

@ -1,5 +1,5 @@
#ifndef GUARD_CONTEST_PAINTING_EFFECTS_H #ifndef GUARD_IMAGE_PROCESSING_EFFECTS_H
#define GUARD_CONTEST_PAINTING_EFFECTS_H #define GUARD_IMAGE_PROCESSING_EFFECTS_H
enum enum
{ {
@ -27,7 +27,7 @@ enum
QUANTIZE_EFFECT_BLACK_WHITE, QUANTIZE_EFFECT_BLACK_WHITE,
}; };
struct ContestPaintingContext struct ImageProcessingContext
{ {
u8 effect; u8 effect;
void *canvasPixels; void *canvasPixels;
@ -46,8 +46,8 @@ struct ContestPaintingContext
u8 personality; u8 personality;
}; };
void ApplyImageProcessingEffects(struct ContestPaintingContext *); void ApplyImageProcessingEffects(struct ImageProcessingContext *);
void ApplyImageProcessingQuantization(struct ContestPaintingContext *); void ApplyImageProcessingQuantization(struct ImageProcessingContext *);
void ConvertImageProcessingToGBA(struct ContestPaintingContext *); void ConvertImageProcessingToGBA(struct ImageProcessingContext *);
#endif #endif

View File

@ -204,7 +204,7 @@ SECTIONS {
src/dewford_trend.o(.text); src/dewford_trend.o(.text);
src/heal_location.o(.text); src/heal_location.o(.text);
src/region_map.o(.text); src/region_map.o(.text);
src/contest_painting_effects.o(.text); src/image_processing_effects.o(.text);
src/decoration.o(.text); src/decoration.o(.text);
src/slot_machine.o(.text); src/slot_machine.o(.text);
src/contest_painting.o(.text); src/contest_painting.o(.text);
@ -575,8 +575,8 @@ SECTIONS {
src/menu_helpers.o(.rodata); src/menu_helpers.o(.rodata);
src/heal_location.o(.rodata); src/heal_location.o(.rodata);
src/region_map.o(.rodata); src/region_map.o(.rodata);
src/contest_painting_effects.o(.rodata); src/image_processing_effects.o(.rodata);
data/contest_painting_effects.o(.rodata); data/image_processing_effects.o(.rodata);
src/decoration.o(.rodata); src/decoration.o(.rodata);
src/slot_machine.o(.rodata); src/slot_machine.o(.rodata);
data/slot_machine.o(.rodata); data/slot_machine.o(.rodata);

View File

@ -5,10 +5,10 @@
#include "bg.h" #include "bg.h"
#include "contest.h" #include "contest.h"
#include "contest_painting.h" #include "contest_painting.h"
#include "contest_painting_effects.h"
#include "data.h" #include "data.h"
#include "decompress.h" #include "decompress.h"
#include "gpu_regs.h" #include "gpu_regs.h"
#include "image_processing_effects.h"
#include "international_string_util.h" #include "international_string_util.h"
#include "main.h" #include "main.h"
#include "lilycove_lady.h" #include "lilycove_lady.h"
@ -23,7 +23,7 @@
// IWRAM common // IWRAM common
u16 (*gContestMonPixels)[][32]; u16 (*gContestMonPixels)[][32];
struct ContestPaintingContext gContestPaintingContext; struct ImageProcessingContext gImageProcessingContext;
struct ContestWinner *gContestPaintingWinner; struct ContestWinner *gContestPaintingWinner;
u16 *gContestPaintingMonPalette; u16 *gContestPaintingMonPalette;
@ -657,38 +657,38 @@ static void AllocPaintingResources(void)
static void DoContestPaintingImageProcessing(u8 imageEffect) static void DoContestPaintingImageProcessing(u8 imageEffect)
{ {
gContestPaintingContext.canvasPixels = gContestMonPixels; gImageProcessingContext.canvasPixels = gContestMonPixels;
gContestPaintingContext.canvasPalette = gContestPaintingMonPalette; gImageProcessingContext.canvasPalette = gContestPaintingMonPalette;
gContestPaintingContext.paletteStart = 0; gImageProcessingContext.paletteStart = 0;
gContestPaintingContext.personality = gContestPaintingWinner->personality % 256; gImageProcessingContext.personality = gContestPaintingWinner->personality % 256;
gContestPaintingContext.columnStart = 0; gImageProcessingContext.columnStart = 0;
gContestPaintingContext.rowStart = 0; gImageProcessingContext.rowStart = 0;
gContestPaintingContext.columnEnd = 64; gImageProcessingContext.columnEnd = 64;
gContestPaintingContext.rowEnd = 64; gImageProcessingContext.rowEnd = 64;
gContestPaintingContext.canvasWidth = 64; gImageProcessingContext.canvasWidth = 64;
gContestPaintingContext.canvasHeight = 64; gImageProcessingContext.canvasHeight = 64;
switch (imageEffect) switch (imageEffect)
{ {
case IMAGE_EFFECT_CHARCOAL: case IMAGE_EFFECT_CHARCOAL:
case IMAGE_EFFECT_GRAYSCALE_LIGHT: case IMAGE_EFFECT_GRAYSCALE_LIGHT:
gContestPaintingContext.quantizeEffect = QUANTIZE_EFFECT_GRAYSCALE; gImageProcessingContext.quantizeEffect = QUANTIZE_EFFECT_GRAYSCALE;
break; break;
case IMAGE_EFFECT_OUTLINE_COLORED: case IMAGE_EFFECT_OUTLINE_COLORED:
case IMAGE_EFFECT_SHIMMER: case IMAGE_EFFECT_SHIMMER:
case IMAGE_EFFECT_POINTILLISM: case IMAGE_EFFECT_POINTILLISM:
default: default:
gContestPaintingContext.quantizeEffect = QUANTIZE_EFFECT_STANDARD_LIMITED_COLORS; gImageProcessingContext.quantizeEffect = QUANTIZE_EFFECT_STANDARD_LIMITED_COLORS;
break; break;
} }
gContestPaintingContext.var_16 = 2; gImageProcessingContext.var_16 = 2;
gContestPaintingContext.effect = imageEffect; gImageProcessingContext.effect = imageEffect;
gContestPaintingContext.dest = OBJ_VRAM0; gImageProcessingContext.dest = OBJ_VRAM0;
ApplyImageProcessingEffects(&gContestPaintingContext); ApplyImageProcessingEffects(&gImageProcessingContext);
ApplyImageProcessingQuantization(&gContestPaintingContext); ApplyImageProcessingQuantization(&gImageProcessingContext);
ConvertImageProcessingToGBA(&gContestPaintingContext); ConvertImageProcessingToGBA(&gImageProcessingContext);
LoadPalette(gContestPaintingMonPalette, 0x100, 0x200); LoadPalette(gContestPaintingMonPalette, 0x100, 0x200);
} }

View File

@ -1,5 +1,5 @@
#include "global.h" #include "global.h"
#include "contest_painting_effects.h" #include "image_processing_effects.h"
#include "contest_painting.h" #include "contest_painting.h"
#include "constants/rgb.h" #include "constants/rgb.h"
@ -53,7 +53,7 @@ static u16 QuantizePixel_PrimaryColors(u16*);
extern const u8 gPointillismPoints[][3]; extern const u8 gPointillismPoints[][3];
void ApplyImageProcessingEffects(struct ContestPaintingContext *context) void ApplyImageProcessingEffects(struct ImageProcessingContext *context)
{ {
gCanvasPixels = context->canvasPixels; gCanvasPixels = context->canvasPixels;
gCanvasMonPersonality = context->personality; 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; u16 i, j, k;
u8 r5 = arg0->canvasWidth >> 3; u8 r5 = arg0->canvasWidth >> 3;
@ -787,7 +787,7 @@ void ConvertImageProcessingToGBA(struct ContestPaintingContext *arg0)
*/ */
NAKED NAKED
void ConvertImageProcessingToGBA(struct ContestPaintingContext *arg0) void ConvertImageProcessingToGBA(struct ImageProcessingContext *arg0)
{ {
asm_unified("\n\ asm_unified("\n\
push {r4-r7,lr}\n\ push {r4-r7,lr}\n\
@ -968,7 +968,7 @@ _08126194:\n\
bx r0"); bx r0");
} }
void ApplyImageProcessingQuantization(struct ContestPaintingContext *context) void ApplyImageProcessingQuantization(struct ImageProcessingContext *context)
{ {
gCanvasPaletteStart = context->paletteStart * 16; gCanvasPaletteStart = context->paletteStart * 16;
gCanvasPalette = &context->canvasPalette[gCanvasPaletteStart]; gCanvasPalette = &context->canvasPalette[gCanvasPaletteStart];

View File

@ -51,7 +51,7 @@ gReservedSpritePaletteCount:
.include "contest.o" .include "contest.o"
.include "tv.o" .include "tv.o"
.include "mauville_old_man.o" .include "mauville_old_man.o"
.include "contest_painting_effects.o" .include "image_processing_effects.o"
.space 0x4 .space 0x4