Cube  Diff

Differences From Artifact [ae30288fea]:

To Artifact [60ed27f341]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
// worldrender.cpp: goes through all cubes in top down quad tree fashion,
// determines what has to be rendered and how (depending on neighbouring cubes),
// then calls functions in rendercubes.cpp

#include "cube.h"

#import "DynamicEntity.h"

void
render_wall(struct sqr *o, struct sqr *s, int x1, int y1, int x2, int y2,
    int mip, struct sqr *d1, struct sqr *d2, bool topleft)
{
	if (SOLID(o) || o->type == SEMISOLID) {
		float c1 = s->floor;






|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
// worldrender.cpp: goes through all cubes in top down quad tree fashion,
// determines what has to be rendered and how (depending on neighbouring cubes),
// then calls functions in rendercubes.cpp

#include "cube.h"

#import "Player.h"

void
render_wall(struct sqr *o, struct sqr *s, int x1, int y1, int x2, int y2,
    int mip, struct sqr *d1, struct sqr *d2, bool topleft)
{
	if (SOLID(o) || o->type == SEMISOLID) {
		float c1 = s->floor;
129
130
131
132
133
134
135

136
137
138
139
140
141
142
	    vxx - lodleft; // these mark the rect inside the current rest that
	                   // we want to render using a lower mip level
	int ly = vyy - lodtop;
	int rx = vxx + lodright;
	int ry = vyy + lodbot;

	float fsize = (float)(1 << mip);

	for (int ox = x; ox < xs; ox++) {
		// first collect occlusion information for this block
		for (int oy = y; oy < ys; oy++) {
			SWS(w, ox, oy, sz)->occluded =
			    isoccluded(player1.origin.x, player1.origin.y,
			        (float)(ox << mip), (float)(oy << mip), fsize);
		}







>







129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
	    vxx - lodleft; // these mark the rect inside the current rest that
	                   // we want to render using a lower mip level
	int ly = vyy - lodtop;
	int rx = vxx + lodright;
	int ry = vyy + lodbot;

	float fsize = (float)(1 << mip);
	Player *player1 = Player.player1;
	for (int ox = x; ox < xs; ox++) {
		// first collect occlusion information for this block
		for (int oy = y; oy < ys; oy++) {
			SWS(w, ox, oy, sz)->occluded =
			    isoccluded(player1.origin.x, player1.origin.y,
			        (float)(ox << mip), (float)(oy << mip), fsize);
		}