- [NEW] Afegit clipboard al backend
- [NEW] surfaces ara usa un vector dinàmic - [FIX] Ajustades dereferenciacions per a arreglar la caiguda de rendiment
This commit is contained in:
@@ -83,6 +83,14 @@ namespace backend
|
||||
return current_state;
|
||||
}
|
||||
|
||||
char *clipboard() {
|
||||
return SDL_GetClipboardText();
|
||||
}
|
||||
|
||||
void clipboard(const char* value) {
|
||||
SDL_SetClipboardText(value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -65,7 +65,9 @@ namespace backend
|
||||
uint32_t *pixels;
|
||||
int pitch;
|
||||
SDL_LockTexture(tex_back, NULL, (void**)&pixels, &pitch);
|
||||
for (uint32_t i=0;i<mini::surf::state.screen_surface->size;++i) pixels[i] = mini::pal::palette[mini::surf::state.screen_surface->p[i]];
|
||||
auto &s = mini::surf::state.surfaces[SCREEN];
|
||||
uint8_t *p = s.p;
|
||||
for (uint32_t i=0;i<s.size;++i) pixels[i] = mini::pal::palette[p[i]];
|
||||
SDL_UnlockTexture(tex_back);
|
||||
SDL_RenderTexture(renderer, tex_back, NULL, NULL); //NEW
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ namespace backend
|
||||
const state_t& state();
|
||||
void exit();
|
||||
uint64_t get_time_ms();
|
||||
char* clipboard();
|
||||
void clipboard(const char* value);
|
||||
|
||||
namespace video
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user