2015-08-15 14:40:27 +00:00
|
|
|
#pragma once
|
2017-06-28 23:00:08 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "HdData.h"
|
2015-08-15 14:40:27 +00:00
|
|
|
|
2017-06-28 23:00:08 +00:00
|
|
|
class HdNesPack
|
2015-08-15 14:40:27 +00:00
|
|
|
{
|
|
|
|
private:
|
2017-06-28 23:00:08 +00:00
|
|
|
int32_t _backgroundIndex = -1;
|
2017-08-13 01:21:55 +00:00
|
|
|
uint32_t* _palette = nullptr;
|
2015-08-15 14:40:27 +00:00
|
|
|
|
2017-07-25 23:46:25 +00:00
|
|
|
__forceinline void BlendColors(uint8_t output[4], uint8_t input[4]);
|
|
|
|
__forceinline uint32_t AdjustBrightness(uint8_t input[4], uint16_t brightness);
|
|
|
|
__forceinline void DrawColor(uint32_t color, uint32_t* outputBuffer, uint32_t scale, uint32_t screenWidth);
|
2017-08-15 23:18:00 +00:00
|
|
|
__forceinline void DrawTile(HdPpuTileInfo &tileInfo, HdPackTileInfo &hdPackTileInfo, uint32_t* outputBuffer, uint32_t screenWidth);
|
2017-08-16 00:25:25 +00:00
|
|
|
__forceinline HdPackTileInfo* GetMatchingTile(HdPpuPixelInfo *screenTiles, uint32_t x, uint32_t y, HdPpuTileInfo* tile);
|
2015-08-15 14:40:27 +00:00
|
|
|
|
2017-07-25 23:46:25 +00:00
|
|
|
__forceinline bool IsNextToSprite(HdPpuPixelInfo *screenTiles, uint32_t x, uint32_t y);
|
|
|
|
__forceinline uint32_t GetCustomBackgroundPixel(int x, int y, int offsetX, int offsetY);
|
|
|
|
__forceinline void DrawCustomBackground(uint32_t *outputBuffer, uint32_t x, uint32_t y, uint32_t scale, uint32_t screenWidth);
|
2015-08-15 14:40:27 +00:00
|
|
|
|
|
|
|
public:
|
2017-06-28 23:00:08 +00:00
|
|
|
HdNesPack();
|
|
|
|
~HdNesPack();
|
2015-08-15 14:40:27 +00:00
|
|
|
|
2017-06-28 23:00:08 +00:00
|
|
|
uint32_t GetScale();
|
2017-07-25 23:46:25 +00:00
|
|
|
|
2017-06-28 23:00:08 +00:00
|
|
|
void OnBeforeApplyFilter(HdPpuPixelInfo *screenTiles);
|
2017-07-25 23:46:25 +00:00
|
|
|
void GetPixels(HdPpuPixelInfo *screenTiles, uint32_t x, uint32_t y, HdPpuPixelInfo &pixelInfo, uint32_t *outputBuffer, uint32_t screenWidth);
|
2015-08-15 14:40:27 +00:00
|
|
|
};
|