mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-03 16:51:27 +00:00
Use define to set alignment for vram assignment
This commit is contained in:
committed by
Wouter Wijsman
parent
28c294881d
commit
a79285ce1d
@@ -9,8 +9,9 @@
|
|||||||
#include <pspge.h>
|
#include <pspge.h>
|
||||||
#include <pspgu.h>
|
#include <pspgu.h>
|
||||||
|
|
||||||
|
#define ALIGNMENT 16
|
||||||
|
|
||||||
static unsigned int staticOffset = 0;
|
static unsigned int staticOffset = 0;
|
||||||
static const unsigned int alignment = 16;
|
|
||||||
|
|
||||||
static unsigned int getMemorySize(unsigned int width, unsigned int height, unsigned int psm)
|
static unsigned int getMemorySize(unsigned int width, unsigned int height, unsigned int psm)
|
||||||
{
|
{
|
||||||
@@ -40,7 +41,7 @@ static unsigned int getMemorySize(unsigned int width, unsigned int height, unsig
|
|||||||
void* guGetStaticVramBuffer(unsigned int width, unsigned int height, unsigned int psm)
|
void* guGetStaticVramBuffer(unsigned int width, unsigned int height, unsigned int psm)
|
||||||
{
|
{
|
||||||
unsigned int memSize = getMemorySize(width,height,psm);
|
unsigned int memSize = getMemorySize(width,height,psm);
|
||||||
staticOffset = (staticOffset + (alignment-1)) &~ (alignment-1);
|
staticOffset = (staticOffset + (ALIGNMENT-1)) &~ (ALIGNMENT-1);
|
||||||
void* result = (void*)staticOffset;
|
void* result = (void*)staticOffset;
|
||||||
staticOffset += memSize;
|
staticOffset += memSize;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user