Skip to content
Permalink
Browse files

windows: fixed builds

  • Loading branch information
JaCzekanski committed Aug 14, 2019
1 parent 427dc74 commit a8fa225ac8ade0586a75d12de66d3f2168bf0833
@@ -3,14 +3,14 @@ version: '{branch}-{build}'
clone_depth: 1

environment:
PREMAKE_VERSION: 5.0.0-alpha13
SDL_VERSION: 2.0.9
PREMAKE_VERSION: 5.0.0-alpha14
SDL_VERSION: 2.0.10
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 Preview
TOOLSET: vs2017
TOOLSET: vs2019
platform: x64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 Preview
TOOLSET: vs2017
TOOLSET: vs2019
platform: Win32
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: vs2017
@@ -205,10 +205,16 @@ project "avocado"
}

filter {"system:windows", "not options:headless", "platforms:x86"}
libdirs "externals/SDL2/lib/x86"
libdirs {
"externals/SDL2/lib/x86",
"externals/SDL2/VisualC/Win32/Release",
}

filter {"system:windows", "not options:headless", "platforms:x64"}
libdirs "externals/SDL2/lib/x64"
libdirs {
"externals/SDL2/lib/x64",
"externals/SDL2/VisualC/x64/Release",
}


filter {"system:linux", "not options:headless"}
@@ -2,7 +2,6 @@
#include <cassert>
#include <cstdio>
#include "config.h"
#include "rectangle.h"
#include "render/render.h"
#include "utils/logic.h"
#include "utils/macros.h"
@@ -106,7 +105,7 @@ void GPU::drawPolygon(int16_t x[4], int16_t y[4], RGB c[4], TextureInfo t, bool
}
}

void GPU::drawRectangle(const Rectangle& rect) {
void GPU::drawRectangle(const primitive::Rect& rect) {
if (hardwareRendering) {
int x[4], y[4];
glm::ivec2 uv[4];
@@ -283,7 +282,7 @@ void GPU::cmdRectangle(RectangleArgs arg) {
int16_t x = extend_sign<10>(arguments[1] & 0xffff);
int16_t y = extend_sign<10>((arguments[1] & 0xffff0000) >> 16);

Rectangle rect;
primitive::Rect rect;
rect.pos = vec2(x, y);
rect.size = vec2(w, h);
rect.color = vec3((arguments[0]) & 0xff, (arguments[0] >> 8) & 0xff, (arguments[0] >> 16) & 0xff);
@@ -2,12 +2,12 @@
#include <array>
#include <glm/glm.hpp>
#include <vector>
#include "primitive.h"
#include "psx_color.h"
#include "registers.h"

#define VRAM ((uint16_t(*)[VRAM_WIDTH])vram.data())

struct Rectangle;
struct System;
class Render;
class OpenGL;
@@ -108,7 +108,7 @@ class GPU {
void cmdVramToVram(uint8_t command);

void drawPolygon(int16_t x[4], int16_t y[4], RGB c[4], TextureInfo t, bool isQuad = false, bool textured = false, int flags = 0);
void drawRectangle(const Rectangle& rect);
void drawRectangle(const primitive::Rect& rect);

void writeGP0(uint32_t data);
void writeGP1(uint32_t data);
@@ -1,7 +1,8 @@
#pragma once
#include <glm/glm.hpp>

struct Rectangle {
namespace primitive {
struct Rect {
glm::ivec2 pos;
glm::ivec2 size;
glm::ivec3 color;
@@ -15,4 +16,5 @@ struct Rectangle {
glm::ivec2 uv;
glm::ivec2 texpage; // Texture page position in VRAM (from GP0_E1)
glm::ivec2 clut; // Texture palette position in VRAM
};
};
} // namespace primitives
@@ -5,5 +5,5 @@ class Render {
public:
static void drawLine(gpu::GPU* gpu, const int16_t x[2], const int16_t y[2], const RGB c[2]);
static void drawTriangle(gpu::GPU* gpu, gpu::Vertex v[3]);
static void drawRectangle(gpu::GPU* gpu, const Rectangle& rect);
static void drawRectangle(gpu::GPU* gpu, const primitive::Rect& rect);
};
@@ -1,4 +1,4 @@
#include "device/gpu/rectangle.h"
#include "../primitive.h"
#include "render.h"
#include "texture_utils.h"
#include "utils/macros.h"
@@ -26,7 +26,7 @@ INLINE glm::uvec2 calculateTexel(glm::ivec2 tex, const gpu::GP0_E2 textureWindow
}

template <ColorDepth bits>
INLINE void rectangle(GPU* gpu, const Rectangle& rect) {
INLINE void rectangle(GPU* gpu, const primitive::Rect& rect) {
// Extract common GPU state
using Transparency = gpu::GP0_E1::SemiTransparency;
const auto transparency = gpu->gp0_e1.semiTransparency;
@@ -102,7 +102,7 @@ INLINE void rectangle(GPU* gpu, const Rectangle& rect) {
}
}
}
void Render::drawRectangle(gpu::GPU* gpu, const Rectangle& rect) {
void Render::drawRectangle(gpu::GPU* gpu, const primitive::Rect& rect) {
if (rect.bits == 0) {
rectangle<ColorDepth::NONE>(gpu, rect);
} else if (rect.bits == 4) {
@@ -1,4 +1,5 @@
#include "voice.h"
#include <cmath>
#include "sound/adpcm.h"
#include "utils/math.h"

@@ -61,7 +62,8 @@ void Voice::processEnvelope() {
cycles *= 4;
}
if (e.direction == Dir::Decrease) {
step = static_cast<int>(static_cast<float>(step) * std::ceil(static_cast<float>(adsrVolume._reg) / static_cast<float>(0x8000)));
step
= static_cast<int>(static_cast<float>(step) * std::ceilf(static_cast<float>(adsrVolume._reg) / static_cast<float>(0x8000)));
}
}

@@ -1,10 +1,9 @@
#include "opengl.h"
#include <SDL.h>
#include <algorithm>
#include "config.h"
#include "device/gpu/gpu.h"
#define STB_IMAGE_WRITE_IMPLEMENTATION
#include <stb_image_write.h>
#include "config.h"
#include "utils/string.h"

bool OpenGL::init() {
@@ -1,13 +1,12 @@
#pragma once
#include <opengl.h>
#include <memory>
#include "device/gpu/gpu.h"
#include "shader/buffer.h"
#include "shader/framebuffer.h"
#include "shader/program.h"
#include "shader/texture.h"

class gpu::GPU;

class OpenGL {
public:
#ifdef USE_OPENGLES

0 comments on commit a8fa225

Please sign in to comment.
You can’t perform that action at this time.