Sfoglia il codice sorgente

core: more vec?i -> ?veci renames.

legacy
Sam Hocevar sam 13 anni fa
parent
commit
2b9d64f7a8
16 ha cambiato i file con 27 aggiunte e 29 eliminazioni
  1. +2
    -2
      src/debug/fps.cpp
  2. +1
    -1
      src/font.cpp
  3. +1
    -1
      src/font.h
  4. +3
    -3
      src/input.cpp
  5. +1
    -1
      src/input.h
  6. +1
    -1
      src/layer.cpp
  7. +3
    -3
      src/matrix.h
  8. +2
    -2
      src/platform/ps3/ps3input.cpp
  9. +2
    -2
      src/scene.cpp
  10. +1
    -1
      src/scene.h
  11. +1
    -3
      src/sprite.cpp
  12. +4
    -4
      src/text.cpp
  13. +1
    -1
      src/text.h
  14. +1
    -1
      src/tileset.cpp
  15. +1
    -1
      src/tileset.h
  16. +2
    -2
      src/worldentity.h

+ 2
- 2
src/debug/fps.cpp Vedi File

@@ -45,12 +45,12 @@ DebugFps::DebugFps(int x, int y)
for (int i = 0; i < 5; i ++)
{
data->lines[i] = new Text(NULL, "gfx/font/ascii.png");
data->lines[i]->SetPos(vec3i(x, y + (i ? 8 : 0) + 16 * i, 0));
data->lines[i]->SetPos(ivec3(x, y + (i ? 8 : 0) + 16 * i, 0));
Ticker::Ref(data->lines[i]);
}
#else
data->lines[0] = new Text(NULL, "gfx/font/ascii.png");
data->lines[0]->SetPos(vec3i(x, y, 100));
data->lines[0]->SetPos(ivec3(x, y, 100));
Ticker::Ref(data->lines[0]);
#endif
}


+ 1
- 1
src/font.cpp Vedi File

@@ -69,7 +69,7 @@ char const *Font::GetName()
return data->name;
}

void Font::Print(vec3i pos, char const *str)
void Font::Print(vec3 pos, char const *str)
{
Scene *scene = Scene::GetDefault();



+ 1
- 1
src/font.h Vedi File

@@ -36,7 +36,7 @@ protected:

public:
/* New methods */
void Print(vec3i pos, char const *str);
void Print(vec3 pos, char const *str);
ivec2 GetSize() const;

private:


+ 3
- 3
src/input.cpp Vedi File

@@ -42,7 +42,7 @@ public:

private:
ivec2 mouse;
vec3i buttons;
ivec3 buttons;

static int const MAX_ENTITIES = 100;
WorldEntity *entities[MAX_ENTITIES];
@@ -82,7 +82,7 @@ ivec2 Input::GetMousePos()
return data->mouse;
}

vec3i Input::GetMouseButtons()
ivec3 Input::GetMouseButtons()
{
return data->buttons;
}
@@ -130,7 +130,7 @@ void Input::SetMousePos(ivec2 coord)
{
if (data->entities[n] == top)
{
data->entities[n]->mousepos = (ivec2)((vec3i)coord - top->bbox[0]);
data->entities[n]->mousepos = (ivec2)((ivec3)coord - top->bbox[0]);
if (top != data->lastfocus)
data->entities[n]->pressed = data->buttons;
else


+ 1
- 1
src/input.h Vedi File

@@ -29,7 +29,7 @@ public:
/* These methods are general queries */
static vec2 GetAxis(int axis);
static ivec2 GetMousePos();
static vec3i GetMouseButtons();
static ivec3 GetMouseButtons();

/* Entities can subscribe to events */
static void TrackMouse(WorldEntity *e);


+ 1
- 1
src/layer.cpp Vedi File

@@ -56,7 +56,7 @@ void Layer::Render(int x, int y, int z)
for (int i = 0; i < width; i++)
if (data[j * width + i])
scene->AddTile(data[j * width + i],
vec3i(x + i * 32,
vec3(x + i * 32,
y + j * 32 - altitude,
altitude + z),
orientation);


+ 3
- 3
src/matrix.h Vedi File

@@ -160,7 +160,7 @@ template <typename T> struct Vec3
};

typedef Vec3<float> vec3;
typedef Vec3<int> vec3i;
typedef Vec3<int> ivec3;

template <typename T> struct Vec4
{
@@ -177,7 +177,7 @@ template <typename T> struct Vec4
};

typedef Vec4<float> vec4;
typedef Vec4<int> vec4i;
typedef Vec4<int> ivec4;

#define SCALAR_GLOBAL(elems, op, U) \
template<typename T> \
@@ -296,7 +296,7 @@ template <typename T> struct Mat4
};

typedef Mat4<float> mat4;
typedef Mat4<int> mat4i;
typedef Mat4<int> imat4;

} /* namespace lol */



