Lines Matching refs:state

106     ggl_set_surface(c, &c->state.texture[tmu].surface, surface);
112 if (surface->format != c->state.buffers.color.format)
115 if (surface->width > c->state.buffers.coverageBufferSize) {
117 free(c->state.buffers.coverage);
118 c->state.buffers.coverage = (int16_t*)malloc(surface->width * 2);
119 c->state.buffers.coverageBufferSize =
120 c->state.buffers.coverage ? surface->width : 0;
122 ggl_set_surface(c, &(c->state.buffers.color), surface);
123 if (c->state.buffers.read.format == 0) {
124 ggl_set_surface(c, &(c->state.buffers.read), surface);
132 ggl_set_surface(c, &(c->state.buffers.read), surface);
139 ggl_set_surface(c, &(c->state.buffers.depth), surface);
141 c->state.buffers.depth.format = GGL_PIXEL_FORMAT_NONE;
150 c->state.scissor.user_left = x;
151 c->state.scissor.user_top = y;
152 c->state.scissor.user_right = x + width;
153 c->state.scissor.user_bottom = y + height;
202 if (c->state.enables & GGL_ENABLE_SMOOTH) {
203 c->state.enables &= ~GGL_ENABLE_SMOOTH;
208 if (!(c->state.enables & GGL_ENABLE_SMOOTH)) {
209 c->state.enables |= GGL_ENABLE_SMOOTH;
284 c->state.fog.color[GGLFormat::ALPHA]= 0xFF; // unused
285 c->state.fog.color[GGLFormat::RED] = (r - (r>>8))>>8;
286 c->state.fog.color[GGLFormat::GREEN]= (g - (g>>8))>>8;
287 c->state.fog.color[GGLFormat::BLUE] = (b - (b>>8))>>8;
292 const int e = (c->state.enables & GGL_ENABLE_FOG)?1:0;
294 if (enable) c->state.enables |= GGL_ENABLE_FOG;
295 else c->state.enables &= ~GGL_ENABLE_FOG;
305 c->state.blend.src = src;
306 c->state.blend.src_alpha = src;
307 c->state.blend.dst = dst;
308 c->state.blend.dst_alpha = dst;
309 c->state.blend.alpha_separate = 0;
310 if (c->state.enables & GGL_ENABLE_BLENDING) {
320 c->state.blend.src = src;
321 c->state.blend.src_alpha = srcAlpha;
322 c->state.blend.dst = dst;
323 c->state.blend.dst_alpha = dstAplha;
324 c->state.blend.alpha_separate = 1;
325 if (c->state.enables & GGL_ENABLE_BLENDING) {
452 texture_t& u = c->state.texture[tmu];
507 c->activeTMU = &(c->state.texture[tmu]);
523 if (c->state.mask.color != mask) {
524 c->state.mask.color = mask;
532 if (c->state.mask.depth != flag?1:0) {
533 c->state.mask.depth = flag?1:0;
541 if (c->state.mask.stencil != mask) {
542 c->state.mask.stencil = mask;
556 c->state.alpha_test.ref = gglFixedToIteratedColor(gglClampx(ref));
557 if (c->state.alpha_test.func != func) {
558 c->state.alpha_test.func = func;
572 if (c->state.depth_test.func != func) {
573 c->state.depth_test.func = func;
587 if (c->state.logic_op.opcode != opcode) {
588 c->state.logic_op.opcode = opcode;
598 if (c->state.enables & GGL_ENABLE_SCISSOR_TEST) {
599 const int32_t l = c->state.scissor.user_left;
600 const int32_t t = c->state.scissor.user_top;
601 const int32_t r = c->state.scissor.user_right;
602 const int32_t b = c->state.scissor.user_bottom;
603 c->state.scissor.left = max(0, l);
604 c->state.scissor.right = min(c->state.buffers.color.width, r);
605 c->state.scissor.top = max(0, t);
606 c->state.scissor.bottom = min(c->state.buffers.color.height, b);
608 c->state.scissor.left = 0;
609 c->state.scissor.top = 0;
610 c->state.scissor.right = c->state.buffers.color.width;
611 c->state.scissor.bottom = c->state.buffers.color.height;
617 const int e = (c->state.enables & GGL_ENABLE_BLENDING)?1:0;
619 if (enable) c->state.enables |= GGL_ENABLE_BLENDING;
620 else c->state.enables &= ~GGL_ENABLE_BLENDING;
627 const int e = (c->state.enables & GGL_ENABLE_SCISSOR_TEST)?1:0;
629 if (enable) c->state.enables |= GGL_ENABLE_SCISSOR_TEST;
630 else c->state.enables &= ~GGL_ENABLE_SCISSOR_TEST;
637 const int e = (c->state.enables & GGL_ENABLE_ALPHA_TEST)?1:0;
639 if (enable) c->state.enables |= GGL_ENABLE_ALPHA_TEST;
640 else c->state.enables &= ~GGL_ENABLE_ALPHA_TEST;
647 const int e = (c->state.enables & GGL_ENABLE_LOGIC_OP)?1:0;
649 if (enable) c->state.enables |= GGL_ENABLE_LOGIC_OP;
650 else c->state.enables &= ~GGL_ENABLE_LOGIC_OP;
657 const int e = (c->state.enables & GGL_ENABLE_DITHER)?1:0;
659 if (enable) c->state.enables |= GGL_ENABLE_DITHER;
660 else c->state.enables &= ~GGL_ENABLE_DITHER;
671 if (c->state.buffers.depth.format == 0)
673 const int e = (c->state.enables & GGL_ENABLE_DEPTH_TEST)?1:0;
675 if (enable) c->state.enables |= GGL_ENABLE_DEPTH_TEST;
676 else c->state.enables &= ~GGL_ENABLE_DEPTH_TEST;
683 const int e = (c->state.enables & GGL_ENABLE_AA)?1:0;
685 if (enable) c->state.enables |= GGL_ENABLE_AA;
686 else c->state.enables &= ~GGL_ENABLE_AA;
693 const int e = (c->state.enables & GGL_ENABLE_POINT_AA_NICE)?1:0;
695 if (enable) c->state.enables |= GGL_ENABLE_POINT_AA_NICE;
696 else c->state.enables &= ~GGL_ENABLE_POINT_AA_NICE;
703 const int e = (c->state.enables & GGL_ENABLE_W)?1:0;
705 if (enable) c->state.enables |= GGL_ENABLE_W;
706 else c->state.enables &= ~GGL_ENABLE_W;
717 if (enable) c->state.enabled_tmu |= mask;
718 else c->state.enabled_tmu &= ~mask;
719 if (c->state.enabled_tmu) c->state.enables |= GGL_ENABLE_TMUS;
720 else c->state.enables &= ~GGL_ENABLE_TMUS;
794 c->state.blend.src = GGL_ONE;
795 c->state.blend.dst = GGL_ZERO;
796 c->state.blend.src_alpha = GGL_ONE;
797 c->state.blend.dst_alpha = GGL_ZERO;
798 c->state.mask.color = 0xF;
799 c->state.mask.depth = 0;
800 c->state.mask.stencil = 0xFFFFFFFF;
801 c->state.logic_op.opcode = GGL_COPY;
802 c->state.alpha_test.func = GGL_ALWAYS;
803 c->state.depth_test.func = GGL_LESS;
804 c->state.depth_test.clearValue = FIXED_ONE;