mirror of
https://github.com/libretro/MesenCE.git
synced 2026-11-11 03:01:50 -10:00
-Fixed getAccessCounters documentation (swapped param order) -Fixed file watcher not being disabled properly when closing the script window, causing the script to run if changed on the disk, even if the script window is closed -Prevent file watcher from triggering from writes done by the script window itself (which caused the script to be reloaded 2 or 3 times in a row) -Fixed UI freezes when using emu.log() on a large table -Fixed crash when 100k character limit (in the last 500 lines) for script log was reached (out of bounds read/write) -Added "fps" value to "getState" -Slightly improved getAccessCounters/getCdlData performance -Added a new drawPixels API to improve performance when a script needs to draw a lot of individual pixels
34 lines
656 B
C++
34 lines
656 B
C++
#pragma once
|
|
#include "pch.h"
|
|
#include "Shared/Video/DrawCommand.h"
|
|
|
|
class DrawPixelsCommand : public DrawCommand
|
|
{
|
|
private:
|
|
int _x, _y, _width, _height;
|
|
uint32_t* _data = nullptr;
|
|
|
|
protected:
|
|
void InternalDraw()
|
|
{
|
|
int pos = 0;
|
|
for(int i = 0; i < _height; i++) {
|
|
for(int j = 0; j < _width; j++) {
|
|
DrawPixel(_x + j, _y + i, _data[pos] ^ 0xFF000000);
|
|
pos++;
|
|
}
|
|
}
|
|
}
|
|
|
|
public:
|
|
DrawPixelsCommand(uint32_t* data, int x, int y, int width, int height, int frameCount, int startFrame) : DrawCommand(startFrame, frameCount), _x(x), _y(y), _width(width), _height(height)
|
|
{
|
|
_data = data;
|
|
}
|
|
|
|
~DrawPixelsCommand()
|
|
{
|
|
delete[] _data;
|
|
}
|
|
};
|