Skip to content

Commit a79285c

Browse files
committed
Use define to set alignment for vram assignment
1 parent 28c2948 commit a79285c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/gu/vram.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
#include <pspge.h>
1010
#include <pspgu.h>
1111

12+
#define ALIGNMENT 16
13+
1214
static unsigned int staticOffset = 0;
13-
static const unsigned int alignment = 16;
1415

1516
static unsigned int getMemorySize(unsigned int width, unsigned int height, unsigned int psm)
1617
{
@@ -40,7 +41,7 @@ static unsigned int getMemorySize(unsigned int width, unsigned int height, unsig
4041
void* guGetStaticVramBuffer(unsigned int width, unsigned int height, unsigned int psm)
4142
{
4243
unsigned int memSize = getMemorySize(width,height,psm);
43-
staticOffset = (staticOffset + (alignment-1)) &~ (alignment-1);
44+
staticOffset = (staticOffset + (ALIGNMENT-1)) &~ (ALIGNMENT-1);
4445
void* result = (void*)staticOffset;
4546
staticOffset += memSize;
4647

0 commit comments

Comments
 (0)