@@ -138,7 +138,7 @@ static void psp_on_vblank(u32 sub, PSP_RenderData *data)
138
138
}
139
139
}
140
140
141
- static unsigned int getMemorySize (unsigned int width , unsigned int height , unsigned int psm )
141
+ static inline unsigned int getMemorySize (unsigned int width , unsigned int height , unsigned int psm )
142
142
{
143
143
switch (psm )
144
144
{
@@ -163,7 +163,7 @@ static unsigned int getMemorySize(unsigned int width, unsigned int height, unsig
163
163
}
164
164
}
165
165
166
- static int pixelFormatToPSPFMT (Uint32 format )
166
+ static inline int pixelFormatToPSPFMT (Uint32 format )
167
167
{
168
168
switch (format ) {
169
169
case SDL_PIXELFORMAT_BGR565 :
@@ -179,7 +179,7 @@ static int pixelFormatToPSPFMT(Uint32 format)
179
179
}
180
180
}
181
181
182
- static int calculatePitchForTextureFormat (int width , int format )
182
+ static inline int calculatePitchForTextureFormat (int width , int format )
183
183
{
184
184
switch (format ) {
185
185
case GU_PSM_5650 :
@@ -194,7 +194,7 @@ static int calculatePitchForTextureFormat(int width, int format)
194
194
}
195
195
196
196
/* Return next power of 2 */
197
- static int calculateNextPow2 (int value )
197
+ static inline int calculateNextPow2 (int value )
198
198
{
199
199
int i = 1 ;
200
200
while (i < value ) {
@@ -203,7 +203,7 @@ static int calculateNextPow2(int value)
203
203
return i ;
204
204
}
205
205
206
- static int calculateBestSliceSizeForTexture (SDL_Texture * texture , SliceSize * uvSize , SliceSize * sliceSize , SliceSize * sliceDimension ) {
206
+ static inline int calculateBestSliceSizeForTexture (SDL_Texture * texture , SliceSize * uvSize , SliceSize * sliceSize , SliceSize * sliceDimension ) {
207
207
int i ;
208
208
uint8_t horizontalSlices , verticalSlices ;
209
209
int pixelBits = 0 ;
@@ -257,7 +257,7 @@ static int calculateBestSliceSizeForTexture(SDL_Texture *texture, SliceSize *uvS
257
257
return 0 ;
258
258
}
259
259
260
- static void fillSpriteVertices (VertTV * vertices , SliceSize * dimensions , SliceSize * sliceSize ,
260
+ static inline void fillSpriteVertices (VertTV * vertices , SliceSize * dimensions , SliceSize * sliceSize ,
261
261
const SDL_Rect * srcrect , const SDL_FRect * dstrect ) {
262
262
int i , j ;
263
263
int remainingWidth = srcrect -> w % sliceSize -> width ;
@@ -580,55 +580,6 @@ static int PSP_RenderSetViewPort(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
580
580
return 0 ;
581
581
}
582
582
583
- static int PSP_RenderSetClipRect (SDL_Renderer * renderer , SDL_RenderCommand * cmd )
584
- {
585
- PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
586
-
587
- const SDL_Rect * rect = & cmd -> data .cliprect .rect ;
588
-
589
- if (cmd -> data .cliprect .enabled ) {
590
- sceGuEnable (GU_SCISSOR_TEST );
591
- sceGuScissor (rect -> x , rect -> y , rect -> w , rect -> h );
592
- } else {
593
- sceGuDisable (GU_SCISSOR_TEST );
594
- }
595
-
596
- return 0 ;
597
- }
598
-
599
- static int PSP_RenderSetDrawColor (SDL_Renderer * renderer , SDL_RenderCommand * cmd )
600
- {
601
- uint8_t colorR , colorG , colorB , colorA ;
602
-
603
- PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
604
-
605
- colorR = cmd -> data .color .r ;
606
- colorG = cmd -> data .color .g ;
607
- colorB = cmd -> data .color .b ;
608
- colorA = cmd -> data .color .a ;
609
- sceGuColor (GU_RGBA (colorR , colorG , colorB , colorA ));
610
-
611
- return 0 ;
612
- }
613
-
614
- static int PSP_RenderClear (SDL_Renderer * renderer , SDL_RenderCommand * cmd )
615
- {
616
- uint8_t colorR , colorG , colorB , colorA ;
617
-
618
- PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
619
-
620
- colorR = cmd -> data .color .r ;
621
- colorG = cmd -> data .color .g ;
622
- colorB = cmd -> data .color .b ;
623
- colorA = cmd -> data .color .a ;
624
-
625
- sceGuClearColor (GU_RGBA (colorR , colorG , colorB , colorA ));
626
- sceGuClearDepth (0 );
627
- sceGuClear (GU_COLOR_BUFFER_BIT |GU_DEPTH_BUFFER_BIT );
628
-
629
- return 0 ;
630
- }
631
-
632
583
static void PSP_SetBlendMode (PSP_RenderData * data , PSP_BlendInfo blendInfo )
633
584
{
634
585
// Update the blend mode if necessary
@@ -682,7 +633,56 @@ static void PSP_SetBlendMode(PSP_RenderData *data, PSP_BlendInfo blendInfo)
682
633
}
683
634
}
684
635
685
- static int PSP_RenderGeometry (SDL_Renderer * renderer , void * vertices , SDL_RenderCommand * cmd )
636
+ static inline int PSP_RenderSetClipRect (SDL_Renderer * renderer , SDL_RenderCommand * cmd )
637
+ {
638
+ PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
639
+
640
+ const SDL_Rect * rect = & cmd -> data .cliprect .rect ;
641
+
642
+ if (cmd -> data .cliprect .enabled ) {
643
+ sceGuEnable (GU_SCISSOR_TEST );
644
+ sceGuScissor (rect -> x , rect -> y , rect -> w , rect -> h );
645
+ } else {
646
+ sceGuDisable (GU_SCISSOR_TEST );
647
+ }
648
+
649
+ return 0 ;
650
+ }
651
+
652
+ static inline int PSP_RenderSetDrawColor (SDL_Renderer * renderer , SDL_RenderCommand * cmd )
653
+ {
654
+ uint8_t colorR , colorG , colorB , colorA ;
655
+
656
+ PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
657
+
658
+ colorR = cmd -> data .color .r ;
659
+ colorG = cmd -> data .color .g ;
660
+ colorB = cmd -> data .color .b ;
661
+ colorA = cmd -> data .color .a ;
662
+ sceGuColor (GU_RGBA (colorR , colorG , colorB , colorA ));
663
+
664
+ return 0 ;
665
+ }
666
+
667
+ static inline int PSP_RenderClear (SDL_Renderer * renderer , SDL_RenderCommand * cmd )
668
+ {
669
+ uint8_t colorR , colorG , colorB , colorA ;
670
+
671
+ PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
672
+
673
+ colorR = cmd -> data .color .r ;
674
+ colorG = cmd -> data .color .g ;
675
+ colorB = cmd -> data .color .b ;
676
+ colorA = cmd -> data .color .a ;
677
+
678
+ sceGuClearColor (GU_RGBA (colorR , colorG , colorB , colorA ));
679
+ sceGuClearDepth (0 );
680
+ sceGuClear (GU_COLOR_BUFFER_BIT |GU_DEPTH_BUFFER_BIT );
681
+
682
+ return 0 ;
683
+ }
684
+
685
+ static inline int PSP_RenderGeometry (SDL_Renderer * renderer , void * vertices , SDL_RenderCommand * cmd )
686
686
{
687
687
PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
688
688
const size_t count = cmd -> data .draw .count ;
@@ -711,7 +711,7 @@ static int PSP_RenderGeometry(SDL_Renderer *renderer, void *vertices, SDL_Render
711
711
return 0 ;
712
712
}
713
713
714
- int PSP_RenderLines (SDL_Renderer * renderer , void * vertices , SDL_RenderCommand * cmd )
714
+ static inline int PSP_RenderLines (SDL_Renderer * renderer , void * vertices , SDL_RenderCommand * cmd )
715
715
{
716
716
PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
717
717
const size_t count = cmd -> data .draw .count ;
@@ -727,7 +727,7 @@ int PSP_RenderLines(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand *c
727
727
return 0 ;
728
728
}
729
729
730
- int PSP_RenderFillRects (SDL_Renderer * renderer , void * vertices , SDL_RenderCommand * cmd )
730
+ static inline int PSP_RenderFillRects (SDL_Renderer * renderer , void * vertices , SDL_RenderCommand * cmd )
731
731
{
732
732
PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
733
733
const size_t count = cmd -> data .draw .count ;
@@ -744,7 +744,7 @@ int PSP_RenderFillRects(SDL_Renderer *renderer, void *vertices, SDL_RenderComman
744
744
}
745
745
746
746
747
- int PSP_RenderPoints (SDL_Renderer * renderer , void * vertices , SDL_RenderCommand * cmd )
747
+ static inline int PSP_RenderPoints (SDL_Renderer * renderer , void * vertices , SDL_RenderCommand * cmd )
748
748
{
749
749
PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
750
750
const size_t count = cmd -> data .draw .count ;
@@ -760,7 +760,7 @@ int PSP_RenderPoints(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand *
760
760
return 0 ;
761
761
}
762
762
763
- int PSP_RenderCopy (SDL_Renderer * renderer , void * vertices , SDL_RenderCommand * cmd )
763
+ static inline int PSP_RenderCopy (SDL_Renderer * renderer , void * vertices , SDL_RenderCommand * cmd )
764
764
{
765
765
PSP_RenderData * data = (PSP_RenderData * )renderer -> driverdata ;
766
766
const size_t count = cmd -> data .draw .count ;
0 commit comments