[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netPanzer-CVS] netpanzer/src Lib/2D/Span.cpp Lib/2D/Surface.cp...
From: |
Tyler Nielsen |
Subject: |
[netPanzer-CVS] netpanzer/src Lib/2D/Span.cpp Lib/2D/Surface.cp... |
Date: |
Mon, 08 Sep 2003 16:29:11 -0400 |
CVSROOT: /cvsroot/netpanzer
Module name: netpanzer
Branch:
Changes by: Tyler Nielsen <address@hidden> 03/09/08 16:29:10
Modified files:
src/Lib/2D : Span.cpp Surface.cpp
src/NetPanzer/Port: blitters.cpp
src/UILib : UIDraw.hpp
src/UILib/SDL : SDLDraw.cpp
Log message:
Finish off adding the blitters.
Remove some un-needed globals
Patches:
Index: netpanzer/src/Lib/2D/Span.cpp
diff -u netpanzer/src/Lib/2D/Span.cpp:1.6 netpanzer/src/Lib/2D/Span.cpp:1.7
--- netpanzer/src/Lib/2D/Span.cpp:1.6 Mon Sep 8 11:32:03 2003
+++ netpanzer/src/Lib/2D/Span.cpp Mon Sep 8 16:29:09 2003
@@ -203,9 +203,19 @@
void bltBlendScaleSpan(PIX *dRow, const PIX *sRow, int srcX1FracWithCount, int
stepAndDecCount, int stepWholePart, const BYTE *table)
{
if (!allowSpanBlitting) { return; } // Remove for release candidate.
-
- // XXX disabled msvc assembler routines
-#ifdef MSVC
+ int stepDecPart = stepAndDecCount>>16;
+ int stepCount=srcX1FracWithCount>>16;
+ for(int i=0;i<srcX1FracWithCount&0xffff;i++) {
+ dRow[i] = table[(dRow[i]<<8)+*sRow];
+ sRow+=stepWholePart;
+ stepCount+=stepDecPart;
+ if(stepCount>0xffff) {
+ stepCount-=0xffff;
+ sRow+=1;
+ }
+ }
+
+#if 0
_asm {
mov edi, [dRow]
mov esi, [sRow]
@@ -367,10 +377,19 @@
int stepAndDecCount, int stepWholePart)
{
if (!allowSpanBlitting) { return; } // Remove for release candidate.
- // XXX not needed anymore at the moment...
+ int stepDecPart = stepAndDecCount>>16;
+ int stepCount=srcX1FracWithCount>>16;
+ for(int i=0;i<srcX1FracWithCount&0xffff;i++) {
+ dRow[i] = *sRow;
+ sRow+=stepWholePart;
+ stepCount+=stepDecPart;
+ if(stepCount>0xffff) {
+ stepCount-=0xffff;
+ sRow+=1;
+ }
+ }
- // XXX disabled msvc assembler
-#ifdef MSVC
+#if 0
_asm {
mov edi, [dRow]
mov esi, [sRow]
Index: netpanzer/src/Lib/2D/Surface.cpp
diff -u netpanzer/src/Lib/2D/Surface.cpp:1.12
netpanzer/src/Lib/2D/Surface.cpp:1.13
--- netpanzer/src/Lib/2D/Surface.cpp:1.12 Mon Sep 8 11:32:04 2003
+++ netpanzer/src/Lib/2D/Surface.cpp Mon Sep 8 16:29:09 2003
@@ -3002,7 +3002,7 @@
if (n < 1) return;
// Align to 4-byte dest
-
+#if 0
while (int(d) & 3)
{
//assert(((*s << 8) + *i) < 256 * 256);
@@ -3072,7 +3072,7 @@
}
#endif
}
-
+#endif
while (n > 0)
{
//assert(((*s << 8) + *i) < 256 * 256);
@@ -3248,6 +3248,7 @@
PIX *d = dPtr;
PIX *s = sPtr;
int n = pixelsPerRow;
+#if 0
while (n > 0 && int(d) & 3) {
*d = saturateTable[int(*d) + int(*s)];
++d;
@@ -3311,7 +3312,7 @@
}
#endif
}
-
+#endif
// Cleanup
while (n > 0) {
*d = saturateTable[int(*d) + int(*s)];
Index: netpanzer/src/NetPanzer/Port/blitters.cpp
diff -u netpanzer/src/NetPanzer/Port/blitters.cpp:1.6
netpanzer/src/NetPanzer/Port/blitters.cpp:1.7
--- netpanzer/src/NetPanzer/Port/blitters.cpp:1.6 Mon Sep 8 08:12:19 2003
+++ netpanzer/src/NetPanzer/Port/blitters.cpp Mon Sep 8 16:29:10 2003
@@ -111,7 +111,7 @@
for(y=0; y<y_size; y++) {
memcpy(buffer_ptr, tile_ptr, 32);
tile_ptr += 32;
- buffer_ptr += Screen->getWidth() /*-32*/;
+ buffer_ptr += Screen->getWidth();
}
#if 0
@@ -194,8 +194,8 @@
if(buffer_ptr[x] != 0)
dbuffer_ptr[x]=buffer_ptr[x];
}
- buffer_ptr += Screen->getWidth()-x_size;
- dbuffer_ptr += Screen->getWidth()-x_size;
+ buffer_ptr += Screen->getWidth();
+ dbuffer_ptr += Screen->getWidth();
}
#if 0
@@ -252,11 +252,11 @@
const char color = 0x47;
dbuffer_ptr += frame_offset;
memset(dbuffer_ptr, color, x_size); //top
- dbuffer_ptr += Screen->getWidth()-x_size;
+ dbuffer_ptr += Screen->getWidth();
for(y = 1; y < (y_size-1); y++) {
dbuffer_ptr[0] = color; //left
dbuffer_ptr[x_size-1] = color; //right
- dbuffer_ptr += Screen->getWidth()-x_size;
+ dbuffer_ptr += Screen->getWidth();
}
memset(dbuffer_ptr, color, x_size); //bottom
#if 0
Index: netpanzer/src/UILib/SDL/SDLDraw.cpp
diff -u netpanzer/src/UILib/SDL/SDLDraw.cpp:1.8
netpanzer/src/UILib/SDL/SDLDraw.cpp:1.9
--- netpanzer/src/UILib/SDL/SDLDraw.cpp:1.8 Mon Sep 8 11:32:05 2003
+++ netpanzer/src/UILib/SDL/SDLDraw.cpp Mon Sep 8 16:29:10 2003
@@ -19,11 +19,9 @@
#include "SDLDraw.hpp"
// XXX fixme, need sensefull values here
-unsigned long DBUFFER_VIEW_WIDTH;
-unsigned long DBUFFER_VIEW_HEIGHT;
-unsigned long X_CLIP_OFS;
-unsigned long Y_CLIP_OFS;
-unsigned long OFFSET_TO_VIEW;
+unsigned long X_CLIP_OFS = 0;
+unsigned long Y_CLIP_OFS = 0;
+unsigned long OFFSET_TO_VIEW = 0;
SDLDraw::SDLDraw()
: FrontBuffer(0)
Index: netpanzer/src/UILib/UIDraw.hpp
diff -u netpanzer/src/UILib/UIDraw.hpp:1.7 netpanzer/src/UILib/UIDraw.hpp:1.8
--- netpanzer/src/UILib/UIDraw.hpp:1.7 Mon Sep 8 11:32:05 2003
+++ netpanzer/src/UILib/UIDraw.hpp Mon Sep 8 16:29:10 2003
@@ -50,6 +50,10 @@
{ return curWidth; }
inline int getHeight() const
{ return curHeight; }
+ inline int getViewWidth() const
+ { return curWidth; }
+ inline int getViewHeight() const
+ { return curHeight; }
inline int getBPP()
{ return curBPP; }
}; // end DirectDraw
- [netPanzer-CVS] netpanzer/src Lib/2D/Span.cpp Lib/2D/Surface.cp...,
Tyler Nielsen <=