MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / clear

Method clear

platform/sdl/knativescreenSDL.cpp:162–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

160}
161
162void KNativeScreenSDL::clear() {
163#ifdef BOXEDWINE_RECORDER
164 if (Recorder::instance) {
165 BOXEDWINE_MUTEX_LOCK(drawingMutex);
166 }
167 if (Recorder::instance || Player::instance) {
168 U32 size = screenWidth() * screenHeight() * 4;
169 if (recordBufferSize < size) {
170 delete[] recordBuffer;
171 recordBuffer = new U8[size];
172 recordBufferSize = size;
173 }
174 if (bpp == 32) {
175 U32* pixel = (U32*)recordBuffer;
176 U32 len = screenWidth() * screenHeight();
177 for (U32 i = 0; i < len; i++, pixel++) {
178 *pixel = 165 | (110 << 8) | (58 << 16) | (255 << 24);
179 }
180 } else {
181 memset(recordBuffer, 0, recordBufferSize);
182 }
183 }
184#endif
185 if (KSystem::videoOption != VIDEO_NO_WINDOW && renderer) {
186 SDL_SetRenderDrawColor(renderer, 58, 110, 165, 255);
187 SDL_RenderClear(renderer);
188 }
189}
190
191void KNativeScreenSDL::putBitsOnWnd(U32 id, U8* bits, U32 bitsPerPixel, U32 srcPitch, S32 dstX, S32 dstY, U32 width, U32 height, U32* palette, bool isDirty) {
192 if (!bitsPerPixel || !srcPitch) {

Callers 5

initMethod · 0.45
clearTextureCacheMethod · 0.45
destroyTextureCacheMethod · 0.45
shutdownMethod · 0.45
initMethod · 0.45

Calls 2

SDL_SetRenderDrawColorFunction · 0.85
SDL_RenderClearFunction · 0.85

Tested by

no test coverage detected