fix: applied fixes for g++
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
#ifndef FASTMATH_H
|
||||
#define FASTMATH_H
|
||||
|
||||
#include <iostream>
|
||||
#include <math.h>
|
||||
#include <iostream>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#define SHIFT_AMOUNT 16
|
||||
#define HALF_SHIFT (SHIFT_AMOUNT / 2)
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define POLYGON_H
|
||||
|
||||
#include "fastmath.hpp"
|
||||
#include <iostream>
|
||||
struct polygon {
|
||||
|
||||
vec3 points[3];
|
||||
@@ -60,7 +61,7 @@ struct polygon {
|
||||
|
||||
vec3 avgNormal() {
|
||||
vec3 result;
|
||||
for (int i = 0; i++; i < 3) {
|
||||
for (int i = 0; i < 3;i++) {
|
||||
result += normals[i];
|
||||
}
|
||||
return result * decimal(0.3333);
|
||||
|
||||
@@ -70,15 +70,15 @@ class Renderer {
|
||||
|
||||
testP.calcDelta();
|
||||
|
||||
int startX = std::max(
|
||||
int startX = std::max<int>(
|
||||
(testP.bounding[0] * invWidthScale).i >> SHIFT_AMOUNT, 0);
|
||||
int endX =
|
||||
std::min((testP.bounding[1] * invWidthScale).i >> SHIFT_AMOUNT,
|
||||
std::min<int>((testP.bounding[1] * invWidthScale).i >> SHIFT_AMOUNT,(uint32_t)
|
||||
target->width - 1);
|
||||
int startY = std::max(
|
||||
int startY = std::max<int>(
|
||||
(testP.bounding[2] * invHeightScale).i >> SHIFT_AMOUNT, 0);
|
||||
int endY =
|
||||
std::min((testP.bounding[3] * invHeightScale).i >> SHIFT_AMOUNT,
|
||||
std::min<int>((testP.bounding[3] * invHeightScale).i >> SHIFT_AMOUNT,
|
||||
target->height - 1);
|
||||
|
||||
vec3 pos = vec3(testP.bounding[0], testP.bounding[2], 0.0);
|
||||
|
||||
Reference in New Issue
Block a user