+ 2
- 2
src/platform/ps3/ps3input.cpp Vedi File

@@ -40,7 +40,7 @@ class Ps3InputData

#if defined __CELLOS_LV2__
vec2 mousepos;
vec3i mousebuttons;
ivec3 mousebuttons;

CellPadData pad_data[NUM_PADS];
CellPadFilterIIRSos filter_sos[NUM_PADS][4];
@@ -75,7 +75,7 @@ Ps3Input::Ps3Input()
CELL_PADFILTER_IIR_CUTOFF_2ND_LPF_BT_010);

data->mousepos = vec2(320.0f, 240.0f);
data->mousebuttons = vec3i(0, 0, 0);
data->mousebuttons = ivec3(0, 0, 0);

gamegroup = GAMEGROUP_BEFORE;
#endif


+ 2
- 2
src/scene.cpp Vedi File

@@ -30,7 +30,7 @@ struct Tile
{
TileSet *tileset;
uint32_t prio;
vec3i pos;
vec3 pos;
int id, o;
};

@@ -117,7 +117,7 @@ void Scene::Reset()
SceneData::scene = NULL;
}

void Scene::AddTile(TileSet *tileset, int id, vec3i pos, int o)
void Scene::AddTile(TileSet *tileset, int id, vec3 pos, int o)
{
if ((data->ntiles % 1024) == 0)
data->tiles = (Tile *)realloc(data->tiles,


+ 1
- 1
src/scene.h Vedi File

@@ -34,7 +34,7 @@ public:
static Scene *GetDefault();
static void Reset();

void AddTile(TileSet *tileset, int id, vec3i pos, int o);
void AddTile(TileSet *tileset, int id, vec3 pos, int o);
void Render();

private:


+ 1
- 3
src/sprite.cpp Vedi File

@@ -52,9 +52,7 @@ void Sprite::TickDraw(float deltams)
{
Entity::TickDraw(deltams);

vec3i pos = (vec3i)data->pos;

Scene::GetDefault()->AddTile(data->tileset, data->id, pos, 0);
Scene::GetDefault()->AddTile(data->tileset, data->id, data->pos, 0);
}

Sprite::~Sprite()


+ 4
- 4
src/text.cpp Vedi File

@@ -34,7 +34,7 @@ class TextData
private:
int font, align, length;
char *text;
vec3i pos;
vec3 pos;
};

/*
@@ -47,7 +47,7 @@ Text::Text(char const *text, char const *font)
data->font = Forge::Register(font);
data->text = text ? strdup(text) : NULL;
data->length = text ? strlen(text) : 0;
data->pos = vec3i(0, 0, 0);
data->pos = vec3(0, 0, 0);

drawgroup = DRAWGROUP_HUD;
}
@@ -70,7 +70,7 @@ void Text::SetInt(int val)
data->length = strlen(text);
}

void Text::SetPos(vec3i pos)
void Text::SetPos(vec3 pos)
{
data->pos = pos;
}
@@ -87,7 +87,7 @@ void Text::TickDraw(float deltams)
if (data->text)
{
Font *font = Forge::GetFont(data->font);
vec3i delta = 0;
vec3 delta = 0;
if (data->align == ALIGN_RIGHT)
delta.x -= data->length * font->GetSize().x;
else if (data->align == ALIGN_CENTER)


+ 1
- 1
src/text.h Vedi File

@@ -31,7 +31,7 @@ public:

void SetText(char const *text);
void SetInt(int val);
void SetPos(vec3i pos);
void SetPos(vec3 pos);
void SetAlign(int align);

enum


+ 1
- 1
src/tileset.cpp Vedi File

@@ -178,7 +178,7 @@ void TileSet::Bind()
}
}

void TileSet::BlitTile(uint32_t id, vec3i pos, int o,
void TileSet::BlitTile(uint32_t id, vec3 pos, int o,
float *vertex, float *texture)
{
float tx = data->tx * ((id & 0xffff) % data->count.i);


+ 1
- 1
src/tileset.h Vedi File

@@ -44,7 +44,7 @@ public:
ivec2 GetCount() const;
ivec2 GetSize(int tileid) const;
void Bind();
void BlitTile(uint32_t id, vec3i pos, int o,
void BlitTile(uint32_t id, vec3 pos, int o,
float *vertex, float *texture);

private:


+ 2
- 2
src/worldentity.h Vedi File

@@ -30,8 +30,8 @@ public:
vec3 bbox[2];

ivec2 mousepos;
vec3i mousebuttons;
vec3i pressed, clicked, released;
ivec3 mousebuttons;
ivec3 pressed, clicked, released;

protected:
WorldEntity();


Caricamento…
Annulla
Salva